3-minute introduction to Android development

Source: Internet
Author: User

    • Installing ADT

Specific installation can see this address http://jingyan.baidu.com/article/b0b63dbfa9e0a74a4830701e.html

ADT Address: http://dl-ssl.google.com/android/eclipse/

    • Create a new Android app
    1. Select File-new-android Application Project

ApplicationName: The name is displayed when the app is installed on the phone.

Name of the project shown in Projectname:eclipse

PackageName: Package name. The Android system uses the package name to differentiate between the different biei programs. So the name of the package should be unique.

Minimum Required SDK: Minimum compatible version

TARGETSDK: Target version.

Compile with: Which version of the SDK will be used by the program to compile.

Theme: Subject, general election none.

Click Next

Continue Next

Choose Finish to create a simple Android project.

    • Various parts of the Android program

SRC: Sprints to place Java code

Gen: The contents of this directory are automatically generated. There is mainly a R.java file

Assets: When the program is running, it can read the contents dynamically. If you use WebView to load the local page, all the pages are placed in this directory.

Bin: Files generated at compile time are placed here.

Libs: Generally put a third-party jar package

Res: All image, Layout, string and other resource files are placed in this directory.

Androidmanifest.xml: Configuration file

Project.Properties: When compiling, use the SDK version.

    • Resources in the project

Folders that start with drawable are used to put pictures. So many folders are meant to make the program compatible with more devices. Under normal circumstances, put all the pictures under the drawable-hdpi red AH.

Folders that begin with values are used to place strings.

Layout folder: It is used to put the layouts file

Menu folder: Put the file

    • Run

Connect your Android phone to your computer, and under Eclips's Window menu, open show View-other-android-devices

You can see a mobile connection.

Right-click the project name and select Runas-android application:

Then the program is installed and running on your phone.

Note: 1, when running the project, the phone can not lock the screen. Because some phones will ask if you want to install, if the lock screen, it will not install the timeout. 2. Before accessing the mobile phone, be sure to adjust the phone to developer mode. This allows the ADT to be plugged in. If you do not know how to adjust the phone to developer mode, you can ask Baidu Oh.

    • Reference string

Let's take a look at the Strings.xml under values

There are two ways to reference a string in XML

1, in the code through the R.string.hello_world to reference

2. Referencing by @string/hello_world in XML

Where a string can be changed, such as a reference to a picture, you can replace it with drawable. The layout file can be replaced with layouts. And so on

    • References to strings in the project

1. The app name is displayed after installing to the phone. In the Androidmanifest.xml file

2, open the app to enter the main screen display HelloWorld. In the Res-layout-activity_main.xml file

    • Problem

If you want the "Hello world!" display on the homepage Change to "Hello, welcome". Need to modify that place?

3-minute introduction to Android development

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.