How to call an added APK to androidthings image

53 views Asked by At

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?

1

There are 1 answers

2
Nick Felker On BEST ANSWER

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).