android - Can you access the raws of an inactive app? -


my plan have main app uses raw files different app. main app handle data, , other app acts sort of dlc. when other app run, open main app own sharedpreferences, , set main app can read raws other app.

is reading of raws (not implementation of sharedpreferences) possible if other app somehow forced closed?

yeah, believe should able through packagemanager , resources apis. i've done strings , drawables, don't know of particular reason wouldn't work raw resources.

try {     resources res = getpackagemanager().getresourcesforapplication("other.package.name");     int resourceid = res.getidentifier("name_of_raw_resource", "raw", "other.package.name");     if (resourceid != 0) {         inputstream rawfile = res.openrawresource(resourceid);     } else {         // raw resource not found     } } catch (packagemanager.namenotfoundexception e) {     // app not installed } 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -