Skip to main content

How to Build a Basic Android App

Mark has earned a Masters of Information Technology from Middle Georgia State University, and works in the field of Application Development

Welcome to Android Studio

  1. First Download the latest version of Android Studio
  2. Click on Start a new Android Studio project:
how-to-build-an-android-app

Create New Project window, enter the following values:

  1. Application Name: "My First App"
  2. Company Domain: "com.example.myfirstapp"
  3. Click the Include Kotlin support check box
  4. Click the Next button
how-to-build-an-android-app

Target Android Devices

  1. Select API 24: Android 7.0 (Nougat)
  2. Select Next
how-to-build-an-android-app

Add an Activity to Mobile

  1. Select Empty Activity
  2. Select Next
how-to-build-an-android-app

Configure Activity

  • Click Finish
how-to-build-an-android-app

Default Project has been built

  • Basic Build
how-to-build-an-android-app

MainActivity.kt update:

  • Add the following entries as highlighted below
how-to-build-an-android-app

Add new Kotlin File/Class

  1. Right Click on com.example.myfirstapp
  2. Select New
  3. Select Kotlin File/Class
how-to-build-an-android-app

Name of New Kotlin File/Class

  1. Type in text box for name: DisplayMessageActivity
  2. Select OK
how-to-build-an-android-app

DisplayMessageActivity.kt update:

  • Add the following entries as highlighted below
Scroll to Continue
how-to-build-an-android-app

AndriodManifest.xml Update:

  • Add the following entries as highlighted below
how-to-build-an-android-app

Activity_Main.xml

  • Select Design + Blue Print
how-to-build-an-android-app

Activity_Main.xml

  1. Select the Text Tab
  2. Add the following entries as highlighted below


how-to-build-an-android-app

Add a new layout resource file

  1. Right Click on layout
  2. Select New
  3. Select Layout resource file
how-to-build-an-android-app

New Resource File

  1. Type in text box for File name: activity_display_message
  2. Select OK
how-to-build-an-android-app

Activity_Display_Message.xml

  1. Click on the Text tab
  2. Add the following entries as highlighted below
how-to-build-an-android-app

Build-Gradle (Module app)

  1. Add Dependencies to Build-Gradle (Module app)
  2. Sync Gradle
how-to-build-an-android-app

Gradle.Properties (Project Properties)

  1. Optional pending on any error you might receive during compiling
  2. Sync Gradle
how-to-build-an-android-app

Rebuild Project

  1. Select the Build tab
  2. Select Rebuild Project
  3. Review any errors that might come up
how-to-build-an-android-app

Build Project

  1. Select the Run tab
  2. Select Run 'app'
how-to-build-an-android-app

Select Deployment Target

  1. Select your phone or a virtual device that you have configured
  2. Select OK
how-to-build-an-android-app

Successful Built

Review if there is any error's at this point the app should be running on your phone or virtual device.

how-to-build-an-android-app

© 2018 Mark Riepe

Related Articles