Java developer try Jetpack Compose for first time
5 years using Java and now its time for Jetpack Compose.
Background
I’ve worked with international clients, and I guess I’m a full-stack developer because I’ve created projects using both web and mobile technologies, such as Node.js, Flask, Java, Flutter,React, Mongo, and more…
Recently, I received a notification from Google stating that my developer account for publishing Android apps would be deleted. This is because although I have experience developing mobile apps for clients, I have never uploaded my own app to my profile.
Also, I only had two days to create and launch my app, which happened to be my weekend, because the following day I needed to start working on a new project for an important client.
So I thought Okay, let’s do this.’ It’s time to dive into Jetpack Compose, one of the newest technologies recommended by Google for developing mobile apps.
And also, being an Android developer, I know it’s crucial to stay updated with new technologies.
Looking for some idea
I know that just to try out Jetpack Compose, I could create a Hello World, launch the app on Play Store, and solve my problem. However, I decided to truly learn how easy or hard it is to implement a basic feature using Jetpack Compose. I looked for some ideas, considering that I only had 2 days to do it, so it wasn’t possible to create an app with complex functions. Searching online, I found one idea that caught my attention: creating an app about learning cooking.
Why? Because, at least in the region where I live, men don’t enjoy cooking as much. And yes, it’s often assumed that men don’t like to cook because it’s traditionally seen as a task for women. However, sometimes it’s because men don’t have easy access to tools for learning to cook native meals. We recognize the need to change this perception.
So I asked myself, ‘Are there any apps available on the Play Store that showcase typical meals from my country in one app?
I did a search on the Play Store, and there was only one app available for it. I downloaded the app to see what it offers, and indeed, it provides a list meals native to my country. However, it seems that the developer is from another country, and what they did was simply duplicate the app, changing the name for each country.
My app needed to offer something new and make it feel more authentic to my country.
What’s new is my app offering?
To make my app interesting and different from the only app available that shows a list of meals native to my country, I decided to implement the following feature:
- Show videos on how to cook the meals.
- Keep updated prices of food and ingredients so users can plan what ingredients they need to buy or learn.
Technically, my app should to provide:
- Onboarding
- Bottom Navigation View
- List
- Images
- Searching
- Youtube video streaming
- Http Request
- Circle loader while server data is fetching
- Modal Bottom Sheet for some extra options 😉
- Shared Preference
- Share text for other chat apps to invite to download the app
- Notifications
- Email contact intent
- Internazionalization
- Services running in background
On the other hand, it is necessary:
- Create a nodejs server to provide data to the app and keep updated with new meals and prices.
- Use Firebase Hosting to deploy the server.
- Use Firebase messaging to send notification to the user.
- Develop my app using a comprensive structure dividing the code in packages like: components, screens, utils, etc…
Result
If you would like to test an app made with Jetpack Compose try:
Cocina Nica was the result of two days of development using Jetpack Compose and Node.js, with the aim of helping people learn to cook traditional dishes from my country. I aimed to offer something new and unique on the Play Store, keeping product prices updated if you want to try cooking some recipes and helping you make a good choice.
Review
Was it really easy to create an app using Jetpack Compose as Google claims? The reality is… it depends on your development skills and experience.
Prior to this project, I was working on a personal project using Flutter. Perhaps for this reason, I didn’t find it so difficult to understand how complex Jetpack Compose is, as both use declarative programming. However, transitioning from Java to Jetpack Compose was quite a leap.
But for sure, creating apps using Java + XML, and noticing that you can create both the UI and functionality in a single file without ID linking, can be confusing the first time.
One of the most impressive things I experienced using Jetpack Compose is how fast the build process is. Sometimes, I only needed to wait three seconds to test the new build.
Conclussions
It’s essential for mobile app developers to stay updated. Don’t shy away from new technologies, or you’ll fall behind. This new declarative programming approach, gaining popularity with frameworks like Flutter or Jetpack Compose, looks awesome.
While reviewing my LinkedIn profile, I was surprised by the high demand for Android developers with skills in Kotlin and Jetpack Compose. Perhaps it’s becoming a reality that Java is being phased out.