I know that it is possible to share SharedPreferences (using the following) when the two apps have the same sharedUserId:
Context secondApp = createPackageContext("com.example.secondapp", 0); SharedPreferences secondAppPreferences = secondApp.getSharedPreferences("name_of_shared_preferences_file", 0);
but is it at all possible to share strings from the "strings.xml" file so that i can get a string-array from the second app's stings.xml??
Yo he tratado:
but it throws an error (array cannot be resolved or is not a field) on "array" in "R.array.name_of_arr"
preguntado el 27 de agosto de 11 a las 14:08
It is possible to share "data" (files, preferences, exposed data) between Android applications, but not built in Resources (i.e. the stuff mapped through
R). These Resources are all private per application.
This is impossible to share strings or any other data between two different applications.