Montag, 14. November 2011

Day 1: Android and more

There I was in in the cinema theatre, waiting for the session on Android to start when the anouncement came that there would be a ten minute delay because of some scanner problems at the registration. Phew, glad I registered yesterday :))
In the meantime, on the screen in front, you can follow the Devoxx Twitter.
Everybody in the theatre seems to have a laptop or a tablet or some smart phone.
First session today is packed. I mean really packed. People ended up sitting on the stairs!
Why? The first presentation I chose to attend is...:


Android Jumpstart - Introduction to Android App Development
Speaker: Lars Vogel (http://www.vogella.de/android.html)

This sessions aims to present the basic architecture of Android, and demonstrate the Android Development Tools for Eclipse as well as some basic concepts.
First of all, the latest super duper version of Android is 4.0

- "Almost Open Source"

Android Architecture



The lowest level is basically a Linux Kernel changed a tad. Diferent libraries, e.g power management etc.

Overview of API capabilities
- subset of Java SE
- Android specific API
- rich UI components, full network stack, database functionality
BUT
less memory and CPU boundaries -> it is after all a phone!

- Every Android application runs in its own process, with its own instance of the Dalvik virtual machine.
- you program in Java, and tool "dx" converts Java Bytecode into .dex format


Android Development Tools (ADT) for eclipse
- eclipse bqsed tooling
- provides the emulator (which can be SLOW)
- Android manifest file
- contains all components
- contains the minimum SDK version
- Resources Folder - may contain various resources for diferent resolutions
- Activity - is a single focused thing the user can do
- Views - Layouts are XML based

!Android is allowed to kill your app to save memory!!
-> so it is important to understand Lifecycle e.g states of activity.

There are two methods almost all subclasses of Activity will implement:
- onCreate(Bundle) - where you initialize your activity
- onPause() - where you deal with the user leaving your activity...and where you should save the user data

Topics and things to keep in mind:
- Menus: important to use the flag "ifRoom"
- Intents (explicit and implicit)
- Context (Activity extends Context)
- Preferences
- ListView - gets the data from the adapter(adapter defines the data and how
listItem should be presented)
- ListActivity: provides some nice hooks
- use "convertView" -> if the view is NOT null, we can simple re-use the convertView
as the new View -> good for performance
- findViewById -> NOT good for performance
- holder pattern -> good for performance
- when testing your app, remember to "flip" the device!
- Fragments: supports more dynamic and flexible UI Designs on large screens
- for each device define a layout: easily done in the resources folder

>> Services and Receivers
- allows real multitasking and background processing
- decoupled from activity lifecycle
- services run in the background without interactivity with the user (eg.
NotificationService, VibratorService, LocationService)
-> you can define your own services that should be done in background

>> Broadcast Receiver
- registered as a receiver and only valid within the onReceive() method

>> Security
- "application sandbox": every app is run as its own linux user
- access permission to android functionality is definde in android manifest file
- when installing an app, you can see this information and choose wheter to proceed
or not and so prevent malicious apps from being installed

Other features:
- pull/push to device
- live wallpapers
- simple ListHandling
- animations and styling
- (multi-) touch
- NFC (Near Field Communication)


>> Testing
- Robojuice
- Monkey: basically presses all buttons and input fields randomly!


----------------------------------------------------
Definitely chose the right session to start my Devoxx experience!
Great speaker and really good introduction to someone not yet familiar with Android :))))

Keine Kommentare:

Kommentar veröffentlichen