Jul 5 | 7:25 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jul 5 | 8:10 PM |
Dragan S. | has entered the room |
Dragan S. |
Hi Mark!
|
Mark M. |
hello, Dragan!
|
Mark M. |
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
|
Mark M. |
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?
|
Jul 5 | 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
|
Mark M. |
ContentProvider is great for working between processes, such as FileProvider for serving files
|
Mark M. |
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
|
Mark M. |
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
|
Mark M. |
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
|
Jul 5 | 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
|
Jul 5 | 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.
|
Dragan S. |
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
|
Mark M. |
so my guess is that the v28 libraries will ship when Android 9.0 does
|
Mark M. |
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...
|
Dragan S. |
Ok... thank you for those points... more opinions then real questions, but helpful nevertheless...
|
Jul 5 | 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...
|
Dragan S. |
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...
|
Dragan S. |
Ah, typing at the same time :)
|
Mark M. |
I still have my roster of worldwide sites at https://commonsware.com/andglobe
|
Mark M. |
though I do need to review them again to confirm they are all still working
|
Dragan S. |
Thank you...
|
Dragan S. |
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
|
Mark M. |
and with that, it's time to end the chat for today
|
Mark M. |
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 |