android dev
DESCRIPTION
TRANSCRIPT
Android Platform(1)
Android Platform(2)Linux for device drivers, memory management, process management, networking
Next level up is the android native libs, written in c/c++ internally. Call from java interfaces.
Dalvik VM. Dalvik runs dex files, converted from standard class file at compile time.
Application Framework, for developers
More about Dalvik
It is optimized for low memory requirements, and is designed to allow multiple VM instances to run at once, relying on the underlying OS for process isolation, MM and thread support.
one app 16m memory
Dev environmentJava
Android SDKs + source code
libs,
dev tools: dx, aapt, adb, ddms, ant scripts
Simulators, docs, sample codes
Eclipse + ADT (optional)
android-project
Application Fundamentals
Activities/Services/Content Providers/Broadcast receivers
Intent(async messaging bundle)
Manifest File
layouts
resources
Activity
Associate with layout-view
In stack(could be multiple instances)
Lifecycle
UI(Main) thread/Other threads:
Don’t block the UI thread
Do not access the android ui toolkit from outside the UI thread
AsyncTask
intent-example-oauth1. <activity android:name=".ArticleActivity">
<intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:scheme="mashableoauth" android:host="twitt"></data> </intent-filter>
</activity>
2. ArticleActivity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL()))); 3. protected void onNewIntent(Intent intent) { Uri uri = intent.getData();
if (uri != null && uri.toString().startsWith(CALLBACK_URL)) {
....
}
Layout/ViewTwo kinds of UI elements, one is layout(manager), the other is View
SDK provides lots of layouts
SDK provides lots of views, like list-view, button, text-view, image-view, progress dialog....
custom-view steps(measure then layout)
direct use the canvas to draw the view
Resourcesdrawable assets, (png, xml)
strings
styles
UI patterns (http://www.google.com/events/io/2010/sessions/android-ui-design-patterns.html)
Performance Tips
Caching (weak reference)
Improve ListView (http://www.google.com/events/io/2010/sessions/world-of-listview-android.html)
Other tips
http://www.google.com/events/io/2010/sessions/beginners-guide-android.html
devguide(http://developer.android.com/guide/practices/design/performance.html)
your own app/game?Publishing, no app review on android-market
User experience is the most important thing
UI/Navigation
You have 5 seconds for user operations to finish, but 100-200ms, user feels the lag
widgets, notifications, services