Office Hours — Today, July 5

Tuesday, July 3

Jul 5
7:25 PM
Mark M.
has entered the room
Mark M.
turned on guest access
8:10 PM
Dragan S.
has entered the room
Dragan S.
Hi Mark!
Mark M.
hello, Dragan!
how can I help you today?
Dragan S.
Just a short opinion pool, not really a question: Is Content Provider as a pattern dying out from Android SDK?
Mark M.
I would say that its role is changing
my guess is that you are referring to the practice of using a ContentProvider as a way to access a database in your app -- is my guess correct?
8:15 PM
Dragan S.
I'd like to implement Search in my Activity in my new app. But Content provider for SearchView seems quite old concept. You cannot really change how it works, and the benefit you get from it is really not worth it as opposed to using just custom solution to list suggestions.
Mark M.
SearchView is not limited to working with a ContentProvider
Dragan S.
Given that for Content Provider and cursor are gone from RecyclerView, especially from JetPack Paging...
Mark M.
correct
ContentProvider is great for working between processes, such as FileProvider for serving files
IMHO, ContentProvider was never a good choice for internal database access
Dragan S.
And given that Quick Search is soon to be replaced with JetPack Slices which not only give better UI choices then old Content Provider approach, but don't really require it...
Mark M.
well, slices are a ContentProvider "under the covers", but we do not work with slices the way we would with "classic" providers
and slices are an example of using ContentProvider for working between processes
Dragan S.
So it seems this concept is kind of remaining only for things they're not interested in currently changing... Like accessing Files on a USB drive, or accessing Contacts... But most other usages of Content Provider are gone...
Mark M.
direct use of ContentProvider is fading, but indirect use -- such as slices -- is growing
I would expect to see more and more stuff from Google, and others, that use a ContentProvider simply for IPC, with their own APIs that you code to, the way that slices are implemented
8:20 PM
Dragan S.
You don't really need Content Provider for SearchView... You can override it and track text changes and submit events and provide your own implementation of custom recycler view with more freedom on how the suggestion list will show up. In other words not just be limited by currently suggested Content Provider "column names" and system filled listview items, but you can show your own custom RecyclerView items and behavior...
Mark M.
correct -- that is basically how I show how to use SearchView in "The Busy Coder's Guide to Android Development", though I think I am using a ListView rather than RecyclerView
Dragan S.
Ok... thanks... I think I'll avoid them in current app... Maybe go with slices when they become ready... But as of now, Content Provider look like a really complex way to receive very little from the framework.
Mark M.
for purely internal use within an app, I agree
8:25 PM
Dragan S.
JetPack approach is welcomed in Android, but I think major benefit is refactoring namespace and hiding/deprecating very old Android practices... And with it probably Content Providers as well.
Just a quick second opinion question... Do you think androidx.* version of Architectural Components and Support Library will come out of beta with the new Android Studio 2.2 or with Android P release?
Mark M.
usually, the libraries are tied more closely to OS releases than IDE releases
so my guess is that the v28 libraries will ship when Android 9.0 does
presumably, the repackaged androidx versions of the libraries will ship at the same time
Dragan S.
Seems like we're agreeing on this one as well...
Ok... thank you for those points... more opinions then real questions, but helpful nevertheless...
8:30 PM
Mark M.
I am happy to be useful!
Dragan S.
Once there was a Google Developers group... but nowdays I'm a little lost of where to ask these type of questions...
Any pointers on this regard maybe?
Mark M.
yes, they are not the sort of questions that are good for Stack Overflow
Dragan S.
It's not for Stack Overflow...
Ah, typing at the same time :)
Mark M.
I still have my roster of worldwide sites at https://commonsware.com/andglobe
though I do need to review them again to confirm they are all still working
Dragan S.
Thank you...
Reddit seems fine for this type of discussions...
Mark M.
beyond that, if you have a Google Developer Group or Android meetup group in your area, ask around in a meeting
and with that, it's time to end the chat for today
the next chat is Saturday at 4pm US Eastern
Dragan S.
Yup... thanks again... bye!
Mark M.
have a pleasant day!
Dragan S.
has left the room
Mark M.
turned off guest access

Tuesday, July 3

 

Office Hours

People in this transcript

  • Dragan Stanojevic - Nevidljivi
  • Mark Murphy