hello friends
today we study about our android fist example HELLO WORD ,
TO SHOW IN YOUR ANDROID PHONE with example and setting up ANDROID STUDIO .
and also setting to your mobile to run application IN ANDROID SMART PHONE
NOW WE START
1) SETTING UP STUDIO ,
today we study about our android fist example HELLO WORD ,
TO SHOW IN YOUR ANDROID PHONE with example and setting up ANDROID STUDIO .
and also setting to your mobile to run application IN ANDROID SMART PHONE
NOW WE START
1) SETTING UP STUDIO ,
- REFER DOWNLOAD A JAVA UPDATE VERSION AND INSTALL IN YOUR PC OR LAPTOP .
- GIVE PATH TO JAVA follow link https://www.javatpoint.com/how-to-set-path-in-java
- now download ANDROID STUDIO FROM GOOGLE ,PURIFIER NEW VERSION AT AVAILABLE IN THAT SITE https://developer.android.com/studio/index.html
- AFTER download run .it takes some time to download component so make sure to some passion , it take more than 1 hour ,
The Main Activity File
The main activity code is a Java file MainActivity.java. This is the actual application file which ultimately gets converted to a Dalvik executable and runs your application. Following is the default code generated by the application wizard for Hello World! application −
package com.example.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); } }
The Layout File
The activity_main.xml is a layout file available in res/layout directory, that is referenced by your application when building its interface. You will modify this file very frequently to change the layout of your application. For your "Hello World!" application, this file will have following content related to default layout −
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:padding="@dimen/padding_medium" android:text="@string/hello_world" tools:context=".MainActivity" /> </RelativeLayout>
Step by step:
- Connect your phone to computer via USB.
- Development option create by click on about phone> Kernel version (tap on that at list 8 time thane create a developer option . on your hend-set ) now time in a Mi and VIVO phone not required to create option , it was automatic generated by connect usb to your system .
- Enable USB debugging on your phone: Settings -> Applications -> Development -> USB debugging.
- Change Run configuration in your Eclipse project: right click -> Run As -> Run Configuration
thank you
connect with us , comment section for more
next section will be continue with some other example on android WIDGETS ,
No comments:
Post a Comment