Android's Simple beginner Learning

Source: Internet
Author: User

Say light with the environment on the death of me, not to say how difficult, is recently Google was screen, a lot of the SDK inside need to download things are not down, pit dad ah. Finally with sweep lash to a he configured, before running.

Android Directory Analysis:

Assets assets directory, storing files, these files will be packaged into the application APK (installation package)

Bin compiled file directory

The Gen catalog automatically generated directories

Project.Properties represents the compiled version of target = "" To modify the compiled version

LIBS Support JAR package will be added to Android depend directory

Drawable Store icon for application
H High resolution
M medium
L Low
X Extra Large
XX Extra Large

Layout layouts

Androidmanifest.xml application's manifest file program configuration information, launch icon, application name Package name, version number

The process of software installation under Android:
1: Copy xx.apk to data/app/xx-1.apk
2: Create a folder under the Data/data directory, named after the package name of the program
An opposite process when uninstalling

ADB simple instructions:

ADB devices
Kill-server
Install an app to your phone
ADB Install xx.apk Installation
ADB Uninstall com.xx.xx.apk Uninstall

adb-s xxxx Install xx.apk Specify which device to install


ADB pull files everywhere from the phone
ADB push pours from external file to inside phone

ADB pull Xx.txt yy.txt
ADB push Yy.txt/sdcard/xx.txt

ADB shell: Mobile terminal (Linux system) created by the AVD

#:。。。。。。

To view port usage:
Netstat-ano

Implement a simple input phone number, call:

Package Com.example.dailphone;import Android.support.v7.app.actionbaractivity;import Android.support.v7.app.actionbar;import Android.support.v4.app.fragment;import Android.text.TextUtils;import Android.content.intent;import Android.net.uri;import Android.os.bundle;import Android.view.LayoutInflater;import Android.view.menu;import Android.view.menuitem;import Android.view.view;import Android.view.View.OnClickListener; Import Android.view.viewgroup;import Android.widget.button;import Android.widget.edittext;import Android.widget.toast;import Android.os.build;public class Mainactivity extends Actionbaractivity {/** call button */private Button bt_dail;/** The text box when the phone is entered */private EditText et_number; @Overrideprotected void OnCreate (Bundle savedinstancestate) { Super.oncreate (savedinstancestate); Setcontentview (r.layout.activity_main);//Get button Bt_dail = (button) findViewById (    R.id.bt_dail);    Get text Box Et_number = (EditText) MainActivity.this.findViewById (R.id.et_number); Add event bt_dail.setonclic to a buttonKlistener (New Mylisenner ());} Private class Mylisenner implements Onclicklistener {@Overridepublic void OnClick (View v) {String number = Et_number.gette XT (). toString ();//The empty operation gives the "spin" hint if (textutils.isempty (number)) {Toast toast = Toast.maketext (Mainactivity.this, " Number cannot be empty ", toast.length_short); Toast.show (); return;} intention, want to do one thing (tea) Intent Intent = new Intent (); intent.setaction (Intent.action_call); Intent.setdata (Uri.parse ("Tel:" + number); StartActivity (intent);}}}

  

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.