How to Develop an Android App With Android Studio?

Android App With Android Studio

Due to increasing graph of Android users,Today play store is full of different type of apps.

Even every business focusing more on Android app Development  than any other mobile OS platform.

This is because most of the Users are following Android.And the second reason is building an Android app isn’t as hard.

Compare to iOS app development and any other mobile OS platform.

As an android app developer. You might have faced a lot of pressure from the client side as well as from your company side to complete the project as soon as possible.

We think most you are suffering from it. Aren’t You?

So to overcome this  your primary step is to think how you can accelerate your work?

Android Studio development Environment is the best option for you.

So,We created this post which is based on the basics of how to build an Android app using the Android Studio development environment.

In this post we are not going to use much code, as we assume that you know enough Java to understand or are willing to look up what you don't.

So, Let's get started..!!

1) Install Android Studio

  • Go to download Android Studio.
  • Use the installer to install Android Studio following its instructions.

2) Open a New Project

  • Start Android Studio.
  • Click on the "Quick Start menu" and under it select "Start a new Android Studio project."
  •  In "create new project" window, name your project "hello World" or you can choose according to your project name.
  •  Keep the file location according to your desire.
  •  Make sure on that "Phone and Tablet" is the only box that is checked
  •  If you are planning to test the app on your phone, make sure the minimum SDK is below your phone's operating system level
  •  Click next
  •  Now select blank activity
  •  Again click next.
  •  Leave all of the activity name fields as it is.
  •  Click "finish."

Note- It is a typical naming convention in Android projects to set the company name as some form of "example.name.here.com".

3) Edit the Welcome Message in the Main Activity

  • Open activity_main.xml tab if it is not already open.
  • Also, make sure design tab is open on the actvity_ main.XML display.
  • Now click on "hello world" and drag it from upper left corner of the phone to the main centre of the screen.
  • On the left side window in the project file system. Open the values folder.
  • Under the values, folder makes a double-click to open strings.XML file.
  • Under the file find the line " hello world".
  • After the message "hello world" add another message "welcome to my app".
  • Return back to activity_main.xml tab.
  • Check once your centre text are appearing like "Hello world Welcome to my app" or not.

4) Add a Button to the Main Activity

  • Click on Design tab of the activity_main.XML display.
  • Find the Button to the left of the phone display in the palette menu.( under the heading widgets).
  • Select Button and drag it to the centre underneath of your welcome message.
  • Make sure your button is still selected.
  • To fill the button text click on properties menu ( on the right side of your screen) and scroll down to find the field for "text".
  • Now change the text of button and keep "next page" or you can change it according to your project.

5) Create a Second Activity

  • At the top of the project's file system tree, right click on "app."
  • Navigate through to New > Activity > Blank Activity.
  • Change the name of this activity to "SecondActivity".
  • Click "Finish."
  • Make sure you're in the Design view of activity_secound.xml.
  • Drag and drop the text box in the upper left of the phone display down to the centre as you did on the Main Activity.
  • From the text box select "id" menu from the properties menu on the right, and set it to "text2".
  • Open the file strings.XML again.
  • There add a new line "hello world welcome to my app" change it into " Welcome to the second page."
  • Return back to activity_secound.xml.
  • Select the text box again.
  • In the properties pane, Module set the "text" field to "@strings/secound_page".
  • Make sure text box now appear as "welcome to the second page" and is in the centre of the screen on the phone display.

6) Write the Button's "onClick" Method.

  • Click on the MainActivity.java tab along the top of the work environment.
  • Add the following lines of code at the end of the onCreate method:Button button = (Button) findViewById(R.id.button);button.setOnClickListener(new View.onClickListener() {@Overridepublic void onClick(View v) {goToSecondActivity();}});
  • .Add the following method to the bottom of the MainActivity class:private void goToSecondActivity() {Intent intent = new Intent(this, SecondActivity.class);startActivity(intent);}
  • Click the + next to import at the third line of MainActivity.java to expand the import statements.
  • Add the following to the end of the import statements if they are not already there:Import android.content.Intent;Import android.view.View;import android.widget.TextView;

7) Test the Application

  • At the top of the Android Studio window, you will find Green play symbol click on it
  • "Choose Device" dialogue box will appear. There select "Launch emulator" option.
  • Then click ok.
  • When the emulator opens (this too could take a while), the app will automatically launch the app upon the virtual phone being unlocked.
  • Make sure that all of your text displays correctly and that the button takes you to the next page.

8) Final Step

Congrats! You created your first android application with some basic functionality. Your completed app is having a greeting page and a button which take the user to a second page.

And if you are a beginner to Android app development. Then you must learn Android Studio. This android app development platform will make your work easier and faster.

Watch this video to learn how to make simple clicker Android application using Android Studio.

https://www.youtube.com/watch?v=0wrJA3mAcSo

ABOUT THE AUTHOR

Sunny Chawla
Sunny Chawla
Sunny Chawla is a CEO at AIS Technolabs which is a Web/App Design and Development Company, helping global businesses to grow. He is having expertise in Digital Marketing, Game Development & Product Development.