Menus

Friday, 24 June 2016

Running a Simple App


Setting up your projects in Android Studio



In this section first explain to setting up your projects on Android Studio.

The first step in the application development process is to create a new project within the Android Studio environment.

First open android studio and goto menu File -> New -> NewProject


New Project 

Once this windows appears, Android studio is ready for a new project to be crated. Fill the all field in new project window.




Target Adroid Studio

This window help to select the form factors your app will run on.

The minimum SDK version determines the lowest level of Android that your app will run on.






Add an Activity to Mobile


The next step is to define the type of initial activity that is to be created for the application.
A range of different activity types is available when developing Android applications. 
simply select the option to create a Blank Activity.






Customize the Activity






Finally, click on Finish to initiate the project creation process.


User Interface Designer tool


This window is used to create user interface and add or edit code. 




Application test to run for click to run button




Running a simple APP


Android Application Add two numbers Calculator adding two numbers in android 

public void onButtonClick(View v){

        EditText e1 = (EditText)findViewById(R.id.editText);
        EditText e2 = (EditText)findViewById(R.id.editText2);
        TextView t1 = (TextView)findViewById(R.id.textView4);


        int num1  = Integer.parseInt(e1.getText().toString());
        int num2  = Integer.parseInt(e2.getText().toString());

        int sum = num1 + num2;

        t1.setText(Integer.toString(sum));

        
    }

}

















No comments:

Post a Comment