Ever thought of making an Android App. Today through this blog, we will learn step by step procedures for creating your first Android App.

Pre Requisites:

  1. Android Studio ( Click here to download AS)

STEPS TO CREATE ANDROID APP.

PART 1

  1. Download Android Studio from the above-given

Part 2

  1. Install Android Studio.
  2. After installation, Open AS and select Start a new Android Studio Project under the Quick start menu.
  3. A Create New project window will Name your Project.
  4. Use your Web URL in the Company Domain
  5. Select the location for saving your project, or use the default one.
  6. Click Next
  7. Target Android Devices window will open. Tick only Phone and Tablet.
  8. Click Next.
  9. Add an Activity to mobile will come. Select Blank Activity.
  10. Click Next
  11. Customize the Activity window will appear, Leave all fields as default and select

Part 3

  1. Select xml
  2. Double check DESIGn tab is already open on above XML.
  3. Drag your project from left upper corner to absolute center of the screen.
  4. Under PROJECT FILE SYSTEM, Open
  5. Inside values folder, double click strings.XML
  6. Find your project name in the above file.
  7. Add a welcome message next to project file in strings.xml. Eg Welcome to my App.
  8. Go back to theactivity_main
  9. Now your centered text will be like, projectNAME, Welcome to my App.

Part 4

  1. Navigate to xml.
  2. Find Button in the palette menu.
  3. Select and Drag Button to exact center, below your welcome message.
  4. Select the button and go to Properties Scroll Down and find TEXT.
  5. Edit the value from New Button to Next.

PART 5

  1. On the project File system, Right click on the app, Select New, Activity, Then BlankActivity.
  2. Change the name of Activity to your desired one.
  3. Click
  4. You will be now on design view of your second activity XML.
  5. Drag the text box to the center of your phone display, Same as you did for first activity.
  6. Select the text box and go to properties and find “ID”.
  7. Find and open xml
  8. Add a new line, (same as we did earlier). Eg. “WELCOME TO THESECOND PAGE”.
  9. Go back to your second activity XML
  10. Select Text box, go to properties, change the text field to “@string/second_page”.

Part 6

  1. Go to MainActivity.java
  2. Find OnCreationMethod()
  3. Add following Lines

Button button = (Button) findViewById(R.id.button);

button.setOnClickListener(new View.onClickListener() {

@Override

public void onClick(View v) {

goToSecondActivity();

}

});

  1. Add below given method to MainActivity Class()

private void goToSecondActivity() {

Intent intent = new Intent(this, SecondActivity.class);

startActivity(intent);

}

  1. Find Mainactivity.java and click +
  2. Find the end of Import statements and add the following, if they are not present already.

importandroid.content.Intent;

importandroid.view.View;

importandroid.widget.TextView;

PART 7

  1. Click Green Play Symbol on the software.
  2. Wait for a few minutes and when the Choose Device dialog box comes, select Launch Emulator.
  3. Click OK
  4. Wait for a while and when the emulator loads, Android app will launch your app on the Virtual phone we created at an earlier
  5. Check all your texts and welcome messages are properly displayed along with the button.

Congratz! We have now made our first Android application.

Shares: