Shared db uses Shared Preferences in
WORLD_READABLE mode which can make another applications read the data. For example if you store a value in Application1. It can be accessed ( Read only ) by Application which is not possible in normal Preferences.
This extension is discontinued and won’t be getting any updates in the future.
Do Not use to Store Confidential/Important data in this DB. Other applications can also read the data. ( If you are storing information like this, Please Encrypt your data before Storing and Decrypt it once after Retrieving )
Do not use the same the namespace if you are using TinyDB which will interfere with this SharedDB.
This event fires when getting data from other Applications only. Fires if any problem occurs with packagename not found or namespace not found.
You can change the Namespace as your need. (Ignore the warning)
This property will be used when getting/storing information with the current app
You can use this to store value in the Shared Preference Database. Namespace property will be used as namespace.
You can use this to get value within the current application in the Shared Preference Database. Namespace property will be used as namespace.
You can use this block to get value from other applications by the parameters.
This block won’t use the namespace property. Fires ErrorOccured if any error occurs.
FAQ ( Read before posting questions ):
1.Is this SharedDB an online database?
No, It works using the SharedPreferences class like the TinyDB does. Your data is stored on the device and will be cleared once uninstalled or if they clear the application data.
2.What’s the difference between TinyDB and this extension?
This extension uses a different permission mode to store data. It stores using the
WORLD_READABLE where TinyDB uses
MODE_PRIVATE where the data can be stored/retrieved/modified only by the applicaton. But, in SharedDB, any application ( knowing it’s namespace and tag names ) can read the values.
3.What about the data security?
Yes, other applications can still read the data if they know your namespace and tag ( Only using SharedPreferences ) names. The user cannot access them without root. This happens even with TinyDB too. Root users can do anything in both DB’s which uses the same class. So, It is recommended to Encrypt your data on both DB’s (TinyDB and SharedDB)
You can take a look at the code to see how I made this extension or contribute to this in the future.
Aix: com.jaxparrow.shareddb.aix (5.8 KB)
Apk - This doesn’t need any example or hardwork to get it working. This apps are here to test it and showing how it works.
SharedStore : SharedStore.apk (5.4 MB)
SharedGet : SharedGet.apk (6.2 MB)
Developed using Rush. Thanks to @Shreyash for making extension development even easier.
And this is gonna be SO useful for people, literally. Amazing job !
Thanks for your supportive words
Excellent This will worth 100% nice job @Jaxparrow keep oding
Great contribution. I think. I didn’t understand properly how it works. Can you give me an example what type data should we store in this method
It works same like TinyDB. You can store anything. String, int, boolean, list, dictionary.
I think I am the one who caused this doubt. I named Data instead of Value. Changed them now. Thanks for noticing.
You mean user can access shared prefs of other apps using this extension?
No. With this, we can create WORLD_READABLE Shared preferences which’ data can be retrieved by other applications. By using this, you can Store/Retrieve value (data) between multiple apps.
My only question is how does this work if
MODE_WORLD_READABLE was deprecated in API 17?
I tested in Api 23. Deprecated means that it is still available. But, not recommended. Now, you can create a user group and define them in the Manifest. For example, declaring the package names in the both application and making them as a group will make the data readable by only these two applications. But, that’s not possible in kodular and even if it’s possible. We should create an extension for each and every project that we’re creating.
I didn’t even know how badly I needed this extension. Thank you very much @Jaxparrow I just wanted to connect my applications on users phone. I’ve been thinking of other ideas but now it’s easy.
I’ll respond more about this extension after I use it.
Nice extension man…
So it will work just like firebase, gsheet… but the matter is we can visit them but in this db we can visit but can get the data.
This is not like Firebase or database. This just works like TinyDB. But, the extra thing you get when using this is you can get the value (data) on other applications too…
If you store a variable called
Jack assigned to
name in application1.
You can get the name value by the
tag even in Appllication2.
This SharedDB works across applications. So, you can easily store preferences in 1 app and get them in the other one.
I got it, here the package name is, In which app you wanna get it that one… very nice. It means data can be shared between yours app only and there is no way for others to steal our informations. Super work man…
And here your misunderstood. Other apps can get if they know which namespace and tags that we are using.
There is one solution for that. We can Encrypt our data on storing and Decrypt on the other app.
It works just like TinyDB. It works on local storage. But, with WORLD_READABLE permission which lets other applications to read the DB.
can we use it in two different mobiles?
i mean store data from one mobile and get the same data from another mobile…