More Related Content
Similar to MDAD 6 - AIDL and Services (20)
More from Alexandru Radovici (20)
MDAD 6 - AIDL and Services
- 2. Bibliography
1. Mark MURPHY, Beginning Android 2, Apress,
2010
– Capitolul 30
2. Lesson: Concurrency,
http://java.sun.com/docs/books/tutorial/ess
ential/concurrency/
2
- 6. Service Implementation
• Extends Service
– Simple service
• void onCreate ();
• void onStart (Intent intent, int startID);
• void onDestroy ();
– Using AIDL
• void onBind (Intent intent);
• void onUnbind();
6
- 8. Service implementation
1. Extend Service
– Implement functions
– Create threads
2. Declare in manifest
3. Start / stop
– startService (…)
– stopService (…)
8
- 9. Example
• Display one prime number each second
– Service does not start automatically
– Service does not stop automatically
9
- 16. AIDL
• Similar to Java
• Identical declaration
• Limited variable types
– primary (int, long, float, double, char, boolean)
– String
– List*
– Map*
– Special types
* Needs to contain only AIDL specific types
16
- 18. AIDL => clasă
• IServiciuFilme.aidl
– IServiciuFilme.Stub
• Abstract class containing the functions in the Interface
18