Comments (3)
I tried it, but it's not possible with the current API. I also tried it with reflection but due to some final fields it is not possible. You aren't able to use the TrayPreferences
API. Sorry for that, but Tray wasn't designed as a high level ContentProvider API. Also the versioning could lead to big problems.
But at least you're able to access the ContentProvider of the other app (if the provider is set to exported="true"
).
// read from other app
String module = "thatmodule";
String key = "thatkey";
final Cursor query = getContentResolver().query(Uri
.parse("content://my.other.app.authority.preferences/" + module + "/" + key), null,
null, null, null);
final String value = query.getString(query.getColumnIndexOrThrow("VALUE"));
// write to other app
final ContentValues values = new ContentValues();
values.put("VALUE", "myValue");
getContentResolver().insert(Uri.parse("content://my.other.app.authority.preferences/" + module + "/" + key), values);
all information can be found in the provider
package.
Also, have a look at https://github.com/owlr-com/SharedContentProviders which is exactly what you need
from tray.
I need this too :/
from tray.
Hey, I'd like to access the provider from an other app just like your example in your last comment, however, the provider's "exported" param is set to false deep within the library. Am I missing something ? Can I override this setting?
Thanks
from tray.
Related Issues (20)
- minSdkVersion HOT 1
- ConcurrentModificationException in ContentProviderStorage.java:93 HOT 3
- NullPointerException in ContentProviderStorage.java:104 HOT 1
- Report ContentProvider Not Found information to android bugs HOT 2
- How to upgrade data? HOT 2
- TrayRuntimeException in TrayContract
- RunTimeException: Unable to create application caused by TrayContract.getAuthority HOT 4
- How to migrate from default module to my own module HOT 1
- List all prefs in module HOT 1
- Question: minSdkVersion value HOT 1
- android-DirectBoot HOT 3
- Share data between apps. HOT 1
- How to share values between apps? HOT 2
- delet tray.db and how to recreate HOT 1
- Accessing Outside of Container App 2.0 HOT 1
- java.lang.NoClassDefFoundError: Failed resolution of: Lnet/grandcentrix/tray/R$string; HOT 1
- can not support multi app share data HOT 1
- 不知道怎么回事的bug HOT 1
- NullPointerException at unregisterOnTrayPreferenceChangeListener in Service HOT 4
- ANR that leads to app crashing, support needed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tray.