Android Question Ok Google with intent...

MrKim

Well-Known Member
Licensed User
Longtime User
So "OK Google Open MyApp" works just fine but I want it to do something.
I added

B4X:
AddReceiverText(SWAddNote,
<intent-filter>
    <action android:name="com.google.android.gms.actions.CREATE_NOTE" />
</intent-filter>)

via the manifest editor but it still doesn't do anything
IF I say
"New Note" I am asked which app, and Gmail and Keep are displayed
"New Note with with Keep" will start a new note with Keep - same with Gmail
but "New Note with MyApp" and I am asked which app again, Gmail or Keep

I tried adding this to my manifest text taken from HERE

B4X:
  <intent-filter>
        <actionandroid:name="com.google.android.gms.actions.CREATE_NOTE"/>
        <categoryandroid:name="android.intent.category.DEFAULT"/>
        <dataandroid:mimeType=”*/*”>
    </intent-filter>

but I get:
B4X:
Generating R file.    Error
AndroidManifest.xml:18: error: Error parsing XML: not well-formed (invalid token)
When I compile.

Just adding this compiles:
B4X:
    <intent-filter>
        <action android:name="com.google.android.gms.actions.CREATE_NOTE" />
    </intent-filter>

But still doesn't open my app it asks Google or Keep.

Thanks in advance for any help.
 

MrKim

Well-Known Member
Licensed User
Longtime User
Well, I added so many things I am not sure now which one did the trick, but this works, here is the entire manifest:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
   
    <intent-filter>
        <action android:name="com.google.android.gms.actions.CREATE_NOTE" />
    </intent-filter>
)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
AddReceiverText(SWAddNote,
<intent-filter>
    <action android:name="com.google.android.gms.actions.CREATE_NOTE" />
</intent-filter>)
AddActivityText(main,  <intent-filter>
  <action android:name="com.google.android.gms.actions.CREATE_NOTE" />
  <category android:name="android.intent.category.DEFAULT" />
  <data android:mimeType="*/*" />
  </intent-filter>
)
 
Upvote 0
Top