A quick Android app wrapper
or: How I made Google Assistant work with the Bixby Button
Published in
1 min readMar 7, 2019
Honestly, I’m not fully sure why you would want to do it but I guess it has it’s uses because here I am writing this. Anyhow, if you need to write an Android application who’s sole use is to launch another application, here is how you can go about it:
- Create a project in Android Studio and use the Empty Activity template to add an activity. Make sure this activity is the launcher activity.
- In your
AndroidManifest.xml
file, find your<activity ../>
definition and add the following theme attribute:android:theme="@android:style/Theme.NoDisplay"
. This will prevent the Activity from popping into view when the application starts. - Lastly, add some code into your
onCreate
function to start the other app and then just quit. To launch Google Assistant you can use (in Kotlin):
startActivity(Intent(Intent.ACTION_VOICE_COMMAND).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK or FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS))
System.exit(0)
And that’s it.
If you’re using Nova you can hide the app so you don’t have to look at it.