How to make android apps
In this page, you will know how to create the simple hello android application. We are creating the simple example of android using the Eclipse IDE. For creating the simple example:
Create the new android project
Write the message (optional)
Run the android application
Hello Android Example
You need to follow the 3 steps mentioned above for creating the Hello android application.
1) Create the New Android project
For creating the new android studio project:
1) Select Start a new Android Studio project
hello android example
2) Provide the following information: Application name, Company domain, Project location and Package name of application and click next.
hello android example 2
3) Select the API level of application and click next.
hello android example 3
4) Select the Activity type (Empty Activity).
hello android example 4
5) Provide the Activity Name and click finish.
hello android example 5
After finishing the Activity configuration, Android Studio auto generates the activity class and other required configuration files.
Now an android project has been created. You can explore the android project and see the simple program, it looks like this:
hello android example 5
2) Write the message
File: activity_main.xml
Android studio auto generates code for activity_main.xml file. You may edit this file according to your requirement.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="""
xmlns:app=""
xmlns:tools=""
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="first.javatpoint.com.welcome.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello Android!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
}
File: MainActivity.java