Android Hello World Application
"Hello World" application. That will display "Hello World" in the middle of the screen in the red color with white background.
Now Here We will create a android application that will display "Hello
world" in the middle of the screen.
Create a Hello Application with empty activity.
and Write below mentioned code in your "activity_main.xml" file.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="#ffffff"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="30sp"
android:gravity="center"
android:textColor="#FF0000"/>
</LinearLayout>
In this application we are not doing anything in MainActivity.java file.
Comments
Post a Comment