Android Development Learning 1

Source: Internet
Author: User

1. Development needs environment

Need to go to Google to download ADT, and ECLIPSE,JDK. The ADT is then loaded as an Eclipse plug-in.

2. Introduction to Android Project structure

SRC-Storing code files

Gen-xml and code transfer files are generated automatically by the program. No need to modify

Assets-Resources Directory

Bin-Output directory, no need to modify

Androidmanifest.xml-The overall configuration file

3. Basic structure of Android application

Application-Broadest scope

Activity-the control of a single view, the transfer of information between activity requires the help of application. Scope under Application

Final start application which one to use, the activity entrance with which. The Androidmanifest.xml configuration is complete.

4. View-based Hellow World program

4.1 Creating an empty Android project

4.2 Create a layout XML file under Res-layout as a configuration for view placement. Then drag a button up

4.3 The displayed view is then set under the default activity, as well as the button content bindings.

 Packagecom. hont.learn2;Importandroid.app.Activity;ImportAndroid.os.Bundle;ImportAndroid.view.View;ImportAndroid.widget.Button; Public classLearn2activityextendsActivity {/**Called when the activity is first created.*/@Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate);                Setcontentview (r.layout.mylayout); FinalButton button = (Button) This. Findviewbyid (R.id.button1); Button.setonclicklistener (NewView.onclicklistener () { Public voidOnClick (View v) {//TODO auto-generated Method StubButton.setheight (Button.getheight () +5);    }        }); }}

4.4 This time, the button will be higher for each click.

Android Development Learning 1

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.