There are more than 2.8 million Android apps in the Google Play Store. And the app development market was worth $58.7 billion in 2018. These numbers are astounding and are still on an upward trajectory. Hundreds of apps are being developed and added into the Play Store every day.

More and more people are learning how to develop mobile apps and taking it up as a career. In this article, we take a look at how you can develop your first Android app.

Image Credit: pixabay.com

What language is used for Android app development?

You need to have a good knowledge of Java for Android app development. It is the official language of Android Studio, which is the native integrated development environment (IDE) for Android applications. 

But Java isn’t the only option for developing Android apps. You can also use C++, Kotlin, JavaScript, and HTML, which will come in handy especially during cross-platform app development projects.

How to use Android Studio for app development?

Android studio is a comprehensive IDE, consisting of the SDK (tools for programming), and a Virtual Device where you can preview your program. It has an intelligent Code Editor with the IntelliJ IDEA interface, which auto completes your codes. With the Virtual Devices’ support, you can test the performance of your application under a wide range of device models. The IDE also has a feature known as Instant Run, which allows you to see how your program runs in real-time on various devices as you make changes to your code

Besides Java, Android Studio also supports C++ and Kotlin. 

Android Studio is a complete package letting you build anything, from simple Hello World apps to the most interesting role-playing games (RPG).

Here is how you can set up and install Android Studio on your computer and start creating your very first app.

Download and install Java

First, your PC should be able to  run Java. You need to download and install the Java JDK.

Step 1: Go to Java’s the official link. Download the file and follow the instructions to install it.

Step 2: Launch Control Panel. Go to System and Security > System >Advanced System Settings. 


Step 3: Under the Advanced Tab, click on the Environment Variables tab.

Step 4: Click on Path and Edit. Add the path where you have installed Java followed by a  \bin. Usually, it is C:\Program Files\Java\ (JDK version you installed)\bin

Save the settings and exit.


After doing this, open the Command Prompt on your computer and type in “java -version”. It should return a value shown in the screen below; your Windows PC now recognizes the programming language. 


Now that you have Java installed in your PC, you will need to install Android Studio.

Download and set up Android Studio

Android Studio is free for download on its official website. After downloading the exe file, install the program, and launch it on your PC by following the on-screen instructions. Make sure you also install the virtual device by checking the box.

As you run Android Studio for the first time, it will also download the required SDK tools.

Start a new project

Launch Android Studio. You will see an option to start a New Android Studio project. Click on it to open the IDE for the first time.


Select a theme

The next step is choosing a theme for your application. You will be given a list of Devices and Activities. An activity is the screen of an app that lets users perform specific actions. In other words, it is where you will create the user interface (UI) for your user.

Android Studio has pre-created activity templates, for example, for Google Maps and log in, which you can customize to how you want them to look like. Select one and click on Next.

Give your project a name

Enter your app name and company domain, which, in most cases, is the website of your firm. On the same screen, you can also choose the programming language you want to use for the activity. If you want to select C++, go back to the previous step and you will see C++ native as an activity itself. 

Finally, click on Finish, and you can start your work.

Understanding the components

We named our app New App, and as you start Android Studio, you will see the following screen.


This is the activity of your Android app that you are currently working on. You can add your codes on this screen to make your app behave in a certain way.

To change the layout of the screen, you will need to modify the XML code. To access it, click on the activity_main.xml tab next to Mainactivity.java.

The screen saying “Hello World” is the current screen of the app page you are editing. 

Building a program in Android Studio

Now, the next step for you to do is learn Java. We are not going to do that in this article, but we are going to modify the above XML file a little and change the text to create the most basic program. Then, we will build it so that it can run on a device.

Here are steps for changing the “Hello World” text to something else.

Step 1: On the activity.main, right-click, and then select Go to > Declaration or Usages.

Step 2: As you do that, you will go back to the XML editor.


Step 3: On the top right, click on the three horizontal lines to open the text version of the XML editor.


Step 4: Edit the “Hello World” into something else. Again, go back to the visual layout editor to see the changes to your app.


Running your program in Android Studio

Step 1: Go to the Build menu on the top. Click on Make Project. You can also press Ctrl+F9.


Step 2: Below, you will see a notification saying Gradle Build is running.

It will turn to Gradle Build Finished after some time. This means the build is complete.


Step 3: To run the App, you need to create a virtual device. Click to the tab above Mainactivity.java, and open AVD Manager.


Step 4: Create a New Virtual Device and select your device model. Follow the on-screen instructions. You may need to download extra files.



Step 5: When everything is done, go to the Run menu and select Run App.


Then, the Virtual Device will start, and you will see your application on a screen like this. 


How to export your app to an Android phone?

To install the app, you should first enable Developer’s Options on your phone. For this, you can go to your phone’s Settings > About and tap on the Build Number a couple of times. If it doesn’t work, you can Google search your phone model and see how to do it. Then, launch Settings again, and scroll down until you see Developer’s Options. Tap on it, and turn USB debugging on.

Next, install the ADB driver on your PC. Connect your phone to your PC via USB, and you will be shown a prompt on whether you want to enable USB debugging. Tap on “always trust this computer”.

Launch Android Studio and you will see the name of your device on the tab that lists virtual devices. Select your phone and launch the program, and the app will be installed (and launched) on your phone.


The above steps were for you to check your application on a device before exporting it. To export the app to your phone, go to Build > Generate Signed APK.

 

You will see two options, one is Building an App Bundle to upload on Play Store, and another is the APK. APK is an installer; if you want to test your app on your phone, select APK.

You will need to generate a key store path, i.e. the location on your computer where the key store will be kept.


The APK will be stored in the destination folder that you selected. Copy the APK to your phone via USB and run it on your device.

Leave a Reply

Close Menu