It will be a simple program in which we will see how to output a sample text, say, Hello World in an android virtual device.
Steps to create a hello world project on android studio.
Steps to create a hello world project on android studio.
- Crate a project in android studio.
- Update your main_activity.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:gravity="center" android:layout_height="match_parent" tools:context="com.pankaj.helloworld.MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" /> </RelativeLayout>
- No change in your MainActivity.JAVA
package com.pankaj.helloworld; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
- Now all the development has completed for hello world application, Please run the project.
- Now you will see result screen-
- Good bye, Thanks to read this blog.