Giter Club home page Giter Club logo

Comments (3)

passsy avatar passsy commented on May 30, 2024

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.

simc avatar simc commented on May 30, 2024

I need this too :/

from tray.

dpattou avatar dpattou commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.