Online Document: http://developer.android.com
Tuturial:- Android Development Tutorial (Simple)
- Professional Android 2 Application Development
) - Pro Android 2
- Android A programmers guide
%5B1%5D.Hill.Android.A.Programmers.Guide.Jul.2008.eBook-DDU.pdf
- Preparation
- Android Features
- Java virtual machine: Dalvik
- Browser: based on Webkit engine
- Graphic: 2D, and 3D (OpenGL)
- Data store: SQLite
- Media: audio, video, and images
- GSM
- Bluetooth, WiFi, 3G, EDGE
- Camera, GPS, compass
- Supported Operating System
- Linux(i386)
- Windows
- Mac OS X(intel)
- Supported Development Environment
- Eclipse IDE(Recomended)
- Eclipse 3.4 (Ganymede) or 3.5 (Galileo) with Eclipse JDT plugin
- JDK (JRE alone is not sufficient)
- NDK (optional) to develop native application (JNI)
- Android Development Tools(ADT) plugin
- Apache Ant
- Apache Ant
- JDK (JRE alone is not sufficient)
- ...
- Supported Programming Language
- Java to write application
- C/C++ to create native shared libraries to be invoked in Java application via JNI (Java Native Interface)
- Postfix of Application Installation Package: .apk
- SDK Contains
- Class library
- Emulator
- Some use tools, such as ddms, adb, etc.
- Sample Code
ApiDemos under SDK is very useful.
- ...
- ...
- Development Flow
- Create Android project with Eclipse, and create run configuration file via Eclipse
- Write source code
- Prepare layout configuration file in xml format for each window, these xml file must be placed in /res/layout for both landscape and portrait styles screen, or /res/layout-land for landscape style screen, or /res/layout-port for portrait style screen. You can also create UI elements in your source code
- Copy necessary images files used in layout xml files or source code to /res/drawable, or /res/drawable-land, or /res/drawable-port
- It is optional to create arrays.xml, attrs.xml, dimens.xml, string.xml, and styles.xml in /res/values
- Copy necessary raw files to /res/raw which Java application can read datas from during run-time.
- Write Java source code, there are 4 typs of java components:
- Activities
- Services
- Content Providers
- Broadcast Receivers
- Update manifest file named AndroidManifest.xml to:
- Declare application name and version
- Declare activity(window) when to launch the application and other activities
- Declare receivers (optional)
- Declare uses-permissions (optional)
- ...
- Sign
Any package should be signed, otherwise, it can't be installed to Android mobile devices. No certificate authority takes responsibility to sign application, you just need to sign your appliation by your self.
- Build project in Release mode, since Eclipse/Ant will sign apk with debug private key automatically in debug mode.
- Use keytool to generate a private key
- Use jarsigner to sign .apk
- Use zipalign to optimize the final .apk
- Install/Uninstall
- For application has not published on store
- Use via Eclipse
- Use tool 'adb'
- Use file explorer, such as AndExplorer.apk, astro, etc.
- xxx
- Debug
- Set build mode to "Debug" in Eclipse
- Set to "Enable USB debug" on the device
- ...
阅读(1572) | 评论(0) | 转发(0) |