I am working with this project https://github.com/hypeapps/black-mirror . As I am a complete newbie to droid I am wondering what the process would be to call a apk that has been added to the androidthings image from androidthings console. Say I have an APK com.lafitness.lafitness.apk that has been added to the android things image. How would I open that APK from an android speech recognized phrase. Would I do this using Package manager from an intent?
Asked
Active
Viewed 51 times
1 Answers
0
If you have added the APK to your system image, you can then call the app from an intent using the app's package name.
PackageManager manager = getPackageManager();
Intent intent = manager.getLaunchIntentForPackage("com.lafitness.lafitness.apk");
intent.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(intent);
Using the Android speech API is a different question, but should be the same as on an Android phone (but I'm not certain of that).

Nick Felker
- 11,536
- 1
- 21
- 35
-
Thank you for the response I will test it later. In the meantime would I close this by calling intent.finish()? – pleslie Mar 25 '19 at 18:18
-
I don't think you can close it that way, but you may be able to call an activity on top. – Nick Felker Mar 25 '19 at 19:41