Presented at: Cafit Reboot, Calicut
We have all seen many apps which works seamlessly without internet.
WhatsApp lets you see all past messages and lets you post message, delivering it as soon as it gets internet.
Same for GMail, Evernote and many others.
In this talk, I will talk my experience building such app and basics required for it.
8. Intent & Intent Filters
Intent
◦ Implicit
◦ Share a joke (text)
◦ Open maps link
◦ https://www.google.co.in/maps/place/Kozhikode,+Kerala
◦ Explicit
◦ Open another screen (activity) in my app
Intent Filter
◦ Capable to share images
◦ Capable to open links to my domain Source: http://slidenerd.com/2014/10/31/android-intents-explicit-and-implicit-intents/
25. Sync Adapter – When to run
When server data changes
◦ GCM
◦ ContentResolver.requestSync()
When device data changes
◦ Content Provider detects change
◦ ContentObserver.onChange()
Periodically
◦ At regular intervals
◦ Specific times of day
◦ ContentResolver.addPeriodicSync()
On demand
◦ In response to user’s action
◦ ContentResolver.requestSync()
26. Additional benefits
Loaders
◦ Asynchronous loading of data
◦ Auto refresh on content change
◦ Plugs in well with ContentProvider and Cursors
◦ https://developer.android.com/guide/components/loaders.html
Sharing data across apps
System checks connectivity for you