11. Why Java?
• Mature Language
• Massive open source community
• Excellent tools/IDEs
• Large, slow bloated Virtual Machine
- Dalvik = Small, fast optimized Virtual Machine
• All benefits, no disadvantages
- Except?
12. What is Android?
How was growth achieved?
• Operating system, built on Linux
• Compiler, debugger, emulator, VM
• Open sourced code under Apache 2 license
• Open Handset Alliance – 84’ish Companies
- Why?
- Open standards to allow it to grow
- Ability to compete – Apple, Symbian/Nokia, RIM, Microsoft
- Google = Smart
• Android vs. iPhone?
13. Open?
• Yes… but No…
• Open
- A license that insures the code can be modified, reused and
distributed
- A community development approach
- Assurance the users have total freedom over the device and
software.
• Google has achieved ½ of openness – Legally Open
Source
• Is their ‘community development approach’ any different
than Apple or RIM?
14. Money?
• What kind of a company is Google?
• How do they make money?
• Android simply makes them better at doing what they’ve
always done best.
15.
16. 3 Things
• Activities = Screens
• Views/Widgets = Components
• Intents = Messages - used for navigation (among other
things)
17. Activities = Screens
• Screens have lifecycles on Mobile devices
- onCreate() — Activity is first created
- onStart() — Becomes visible
- onResume() — Interacting with the user
- onPause() — Current activity-> another activity resumed
- onStop() — No longer visible to the user
- onDestroy() — Before the activity is destroyed
- onRestart() — Restarting again
20. Views – Cont’d
• To add views to a screen/activity, create hierarchy of
views, then call setViewGroup(…) in the activity.
• Layout may contain layout and buttons, text fields, radio
buttons, etc.
21. Intents = Messages
• Main communication mechanism in Android
1) Used to call other apps or screens – This is us!
2) Send a message to someone who is listening
- Low battery
- Time zone change
3) Start a service
- Download a file
- Start/Check the status of a process
22. Intents/Messages
What do they contain?
• Component name – Unique identifier of component
- This is an explicit intent
• Activity
- ACTION_CALL
- ACTION_EDIT
- ACTION_SYNC
- ACTION_VIEW
• Data
- URI and MIME type (http://www.protegra.com)
• Category
- Logical Grouping of activities
• Extras
- Key/Value pairs
24. Summary
• Screens = Activities
• Screens have components (Views) to manage layouts
as well as widgets, etc.
• Activities call other Activities, invoke services and send
messages using Intents