Content Provider with Real Time Platform [PubNub]

I am working on a personal project that uses the PubNub realtime framework.

My current understanding of Android Content Provider is that it is used to centralize app content in one place.

Hence, when using a service such as PubNub. Could the content provider be helpful in a way I might have missed?

I want my app to update the content of individual / all rows (using Content Resolver) from the ListViews dynamically and update it in real time on all connected devices. A quick google search tells me that I can update the content of a single row without the Content Provider, but would it have any additional use? Especially when combined with real-time frames?

Any help or thought would be appreciated,

Thank!

+3


source to share


2 answers


Update: As a developer, I decided to use Content Provider in my application along with PubNub in real time. I don't regret my decision at all.

The content provider allows my application to maintain a sorted table of the desired values, which I then use to publish to PubNub in real time.



The content provider also allows me to execute functions on the table with a cursor, which I found to be very useful.

+1


source


Personal project with a paid service ??? Think Crytical push messages are built into Google Play services.

Think Crytical. Who has data on the server, how do you protect it. Encrypt the data on your server first, or risk exposing it, then you need your application to call your server to get the data. It just doesn't work with the ISP. which becomes a disaster point, this is not a very good decision. who knows that all of your clients are not good solutions.



The best part is the customizable content provider, so you can do whatever you want when updates come out. For example, perhaps you delete a thumbnail when a delete comes in.

    File imgFile = new File(getContext().getExternalFilesDir(
            Environment.DIRECTORY_PICTURES), thumbnailname);
    if (imgFile.exists()) {
        imgFile.delete();
    }

      

0


source







All Articles