Create Your First App (Fire Tablets)
This topic shows you how to use Android Studio to create a Hello Fire app. For more information about how to create your first Android app, see the Build your first Android app tutorial in the Android documentation.
Prerequisites
Before you begin, you must have already set up your development environment. For more information, see Setting Up Your Development Environment for Fire Tablets.
Create Your App in Android Studio
To create a Hello Fire app, you first need to create a new project in your IDE. Use the following steps to create a new project in Android Studio:
- Open Android Studio.
- Click New Project.
- In the New Project window, select Empty Activity and click Next.
- In the New Project details window, in the Name box type HelloFire and click Finish.
A Brief Overview of Android Apps
In our Hello Fire app, the MainActivity.kt file is responsible for core logic and the layout specific to the app and is typical Kotlin for an Android activity. In the Empty Activity app template, this file is located in the app > java > com.example.hellofire folder.
Customizing Hello Fire
To edit the Hello message in the app:
- Under the HelloFire project, open the app > java > com.example.hellofire > folder and open MainActivity.kt
-
In
setContent
, underHelloFireTheme
, changeGreeting("Android")
toGreeting("Fire")
.class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { HelloFireTheme { // A surface container using the 'background' color from the theme Surface( modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background ) { Greeting("Fire") } } } } }
You are now ready to run your Hello Fire app. For information about configuring your Fire tablet to run your app, see Connect to Fire Tablet through ADB (Fire Tablets).
Last updated: Jul 06, 2023