How I Created an app using Jetpack Compose
Welcome to codingbihaar.com in this tutorial we will learn to create a new project in Android Studio.An Android Studio an IDE for building and testing Android App. If you are beginner and you don't have any idea of about IDE then it is the best IDE for you to build an Android App as it is by Google.
We can not only build android apps for smartphones using android studio but also build apps or tools for devices which run on Android such as Cars, TVs, watches etc.
3. Set the Name, Package name in my case it is Coding Bihar. Accept all other defaults.
4. Click on Finish.
![Create a project Hello World using Jetpack Compose Create a project Hello World using Jetpack Compose](https://blogger.googleusercontent.com/img/a/AVvXsEher5h938x3LAiXmtwLZhVYbnIIBxeDMBWYTnoOrXcZ8pN-e0Wmvpp1SxqiY_e8pfBTLjdHxTUJVg_O1oJmkw6QVo4D2pa00v1kFJYZHL6edX4b-vaFHFAlyRmeWaXEZALN1yb2hMhzg-u9eHXixP3tBwGDBIzi69z77rYVhZwBQtL087Sbq1r6n8RK8A=w213-h320-rw)
Download a latest version of Android Studio and install it on your PC, after a successful installation we launch the IDE by double clicking on the Icon in the download folder where Android studio was saved and follow the following steps to create a New Project in Android Studio.
Why you should use Android Studio?
- It is developed by Google.
- It is free the platforms where you can build apps without coding are paid.
- It has feature of live rendering that makes our coding time faster.
- It has emulator that allow us to test our App on a range of different devices available in the market.
- It has Project Template and sample project to learn.
- It has inbuilt Gemini AI .
- It is easy to use.
- We can access training and courses free and paid both for it.
What is jetpack compose?
- It is developed by Google.
- It is free the platforms where you can build apps without coding are paid.
- It has feature of live rendering that makes our coding time faster.
- It has emulator that allow us to test our App on a range of different devices available in the market.
- It has Project Template and sample project to learn.
- It has inbuilt Gemini AI .
- It is easy to use.
- We can access training and courses free and paid both for it.
jetpack compose is the latest toolkit for building Android App's UI based on Kotlin language and the version which we are using for this tutorial is Android Studio Koala 🐨 the latest version by Google.
How to create a Project in Android Studio?
Steps :
If you don't have Latest version please Install the Latest version of Android Studio from the Official Website : https://developer.android.com/studio
1. Create a new project by selecting New Project If you re on welcome screen.
If you are already opened the project then to create a New Project Go to File > New > New Project
2. Select Empty Compose Activity and select the Phone and Tablet category then click Next..
3. Set the Name, Package name in my case it is Coding Bihar. Accept all other defaults.
Note : Kotlin is the only available option because Jetpack Compose works only with classes written in Kotlin.In the Minimum API level dropdown menu, select API level 26 or higher.
4. Click on Finish.
To know more about Jetpack Compose and learn what you can do with the toolkit, read the basic tutorial on Jetpack Compose.
Now we have the following window of this is the Android Studio Latest version at the time of writing this post so it may be a little different UI if you have different version so don't worry now you can run your program on your real device or Android Emulator.
MainActivity
OUTPUT : This is the result when we run our First Android App.
How to edit module-level Gradle build file?
If you want to use Relay Gradle plugin you have to add Relay plugin in the module's Gradle file.
1. To add relay gradle plugin Click on Gradle Script and open the build.gradle file.
2. Add the below code in build.gradle file and
plugins {
id("com.android.application")
id("kotlin-android")
id("com.google.relay") version "0.3.12"
}
3. click on Sync Now.
Note: Relay supports Jetpack Compose version 1.2 or newer versions.
Also Read
Jetpack Compose Components
![Sandeep Gupta](http://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik2MuJw6Nf2-H9oGwPbg9a1QMtCY8PfIaaqNzq0234pnt65zt6Hary1M9RhmPv54pxWQarfRKzCfvrLFMXcH-tToe0LJHW8VCbi28zIjF4w-LifXw7BdSzNCII5QyqNyFAF2fjPn-VJej9q6e0xG1_rbeireNQegXwm21kLDDvaKqy8A/w130/author%20(1).png)