Archos Android based connected home solution - DroidCon Paris 2014
Droidcon Eastern Europe 2013 - Efficient REST client Android applications
-
Upload
marius-florian-mailat -
Category
Technology
-
view
844 -
download
0
description
Transcript of Droidcon Eastern Europe 2013 - Efficient REST client Android applications
Efficient
REST Clientapplications
by
Eugen Arbuleac & Laurentiu Onac
What is
REST?
What is REST?
client server architectural style1
2
3
4
exchanges resources
broadly adopted
commonly used over http
Mobile friendly web pages
VSREST Mobile apps
Apps advantages OVER Web sites
integration with the platform1
2
3
4
Run in background
Consistent UI
users prefer native apps
WrongAPPROACH
Wrong Approach
Activity - UI thread
Worker thread
REST Request
Wrong Approach
Limited memory
No persistence
21
GoodAPPROACH
Good Approach
Activity - UI thread
Service - UI thread
Content provider
Handler
Crud
NOTIFY
initiate rest request
Worker thread
REST Request
Content observer
Response
parser
service helper
callback
RESOURCE STATE UPDATE
Good Approach
Use services
1Use
worker threads
2
3Use
content providers
Even better Approach
Use push notifications
4
notify new dataserver
Even better Approach
Content provider
Sync adapter
Use Sync adapter
5
server
1. requestsyncdata
Handler
2. PASS sync data
3. INIT Request
4. Response
5. parse6. CRUD