How Make Android App



android


To make android app you Need



1.Android Studio Click here to download
2.Java JDK5 or later version Click here to download
3.Java Runtime Environment (JRE) 6



Follow these steps to create your first app



1.Open Android Studio and click on Start a new Android Studio Project.

android app

2.Then give a name to your application and to your company.

android app

3.Then in this step you have to choose minimun android version to run
your app(I will suggest you to use: APII 17:android 4.2(jelly bean))

android app

4.Here choose empty activity and click next.

android app

5.Here we are creating MainActivity so Leave this feild as it is.And click
on finish.

android app

6.Now our project is open.In this project we are going to create to
Activities
1.Our hompage Activity(MainActivity)
2.Second Page Activity.(SecondActivity)
We have already created the MainActivity in step 5.So we have to
create only SecondActivity
To do that click on file(top left corner)then click on activity then choose
Empty Activity as shown in below figcaption

android app

Name it as SecondActivity And click on finish.

So
1.MainActivity is our 1st(Homepage)
2.SecondActivity is our 2nd(second Page)


7.Now we have created our 2 Activities Successfully.Now its Time to
edit them
Now Go to activity_main.xml(MainActivity)To do that CLick on "app"
(top left corner)then click
on "res" then open layout then double click on activity_main.xml
.Here we are going to edit our home page


8.After you open activity_main.xml new window will popup at the right
side

android app

Now drag and drop the the botton from left side as show in above image
This button will take to the second activity.



9.Click on text tab at the bottom side.And change the button text to "Next page"

android app

Or simply Copy and paste the below code into "activity_main.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:layout_height="match_parent"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 android:paddingBottom="@dimen/activity_vertical_margin"
 tools:context="myweb.helloworld.MainActivity">

 <Button
 android:text="Next Page"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignParentBottom="true"
 android:layout_centerHorizontal="true"
 android:layout_marginBottom="171dp"
 android:id="@+id/button" />

 <TextView
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:text="Hello World"
 android:layout_above="@+id/button"
 android:layout_alignStart="@+id/button"
 android:layout_marginBottom="57dp" />
</RelativeLayout>


10.open activity_Second.xml and and go to text tab and and change text to "Welcome to my new app"

Or simply copy and paste the below code into activity_Second.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_second"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 tools:context="myweb.helloworld.SecondActivity">

 <EditText
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:text="Welcome to my New App"
 android:layout_alignParentTop="true"
 android:layout_centerHorizontal="true"
 android:layout_marginTop="206dp" />
</RelativeLayout>


11.Now we have finish with our UI design edit MainActivity.java

12.Go to app then click on java then click on myweb.helloworld then open MainActivity.java
here we are telling our button to go to second activity Simply copy and paste the below code to the MainActivity.java

package myweb.helloworld;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

 private Button button;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

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

 button.setOnClickListener(new View.OnClickListener(){

 public void onClick(View view){
 Intent i = new Intent(getApplicationContext(),
 SecondActivity.class);
 startActivity(i);
 finish();
 }
 });


 }
}




12.So here our application is ready now connect your phone to pc using USB and click on green play button the app will be installed aon your device.:)





You may also like

How to hack twitter

How to hack Any social media

Top 10 apps to earn PaytmCash