First Android Program

Source: Internet
Author: User


In fact, is not the first, has been written in accordance with a few books, but the wood has written the blog, or the first one.



Platform: Android Studio version 3.0


100 years of constant "Hello, world".


Use of ADB


The direct installation here is Android Studio, and it is connected to the real machine debugging.


Engineering directory structure for Android Studio

The project configuration file generated by the. Idea://as, similar to Eclipse's project.properties.

App://as Create a module in the project.

gradle://the jar and wrapper of the build tool system, the jar tells the as how to build contact with the Gradle of the system installation.


Java://java code, including engineering and new is the default generated test engineering source Res://resource file, similar to eclipse.    drawable:    layout://app Layout and interface element configuration    mipmap:    values:        colors.xml://profiles that define colors.         strings.xml://defines the configuration file for the string.         Styles.xml://Defines a style's configuration file. Manifests:    Androidmanifest.xml://app basic information (Android Admin file, also entry file) Gradle Scripts


Res directory all resource files will be generated under the R.java file corresponding resource ID, we can directly through the resource ID access to the corresponding resources, the R file can be understood as a dictionary, each resource under res will be here to generate a unique id!


Three important documents

Mainactivity.java


Layout file: Activity_main.xml:



Configuration file Androidmanifest.xml:
The activity component that contains the filter in the Androidmanifest file is the default startup class that the system calls automatically when the program starts

< Intent-filter >    <  android:name= "Android.intent.action.MAIN"/>    <   android:name= "Android.intent.category.LAUNCHER"/></ Intent-filter >

Intent-filter indicates that the activity will be executed first when the program is opened.

First Android Program

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.