DEV Community

Khubaib Khan
Khubaib Khan

Posted on

How to Make Android Applications?

How to Make Android Application?
Introduction
Have you ever thought about making your own mobile application for fun or profit? Of course you have. Everyone has.

Mobile applications are the cornerstone of the modern technological world, and the most popular platform for them is Google’s Android operating system. There are more than 2 billion active devices running it today!

Software Tools to be Installed
Here are the software tools you will need to install:

Android SDK

Java Development Kit (JDK)

You can download these software tools from the internet. The android SDK gives you the API libraries and developer tools necessary to build, test, and debug apps for android. The java development kit (JDK) provides you with the components necessary to compile, debug, and run applets and applications that you've written using the java programming language.

Steps to Create your first Android Application with Eclipse
Install Eclipse IDE along with Android SDK and configure Android SDK with Eclipse.

This step is easy. Just follow the steps mentioned in official tutorials on developer.android.com to install Android development tools: Installing the Eclipse Plugin and System Requirements for Eclipse IDE

Create an Android Virtual Device (AVD)

An AVD is an emulator that simulates a specific mobile device on your computer and lets you install, create, test and debug applications for that mobile device without actually having the physical device by your side.

To create an AVD, go to Window menu > Android Virtual Device Manager or click on AVD Manager icon as shown below:

In new window, click on New button to create a new virtual device for testing your app:

Fill out the details in next window such as name of AVD, system image (choose any one from installed images), etc.:

Create a new Android project in Eclipse

Now that you have eclipse IDE setup along with all required plugins and an Android Virtual Device, it’s time to create your first android application project: Select Preferences tab from left pane, then choose target platform (Android 2.1) as shown below:

Before you begin,
Before you start making an application, it is important to make sure that your computer has Java installed, and that you have read the documentation. You should also have an android phone and a good internet connection, as this will help you in testing the application later on.

Creating a new project
Creating a new project.

Go to File ⇒ New ⇒ New Project and enter your Application Name. Make sure you note down the package name as you will need it later when we start coding our App.

Select Target Android Devices by checking Phone and Tablet checkbox and select minimum SDK version 15 so that our app can run on almost 95% of the android phones/tablets. Now click next

Select Empty Activity and click next

In new window, check Generate Layout File box, which will create an activity_main xml layout file where you can design your application UI using ConstraintLayout(if its not available then use RelativeLayout). Keep other things as default and click finish

Setting the perspective,
Select the Java perspective by clicking Open Perspective and selecting Java.

Click OK.

The Java perspective contains all of the tools you will need to create, debug, and run Android applications. These tools are not available in other perspectives (such as the Resource perspective).

Debugging an Android Application.
USING THE DEBUGGER

To debug a program, you need to first set the breakpoints where you want the execution to stop. To do this, open the “main.kt” file by double-clicking on it. This will open the code on a right pane as shown below:

Click on the line numbers and press F8 or right-click and choose Toggle Breakpoint option as shown below:

javatpoint_android_debugging_3Now run your application by pressing Shift + F10 or right-click and select Debug 'HelloWorld'. This will start debugging your application in debug mode as shown below: javatpoint_android_debugging_4Here, when we click on "Say Hello", execution stops at breakpoint because we have set it up beforehand. Now we can check various variables or change them for debugging purpose.

An android application can be made in Eclipse IDE
Download and install Eclipse.

Download and install Android SDK.

Download and install ADT plugin for Eclipse.

Create a new 'Android Application Project' in Eclipse IDE.

Run the android application project in Android Virtual Device Manager (AVD).

Write the java code for the application.

Top comments (0)