1.Android Application and development environment

Source: Internet
Author: User

the development and present situation of 1.Android mobile phone platformAndroid founder Andy Rubin. 2008.9.22 first Android Phone: t-mobile G1 2010.1.7 Google's first co-branded mobile Nexus One (HTC G5)
architecture and features of 2.Android mobile phone platformThe bottom layer is built on Linux and the Android system consists of 5 parts:Application Layerapplication framework: Both Android-provided programs and programs provided by ordinary developers have access to the Android-provided API framework. Libraries: We cannot call these C/+ + libraries directly, but can be called through the application framework. Android Runtime: Android Core library and Dalvik virtual machine. Dalvik virtual machine and JVM differences: The JVM loads bytecode directly from the. class or Jar package and runs it, and Dalvik runs a proprietary Dex file that requires the DX tool to compile the application's. class file into. dex File. 3. Build a development environment for Android appsSDK Manager Structure:
DOCS:SDK development files and API documentationExtras: USB drive provided by Google, additional toolkits such as hardware acceleration provided by IntelPlatform-tools: Platform-related toolsSamples: Platform-related toolssources:android Source Code
using the real Machine Debug USB connection, mobile phone manufacturer official website Download driver, set to developer mode, tick "Do not lock Screen", "USB debugging", "Allow analog location"   4. Managing virtual devices for Android    Debug with AVD: Set the android_sdk_home environment variable to save the location of the virtual machine 5. Using the Android emulatorSimulator has no network signal, only the computer running the simulator has been networked, should have a network, if the computer is not networked, you can change the computer DNS server is set to the same as this machine. 6. Use of the Debug tool DdmsDalvik Debug Monitor Service Device Panel information output panel: Thread tracking Panel: Device Panel point show thread Updates heap memory trace panel: Heap Memory allocation and recycling Information Simulator Control Panel: Control The simulator calls the text Message File Management dialog box: 7. Use the ADB tool to copy files, install APK, etc.Android Dubug Bridge, you can complete the emulator files and computer files to copy each other, install the APK app, but directly to the Android system to execute the Linux command. 8.DX, AAPT tool usage  The DX tool is used for future Android apps to convert *.class files into *.dex files for Android Asset Packaging Tool (AAPT) packaging resource packs. 9. Developing Android apps with ADT in Eclipse1. Create Android Project 2.XML layout file summary definition application user Interface 3.Java code write business implementation 10. Mastering the structure of Android appsLibs res src Androidmanifest.xml: The application package name, which will be the unique identity of the app. Applications that contain more components, such as activity,service,broadcastreceive,contentprovider applications that are compatible with the minimum version of the application, use system-required rights to declare other applications to access the program The required permission declarations
  
 
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- 指定该应用的包名,该包名可用于唯一地表示该应用 -->
  3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  4. package="com.llc.helloworld"
  5. android:versionCode="1"
  6. android:versionName="1.0" >
  7. <uses-sdk
  8. android:minSdkVersion="14"
  9. android:targetSdkVersion="17" />
  10. <application
  11. android:allowBackup="true"
  12. android:icon="@drawable/ic_launcher"
  13. android:label="@string/app_name"
  14. android:theme="@style/AppTheme" >
  15. <!--定义Android应用的第一个组件:Activity,该Activity的类为 .MainActivity
  16. 并指定该Activity的标签 -->
  17. <activity
  18. android:name=".MainActivity"
  19. android:label="@string/app_name" >
  20. <intent-filter>
  21. <!-- 指定该Activity是程序的入口 -->
  22. <action android:name="android.intent.action.MAIN" />
  23. <!-- 指定加载该应用时运行该Activity -->
  24. <category android:name="android.intent.category.LAUNCHER" />
  25. </intent-filter>
  26. </activity>
  27. </application>
  28. </manifest>
program permissions for 11.Android apps
1. Declare the permissions required to run the app itself, <manifest. /> element Add <user-permission: /> child elements
 
   
  
  1. <!--声明该应用本身需要打电话权限 -->
  2. <user-permission android:name="android.permission.SEND_SMS"/>
2. Declare the permissions required to invoke the app, <activity. /> element Additions<user-permission. /> Common permissions: P29 four components for 12.Android applicationsActivity: The specified component can only be displayed by Setcontentview (View)     Service: A separate life cycle, typically providing background services for other components or monitoring the running state of other components Broadcastreceiver: Unlike normal event listeners, the event source that the normal event listener listens to is the object in the program.broadcastreceiver Monitor Source is Androidother components in the appContentProvider: There is a need for real-time data exchange across applications. communication between components is based on intent, and intent encapsulates the information of the target component that the current component needs to start or trigger. intent is divided into explicit and implicit: explicitly explicitly specifying the class name of the component that needs to be started or fired. implicitly only specifies what conditions should be met by the component that needs to be started or triggered, and intentfilter to determine if the implicit intent is met 16. Sign the Android appSignature: Determines the publisher identity, developers can use the package name to replace the installed program, using the signature can avoid this situation.     To ensure application integrity, the signature processes each file in the app package, ensuring that the files in the package are not replaced. Step: Right-click on Android Project, "Export Signed application Package" command line for "unsigned" packet signing: Keytools.exe tool in JDK directory to generate digital certificate Ttips:eclipse Unable to export the Android signature Pack issue:
The following error is reported when exporting a signed APK program with Eclipse: Export aborted because fatal lint errors were found. These is listed in the problems view. Either fix these before running Export again,or turn off "Run Full error check when exporting app" in the Android > Lin T Error checking preference page.
Workaround: Open the Windows menu under the Properties tab in Eclipse, under the Lint error checking on the left Android below the run full Error check will be removed from the front of the exporting app You can do it.




      

From for notes (Wiz)

1.Android Application and development environment

Related Article

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.