I have one application "Master" installed on phone. Is it possible to access resource from other app "Slave" as instant app ?
I know that it's possible between 2 installed apps using :
Resources resources = getPackageManager().getResourcesForApplication(packageName);
String slaveAppName = resources.getString(resources.getIdentifier("app_name", "string", packageName));
Thx
L.E :
I also try to send data from the instant app to the installed application ( reverse from above ) using :
Intent intent = new Intent("com.test.MainActivity");
intent.putExtra("data","data string");
startActivity(intent);
on the installed app i have in AndroidManifest :
<intent-filter>
<action android:name="com.text.MainActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
All good when i try to send data as installed app... but once i build the instant app.....it crash with :
Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.text.MainActivity (has extras) }
L.E (2)
i also try just for testing to find out how many apps are installed on the phone with the instant app build using :
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> pkgAppsList =
this.getPackageManager().queryIntentActivities( mainIntent, 0);
Log.d("log","installed apps : "+pkgAppsList.size());
This was a test just to find out if the instant app build can "touch" the local phone settings. And it works