0

I have created simple app to integrate the Google Assistant which is named as TestAppDemo. I have added simple screen where I have one edittext where I am entering the random things like groceries or anything we can add as per our convenience. I want to say to google *"Hey Google, Open groceries from TestAppDemo" *

I have created Simple MainActivity which uses the ShortcutHelper class

shortcutHelper = ShortcutHelper(this)
 binding.btnCreateShortcut.setOnClickListener {
 val itemName = binding.inputItem.text.toString().trim()
 if (itemName.isNotEmpty()) {
 shortcutHelper.pushDynamicShortcut(itemName)
 Toast.makeText(this, "Shortcut created for \"$itemName\"", Toast.LENGTH_SHORT).show()
 binding.inputItem.text.clear()
 } else {
 Toast.makeText(this, "Please enter an item name", Toast.LENGTH_SHORT).show()
 }
 }
 // If started via shortcut, display incoming "item" parameter
 intent.getStringExtra("item")?.let { item ->
 Toast.makeText(this, "Opened via shortcut for item: \"$item\"", Toast.LENGTH_LONG).show()
 }

In My ShortcutHelper

fun pushDynamicShortcut(itemName: String) {
 val shortcutId = "shortcut_$itemName"
 val intent = Intent(context, MainActivity::class.java).apply {
 action = Intent.ACTION_VIEW
 putExtra("item", itemName)
 }
 val shortcut = ShortcutInfoCompat.Builder(context, shortcutId)
 .setShortLabel(itemName)
 .setLongLabel("Open \"$itemName\" from TestAppDemo")
 .addCapabilityBinding(
 "actions.intent.GET_THING",
 "thing.name",
 listOf(itemName)
 )
 .setIntent(intent)
 .build()
 ShortcutManagerCompat.pushDynamicShortcut(context, shortcut)
 }

Also created Shortcut to use capabilities

 <capability android:name="actions.intent.GET_THING">
 <intent
 android:action="android.intent.action.VIEW"
 android:targetPackage="com.example.testappdemo"
 android:targetClass="com.example.testappdemo.MainActivity">
 <parameter android:name="thing.name"
 android:key="item" />
 </intent>
 </capability>

In Manifest file

<meta-data
 android:name="android.app.shortcuts"
 android:resource="@xml/shortcuts" />
 <activity
 android:name=".MainActivity"
 android:exported="true">
 <intent-filter>
 <action android:name="android.intent.action.MAIN" />
 <category android:name="android.intent.category.LAUNCHER" />
 </intent-filter>
 </activity>

To achieve this I have used BII (Build In Intent) which is * "actions.intent.GET_THING"* to develop a demo, but that was also not producing the desired results. For example, we could just say "Hey Google, Open groceries from TestAppDemo" to open the task, but it's not opening that screen in the app or I can say it's not giving the output

So my question is, is it possible to directly interact with my app and have it do a very simple task?

Expectation: When I say to google assistant "Hey Google, Open groceries from TestAppDemo" it should navigate to particular groceries screen

Actual :When I say to google assistant "Hey Google, Open groceries from TestAppDemo" it is not navigating to the groceries screen

6
  • Hi, how are you guys testing the app actions? They removed app actions plugin plugins.jetbrains.com/plugin/16739-google-assistant Commented Sep 12, 2025 at 8:29
  • 1
    @Adarsh Dhakad yes, app action plugin has been removed. We are testing in real device Commented Sep 12, 2025 at 10:01
  • @BhumikaMehta, Thank you , I tried the sample app from Google github.com/actions-on-google/appactions-fitness-kotlin but it's not working do we have to publish the app to Google Play Store , or can it work to any new app Commented Sep 12, 2025 at 10:51
  • 1
    @AdarshDhakad, I also read the same but I tried in application which is available on play store and still it's not working. Static Shortcut is working Commented Sep 12, 2025 at 15:06
  • Hi @BhumikaMehta what do you mean by static? Is this codlab working for you codelabs.developers.google.com/codelabs/appactions/#2 For me, nothing is working. First, we have to send our app actions to Google Assistant, right? How are you doing this? How are you sending a preview to Google Assistant for review Commented Sep 16, 2025 at 3:35

1 Answer 1

0

Google removed App Actions. BIIs like actions.intent.GET_THING do not work now.

What you can still do:

"Hey Google, open TestAppDemo" -> open app main screen.
If you want "groceries" screen -> need deep link or shortcut. Example: testappdemo://groceries.

But Google Assistant does not pass words like "groceries" to your app anymore. It only opens app or deep links.

So answer: No, you cannot do "Hey Google, open groceries from TestAppDemo" directly. Only deep link + shortcut workaround

answered Sep 12, 2025 at 3:46
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.