First Android App

Source: Internet
Author: User

This is the process of documenting the creation of the first Android app. The app is built using an easy-to-use Android application development software ADT Bundle for Windows.

1. Open Eclipse Software, the following welcome interface appears first


2. Create an Android project

3. Next step

4. Next step, make a custom icon

5. Next, set whether you need to create Activity

6. Next, create Activity setup Information

7, complete. Displays the structure of the Android project that was created successfully

8. ADT provides interface design tools


9. Now that the project has been successfully established, let's take a look at the program list:

Layout file Hello_world.xml

<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 "    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=". Helloworldactivity ">    <textview        android:id=" @+id/textview1 "        android:layout_width=" Wrap_ Content "        android:layout_height=" wrap_content "        android:text=" @string/hello_world "/></ Relativelayout>

Java file Helloworldactivity.java

Package Com.example.helloworld;import Android.os.bundle;import Android.app.activity;import android.view.Menu; public class Helloworldactivity extends Activity {    @Override    protected void onCreate (Bundle savedinstancestate ) {        super.oncreate (savedinstancestate);        Setcontentview (R.layout.hello_world);    }    @Override Public    Boolean oncreateoptionsmenu (Menu menu) {        //Inflate the menu, this adds items to the Action bar I F it is present.        Getmenuinflater (). Inflate (R.menu.hello_world, menu);        return true;    }    }

10. Run the Android app via ADT

To establish ADT:


Operation Result:


First Android App

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.