Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
FredTA's avatar
FredTA
Protege
7 months ago

Where to find footage of in-app PackageInstaller

Hi, I'm making a game where the "hub" area downloads and installs separate SDKs, basically as community-created levels. I understand there's two ways to install APKs 

The intent way 

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(intent);

The package installer way

PackageInstaller.SessionParams params = new PackageInstaller.SessionParams(
        PackageInstaller.SessionParams.MODE_FULL_INSTALL);
int sessionId = packageInstaller.createSession(params);
PackageInstaller.Session session = packageInstaller.openSession(sessionId);

// write your APK bytes to session.openWrite(...)

Intent intent = new Intent(context, YourBroadcastReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
session.commit(pendingIntent.getIntentSender());

Now I currently have things working with the intent method, though the "do you want to install this package" system dialogue that pops up is a big pain point, as it leaves naive users confused (especially with how to close it). I hear the package installer method still does show a prompt, but that it apparently "more tied to the app" ad "more integrated with the session"... though I'm not sure what that means. 

Does anyone know where I can find footage of the application running inside a Quest3, installing and showing the dialogue via the package installer? I'd really like to see how it looks before dedicating dev time to reworking it all 

Cheers!

Fred

 

 

No RepliesBe the first to reply