Preferences
are used and organised within the application context. This means that preferences of one application don't belong to other applications. There are some options that I suggest.
First Option
If one application defines a preference with MODE_WORLD_WRITEABLE
mode, other application will be able to reach that preference if and only if package name is known. if preference is not defined with MODE_WORLD_WRITEABLE
mode, preference will not be read by other application. MODE_WORLD_WRITEABLE
is one the of modes in Preferences
while defining new preference in Android. There is a previous thread that answers how to read other application's preferences. However, MODE_WORLD_WRITEABLE
mode is deprecated in API level 17. If the target of your application is API Level 17 and over, you should not insist on Preferences
.
Second Option
On the other hand, two applications can share the same Database on mobile device. You can simply create a table containing preferences that is shared and read by both two applications. Here is another link for this option that describes how to handle such operation.
Third Option
Other way, you can take the advantage of object Serialization in Java
. I mean that, you can write a class that made up of configurations or preferences defined by your application. That class should implement Serializable
interface. When it's required, that class can be written on a file or on a certain location that can be reachable by other applications. However, this option will not be secure because of consistency. File can be corrupted, removed and etc.
Fourth Option
As @BenSmith mentioned, you can store the preferences on a remote location that can be accessible by both two applications.