36:12 - Service API - Quick run through example 38:25 - Content Provider API 44:00 - Content Provider API & Sync Adapter - Sync Adapter is the ability of the system to help you synchronize remote and local content. 48:03 - Conclusion - Key takeaways
After more than four years the possibilities are essentially the same. Android should offer a decent API for network requests: all of the approaches described in the talk are incredibly complex for a task as simple as performing get and post queries.
What a difference with today's presentation. Back in 2010 they were explaining you how to use the Android OS for doing stuff. These days they just tell you to use 3rd-party libraries because, apparently, they haven't been able to innovate and give us devs better, easier tools (API's) to implement these basic use cases present in almost every Android app.
Simply amazing, how long I see people are #inspiredby Virgil Dobjanschi and referencing this video. Many libs are created, following this great talk. Thank you, Virgil.
Why it's better to have an Application installed comparing to Web page: Integrates with Android OS; can use intents from other apps. Can offer intents to other apps. Can run in background. Can work in limited connectivity environment Faster than Web browser. Consistent with Android environment. Most users would choose App when both app and web pages are offered.
Excellent! Did I miss something because I have not seen anything about user authentication and session management. How do you authenticate the user before and during REST calls?
Wonder if it's the same PhDs which implemented awesome OO making you extend MapActivity when the screen contains a map, or FragmentActivity when it has fragments...
These patterns of synchronization data, after you restart the phone? In these implementations, the service hangs in memory, with intervals of trying to implement REST request. But if this is not possible then appropriate flags in SQLite will remain in STATE_POSTING/STATE_UPDATING/STATE_DELETING?
Is this still relevant? Moreover, working with the ContentProvider should be asynchronous and how do you maintain concurrency between network and db access?
I would call them Android strategies for REST service, instead of architecture, also i think he failed mention that this approaches can be combined to have a better structured, specially the last two. But +1 for all the tips we should call this "The Dobjanschi Approach"
Hi, could i know why i should use content provider instead of sqlite database? I thought the data is not always intended to be shared to other application.
Is it really a good idea to store the update state in the database? If the app crashes before an update is complete, a restarted activity may erroneously think there's an update thread running for ever, when in reality it has crashed.
Nice presentation, i will use it in communication with Jersey into an embbeded Jetty. Maybe i will try this pattern (and concepts) to trasmit between Android and Arduino (throught Bluetooth). Thank you.
@russellperry Well Separation of role always comes with a cost. Android System design also makes these worse.. you have content provider but need to execute the operation in a separate Service with a separate thread.
The best explanation I have experienced is through the Udacity (free) courseware - see lessons 8 and 9 here: www.udacity.com/course/new-android-fundamentals--ud851 and code with various branches - tracking the course - is here: github.com/udacity/Sunshine-Version-2 You can also browse through the tons of student implementations of "Popular Movies" - the final project for the Nanodegree. The student projects are on github and most include a Content Provider to pull data from TheMovieDb.
Guys... It's true that there is no use for this " hyper-redundant nonsense to get a simple JSON result back and parse it". But if you are actually writing a two-way rest app, using put, post, delete and caching, things become a lot more complicated. Unless you are willing to sacrifice performance. Just saying.
I have posted an implementation of Option C using ContentProvider API and SyncAdapter. This tutorial provides all of the code samples used to build a working example of a RESTful android app. Feel free to visit the "About" page on my Google+ profile.
I hope there is something easier. In a web app using query, I can do simply: $.ajax(url, options, data, callback). I do not need to understand all this mumbo jumbo just to perform HTTP GET/POST. This is 2014 - I googled for an hour and I still do not think there is anything as simple for Android as Jquery for a Web application.
All of the patterns described are only suitable for very simple value objects. What about complex objects (deep maps, bigger binary data, 3rd party objects that can't be marshaled or are simply too big for intents)? Can someone explain why local services and content providers can't pass objects to activities? Personally I think that these are awful design choises. What a nonsense...
This guy has the most annoying voice, I wish they would dub it over with someone like Ian McKellen as narrator. And like most Google employees, you get that slight I'm-soooo-much-smarter-than-you attitude. Ugh.
36:12 - Service API - Quick run through example
38:25 - Content Provider API
44:00 - Content Provider API & Sync Adapter - Sync Adapter is the ability of the system to help you synchronize remote and local content.
48:03 - Conclusion - Key takeaways
After 4 years, after Volley, after Loaders, this is the cleanest and secure architecture approach IMO
After more than four years the possibilities are essentially the same. Android should offer a decent API for network requests: all of the approaches described in the talk are incredibly complex for a task as simple as performing get and post queries.
What a difference with today's presentation. Back in 2010 they were explaining you how to use the Android OS for doing stuff. These days they just tell you to use 3rd-party libraries because, apparently, they haven't been able to innovate and give us devs better, easier tools (API's) to implement these basic use cases present in almost every Android app.
+Davide Schembari +1
The google devs work on a lot of 3rd party libraries too
do you have the link/title of this most recent (which mybe now in 2022 is also considered old") presentation? I couldn't find it...
A must watch for all android enterprise developers
nervous or not this dude is awesome!!! I
liked the talk . I could understand him clearly. Good job bro
Simply amazing, how long I see people are #inspiredby Virgil Dobjanschi and referencing this video. Many libs are created, following this great talk. Thank you, Virgil.
eg. github.com/path/android-priority-jobqueue
Great info Virgil! I've been searching the web for android REST examples and am so psyched to actually find a video from the guy that writes the apps!
Excellent video. I'm working on a multi-user project management app and I think the third pattern is exactly what I need. Thanks for the info.
Years later, Room and RxJava finally make this easy.
Virgil Dobjanschi thanks a lot for this, really informative and well structured presentation.
I am happy to see that even google employees can be nervous at presentations. Now I feel not so bad about my own presentations anymore :)
Excellent presentation! Very informative. Thanks.
Android has advanced so much!
Thank you for this excellent and informative video.
Great architecture/design discussion. Use this design for your next Android Restful app (please:)
That's exactly the reason I love the Android API :)
great session, i learned a lot from it
Why it's better to have an Application installed comparing to Web page:
Integrates with Android OS; can use intents from other apps.
Can offer intents to other apps.
Can run in background.
Can work in limited connectivity environment
Faster than Web browser.
Consistent with Android environment.
Most users would choose App when both app and web pages are offered.
Is there an updated version of this talk? If not, hopefully there will be soon. :-) Like it!
Thank you very much for this info...
Is there a video/documentation talking about today's stand? Of "Android REST client applications"? I'm grateful for anything!
R.I.P., Wave :,(
Excellent! Did I miss something because I have not seen anything about user authentication and session management. How do you authenticate the user before and during REST calls?
Wonder if it's the same PhDs which implemented awesome OO making you extend MapActivity when the screen contains a map, or FragmentActivity when it has fragments...
Slide deck:
dl.google.com/googleio/2010/android-developing-RESTful-android-apps.pdf
is there a better implementation for Android now in 2013 and are there other API's which have simplified the process to make it less complicated?
These patterns of synchronization data, after you restart the phone? In these implementations, the service hangs in memory, with intervals of trying to implement REST request. But if this is not possible then appropriate flags in SQLite will remain in STATE_POSTING/STATE_UPDATING/STATE_DELETING?
Is this still relevant? Moreover, working with the ContentProvider should be asynchronous and how do you maintain concurrency between network and db access?
You have to implement the AbstractThreadedSyncAdapter abstract class.
I would call them Android strategies for REST service, instead of architecture, also i think he failed mention that this approaches can be combined to have a better structured, specially the last two. But +1 for all the tips we should call this "The Dobjanschi Approach"
Hi, could i know why i should use content provider instead of sqlite database?
I thought the data is not always intended to be shared to other application.
44:11 What's a SyncAdapter? I don't see any class by that name, nor SyncManager. I see SyncAdapterType, but it's pretty light on documentation.
HOw should android app connect with database of website.
As basic as this question is, I need to download a stock SyncAdapter and Calendar Sync for my SG3 (not rooted). Can someone help me please?
@FernandoEscher87 no it doesn't it does not goes deep enough on the SyncAdapter
He is a programmer, not a presenter. I understand him :)
Thanks alot , is there any sample code that we can look at ?
Is there a new link with sample code?
Is it really a good idea to store the update state in the database? If the app crashes before an update is complete, a restarted activity may erroneously think there's an update thread running for ever, when in reality it has crashed.
You could circumvent this with timeouts, of course, but I feel like it's better to use a static Java Map in your Service object.
Nice presentation, i will use it in communication with Jersey into an embbeded Jetty. Maybe i will try this pattern (and concepts) to trasmit between Android and Arduino (throught Bluetooth).
Thank you.
Very good presentation! Is there sample code which I can use as a starting point?
@russellperry Well Separation of role always comes with a cost. Android System design also makes these worse.. you have content provider but need to execute the operation in a separate Service with a separate thread.
I really need an example of this. Where can I get a complete one?
That's google for you! They all talk about good practices and patterns we should follow, but never actually show how to implement them :(
The best explanation I have experienced is through the Udacity (free) courseware - see lessons 8 and 9 here: www.udacity.com/course/new-android-fundamentals--ud851 and code with various branches - tracking the course - is here: github.com/udacity/Sunshine-Version-2 You can also browse through the tons of student implementations of "Popular Movies" - the final project for the Nanodegree. The student projects are on github and most include a Content Provider to pull data from TheMovieDb.
code link doesnt work anymore
@twerdster Damn, once it is heard it cannot be unheard...
any updates on the Framework?
You can find Service Pattern implementation (solution A) by searching for RESTDroid on Github ;)
I'd like a piece of that cookie as well! =)
Android. Beauty defined.
thanks : )
Good!
Guys... It's true that there is no use for this " hyper-redundant nonsense to get a simple JSON result back and parse it".
But if you are actually writing a two-way rest app, using put, post, delete and caching, things become a lot more complicated. Unless you are willing to sacrifice performance.
Just saying.
@metafedora I so, so agree
Too bad Virgill explained so poorly the SyncAdapter pattern two years later still obscure to some developers on how to use it?
Somebody that have some good code examples for this?
I have posted an implementation of Option C using ContentProvider API and SyncAdapter. This tutorial provides all of the code samples used to build a working example of a RESTful android app. Feel free to visit the "About" page on my Google+ profile.
Why can you not zoom on the SCREEN, We dont need to see his face! I prefer to see the screen!!!!!
Using REST, how can a server send data to a client? Can an Android app accept REST calls?
you have to use push notifications
I hope there is something easier. In a web app using query, I can do simply: $.ajax(url, options, data, callback). I do not need to understand all this mumbo jumbo just to perform HTTP GET/POST. This is 2014 - I googled for an hour and I still do not think there is anything as simple for Android as Jquery for a Web application.
implemention in github : github.com/stanfy/enroscar
All of the patterns described are only suitable for very simple value objects. What about complex objects (deep maps, bigger binary data, 3rd party objects that can't be marshaled or are simply too big for intents)? Can someone explain why local services and content providers can't pass objects to activities? Personally I think that these are awful design choises. What a nonsense...
@twerdster hehe
they could have given him some water. this is rough to listen to
careful! don't poop in your pants!
@viliaus andro.lt/2012/03/app-vs-web.html
Is he about to throw up?
哈哈哈
wave? lol
haha... google wave.
ich werd' seekrank. stop moving!
This guy has the most annoying voice, I wish they would dub it over with someone like Ian McKellen as narrator.
And like most Google employees, you get that slight I'm-soooo-much-smarter-than-you attitude. Ugh.
Great topic but Oh man this guy is annoying...