Coding Bihar

Android App Development

Coding Bihar is dedicated to providing you with the knowledge and tools you need to excel in Android development. Start your journey with us and transform your app ideas into reality with Jetpack Compose. Connect, learn, and grow with Coding Bihar today!

Creating an app in Jetpack Compose

Creating an app in Jetpack Compose  - Coding Bihar

android basics compose course

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.


Download a latest version of Android Android Studio, 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.

What is jetpack compose?

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.

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 that, in the Language dropdown menu, 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 24 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.

Empty activity

Write the project name

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

image


OUTPUT : This is the result when we run our First Android App.

Create a project Hello World using Jetpack Compose

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.
App Gradle Relay Plugin

 Sandeep Gupta

Posted by Sandeep Gupta

Please share your feedback us at:sandeep@codingbihar.com. Thank you for being a part of our community!

Special Message

Welcome to coding bihar!