Send the link below via email or IMCopy
Present to your audienceStart remote presentation
- Invited audience members will follow you as you navigate and present
- People invited to a presentation do not need a Prezi account
- This link expires 10 minutes after you close the presentation
- A maximum of 30 users can follow your presentation
- Learn more about this feature in our knowledge base article
An Introduction To Android Development
Transcript of An Introduction To Android Development
Hybrid What types of apps are there? It is just loosely coupled Activities, Services, Content Providers and Broadcast Receivers.
All these components are coupled by the manifest file.
Overview of maniest file. So what exactly is an App then? More Details at: http://developer.android.com/guide/components/fundamentals.html What is the application life cycle? App does not shut down when not in foreground
OS may terminate the app at any time
Foreground app given priority over background
Apps closed on an as needed basis What is an Activity? Link:
http://developer.android.com/reference/android/app/Activity.html Activity Life Cycle Fragments Professional Android 4 by Reito Meier (Highly recommended)
Android Class Documentation: http://developer.android.com/reference/packages.html
Android Tutorials and Articles http://developer.android.com/guide/components/index.html
Android Documentation UI Design http://developer.android.com/design/index.html
Android Developer Blog
API Demos Project built into SDK
Stackoverflow.com References Application starts on UI or main thread.
Must never do long lived operations on the UI thread or the App will be terminated by the OS.
Some operations must only be run on the UI thread
Android specific threading support
AsyncTask UI Thread Ways for apps to communicate You can have your app run when the user opens or clicks on a specific URI.
For example to capture this URI in your app: myapp://path/to/whatever?q=This%20is%20a%20test URI Just add this to your manifest:
</intent-filter> Only three aspects of an Intent object are consulted when the object is tested against an intent filter
data (both URI and data type)
Can register for custom intents
Can register for OS intents or other apps Intents <intent-filter . . . >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter> A broadcast receiver is an Android component which allows to register for system or application events. All registered receivers for an event will be notified by Android once this event happens.
For example Android allows that applications can register for the ACTION_BOOT_COMPLETED which is fired by the system once the Android system has completed the boot process. Broadcast Receivers <receiver android:name="MyReceiver" >
<action android:name="myapp.com.mybroadcast" />
</receiver> Custom Broadcast Receiver Intent intent = new Intent();
sendBroadcast(intent); Use fragments, but ensure you use the compatibility library
Design all layouts to be fluid (flow freely to fill all space)
All layouts should really support scrolling, as some devices have incredibly small screens
Use images sparingly, prefer rendering to happen on the device. When images are needed provide ldpi, mdpi, hdpi, and xhdpi versions.
Be careful not to call API methods that don't exist on your minimum sdk, use lint to check for you
Action Bar should be used in all apps, need ActionBarSherlock
When in doubt, clean your project Key Android Takeaways Hello Android! Make hello world project
Make Android 2.3 Emulator Eclipse Overview Show each folder and what goes in it
Talk about externalizing strings and why
Talk about R, what it is for / auto generated / how to access it
Talk about resource density and screen size
Talk about resource qualifiers
Reference: http://developer.android.com/guide/topics/resources/providing-resources.html Eclipse Debugging Three tabs [code / debug / ddms]
Show how to enable debugging on a phone
Show how to build and deploy to phone / emulator
Show how to step code to debug, showing prints being captured. And stepping and inspecting values.
Inject a bug on purpose, and show how you would be able to track it down to where in the code it crashed. Android Layouts Common Layouts Hello World Lab Google Sample Projects How to make sample projects including API demos List View Lab Linear Layout LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. You can specify the layout direction with the android:orientation attribute.
http://developer.android.com/reference/android/widget/LinearLayout.html RelativeLayout http://developer.android.com/guide/topics/ui/layout/relative.html
http://developer.android.com/reference/android/widget/RelativeLayout.html RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left of center). ScrollView Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. Consider how each moves data Starting an Activity Depends on goals Start it now, I don't need to know how it went
Start it now, tell me what happened
Start it in the background
Someone handle it
Someone else start it
PendingIntent Keep Hacking Extra things we can do:
Update HelloWorld to use LinearLayouts instead of RelativeLayouts
Update Navigation to take you to a new Activity upon clicking a row
Pass the name of the country in the clicked row to the new activity
Have the new activity display the name of the country it was passed
Add A TextView and a button to the child activity
Make a click of the button return you to the list
Make the button click return the text in the TextView
Toast the returned data to the user if it's not empty
Update Navigation to use different heights for odd and even rows