How to exchange data on a group of applications on Android

Consider the following scenario. The company releases many applications. And they want some data to be available for all of these applications. Any of these applications can create or read this data, like a common database. Therefore, the company decided to create an android library that does this task. I searched for a few days and my analysis is given below.

  • SharedPreferences - not recommended and deprecated. This does not serve the purpose either. All other applications must know the name of the application package that created the data to create the PackageContext. This is impractical here, since any application can create / update / read data, and it is impossible to say who is who.

  • ContentProviders. This does not work for me. The reason is that ContentProviders must be present in every application. The device cannot have 2 content providers with the same name. In addition to this, ContentProviders are mainly intended for one application that creates data, while other applications subscribe to it using Content_Uri.

  • Network connection. We do not want to store data on any server.

  • External storage. This is the only option. Should I go for it?

And, interestingly, the data should also be protected, which is not supported anywhere in any of the storage options.

Note. For iOS, we use keychain to implement the same functionality

+4
3

, .

Android, .

cothas!

+2

. , - . , , . "" "" , , , : http://www.hwaci.com/sw/sqlite/see.html

0

Android

, - iOS ( ), , , , . , Android , . Android , .

, .

SharedPreferences

, SharedPreferences . , , MODE_WORLD_READABLE MODE_WORLD_WRITABLE , . , - Android 4.2 (2012). Android-, , ( " ", " " ). , OS- , , 5 .

Android . ( " " - , Android . SD-.) , -, , . - - :   Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)

. , , , Android, MODE_WORLD_ * - ​​ .

  • , .
  • , , , .
  • , .

, , ( ). , . , ..

IntentService. ( , IntentService , Worker, Service . IntentService Intent, Android).

, /, . Intents ( Intents) . . , .

BroadcastReceiver

BroadcastReceiver. , , , . , . Intents, IntentService - , BroadcastReceiver, ( - , .)

ContentProvider

, , , ContentProvider . , , . ContentProvider - ContentProvider, ContentProvider , .

, , "Android-y" usecase . , . , , - . , /, ContentProvider .

0
source

All Articles