- Developer's Commute
- Posts
- I tried making AI in Kotlin but I failed. - Developer's Commute
I tried making AI in Kotlin but I failed. - Developer's Commute
In this newsletter we will explore more about Mobile System Design, AI with Kotlin and Future of Android apps
Good Morning, It is your captain speaking. Welcome aboard the Developer’s Commute.
APP CORE CONCEPT
Gif by scaler_official on Giphy
Breaking down Mobile System Design
I wanted to level up my app development skills. But, I do not want to develop the same old chat applications with Firebase. I wanted something exciting and challenging.
What is one skill that is useful to all app developers despite of their language?
Answer — Mobile System Design
Parts:
Level 1: Governing Limited Resources of Mobile
Level 2: Understanding App Development Specifics
Level 3: Understanding Design Patterns
Level 4: Understanding the UI architecture
Level 5: Understanding Backed data pulling
Level 6 - High-Level architecture
Learn more about it here:
Sponsor:
This newsletter is sponsored by me. If you want to sponsor this newsletter. You can reach out to me on Twitter.
New things in Android
The Android development world is ever-changing, gone are the days of simple apps (not really). Now is the time for AI apps. Or we can say integrating AI into existing apps. We can do that with the new Gemini Pro model which is available for Android developers.
Here is an interesting aspect of Android development with Jetpack Compose. Zee5 saw a 1.5x increase in their engagement rates with the help of multiple form factors.
My Thinking: (Take it with scepticism)
I think we are moving towards the future of app development. More and more users will rely on AI to make things easier, convenient and accessible in their apps. So, AI is a mainstream tool. But, simple apps which are convenient to use will always thrive in the market.
Making AI in Kotlin
If you guys have been following me on Twitter. Then you might have seen me build a card game with the help of Jetpack Compose. I have already made some mechanisms, designed the UI and made the UI in compose. All that remains is some logic.
But I am struggling with one piece of logic. It is the enemy AI in my game. As you may have realized card game AI are complex. They seem simple but the logic is tougher than you might anticipate. Games like TicTacToe use simple logic like the minimax algorithm to select the position of X or O. One aspect of card games that makes the AI difficult to write is we do not know what cards the user has. In the case of TicTacToe, we know that the user is either playing X or O. But, cards have different values and strategies.
Problem Statement:
Here is my problem statement. If you guys want to solve it and contribute to the open-source app. Here is the link.
I am writing a minimax algorithm to play with cards. Suppose that there is a meter that gets filled every second by 5 points up to the score of 20. Ai has the cards of (15,5)(35,10)(50,15) and user has the cards of (35,10)(50,15)(65,20). Each of the AI or user plays cards according to the points in the meter. For example, if the card plays 15,5. 15 is the attacking value and 5 is the value used from the meter. Both the user and AI have their meters. If the ai plays the card of 15,5 it uses the 5 value of the meter. Now it has to wait for a second to regain the value of 5. Also once the card is played. Ai cannot play it again. The same is true for the user. Now I want to write an algorithm for AI so that it can pick and choose cards to play against the user. write it in Kotlin. You can understand this statement as writing an Ai player for Clash Royale.
App link:
I have already tried something. Here is the link:
If you want to give me some feedback you can find me on Twitter.
> Here <
This is for today I hope enjoyed this newsletter. If you enjoyed it please let me know and if I have written something wrong please forgive me.
Thank you for reading
Regards,
Developer Commute’s Captain
Free Ebook
Dad Developer Meme
Tweets That You Might Love
Tweets That You Will Find Interesting
Netflix Tech Stack (CI/CD Pipeline)
Let’s explore the innovative tools and techniques behind Netflix's world-class continuous delivery pipeline.
Planning: Netflix Engineering uses JIRA for project planning and Confluence for documentation.
Coding: Java is the primary language… twitter.com/i/web/status/1…
— Sahn Lam (@sahnlam)
6:13 AM • Feb 4, 2024
One of my friends made an app
He wanted to release it in public and monetize it
But he had no idea how to:
- Test the Idea
- Find Ideal audienceHere is everything I have learned:
(1/13)
— Hitesh Kohli | App Developer (@Hitesh__kohli)
3:34 PM • Jan 31, 2024
I failed an Android development interview
The interviewer gave me some tough love
After the interview, I decided to work hard
Here is everything I have learned Part 2:
(1/10)
— Hitesh Kohli | App Developer (@Hitesh__kohli)
8:49 AM • Feb 3, 2024