Replace Google Now gesture - android

If you want to start Google Now on Nexus devices, you swipe-up with a simple gesture from the navbar. I want go replace this feature with my own app. if you swipe the, app-picker comes and asks you which app do you want to start: my app or Google Now. How can I implement this?
I have found an example which runs without root.

Add the following <intent-filter> to the Activity you want launched from the gesture:
<intent-filter>
<action android:name="android.intent.action.ASSIST" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
You will now see an option for your app when you make the swipe now, and will have to select it as the default handler by selecting Always, as shown below.

It's just a matter of setting the correct intent filter:
<intent-filter>
<action android:name="android.intent.action.ASSIST"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

Related

Firebase dynamic link does not go smooth

I'm trying to use Firebase dynamic link option and succeeded to create a link that opens the app, but the opening process doesn't look smooth. It looks something like that -
Once I click on the link, it looks like the browser (Chrome) is opening (for a short time)
Then it returns to the screen from which I opened the link (in the case WhatsApp), and displays a white rectangle with a "loading" sign inside it, in the center of the screen.
Open the App.
This is not the case, say, if I try to access another application on my phone via a link (say Spotify or Facebook - in this case, I can see only a black screen until the app opens).
How can I get the same effect as in Spotify (a black screen)?
The part in the MANIFAST that relate to this activity -
<activity android:name=".Activities.WelcomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="thisapp.page.link"
android:scheme="https"/>
</intent-filter>
</activity>
What else can help?

I have set my flutter app for deep links in Android, but when I tap on external link, it open my app as in-app popup. Why?

What I want to achieve is that if user tap on the link e.g. on Whatsapp:
HTTP://dev.mycompany.com/qr/asd89f7as98df78
This link will open my app supplied with the deep link.
But the issue is this link actually open my app inside the Whatsapp. So when I open the app switcher, it looks like there are two instances of my app opened. How can I fix this?
I suspect this has something to do with the way I configure my intent filter on Android Manifest. But I'm inexperienced with intent-filter. This is the current configuration for my intent filter(s):
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="dev.mycompany.com" />
<data android:scheme="https" />
</intent-filter>
Is there anything I can do to fix the problem? The first intent filter is the default when I create the app. The second one is from copy pasting from solutions I find on stack overflow. But I don't think this is the fully correct solution. I don't want the app to can be opened as popup.

Is it possible to register two actions within one <intent-filter> for Activity

I wanted to register my launcher activity so it could be started by both clicking on icon and opening link with a custom scheme. I managed to make it work but am questioning is this correct way. This is the relevant part of my manifest:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="my.sheme" />
</intent-filter>
This does work but I was wondering should I register both actions under same intent filter. I tried just moving tags from second filter to the first one but then my activity doesn't show icon on install. Is it possible to do it this way and I just made some small syntax error(or broke some undocumented order of declaration rule) or is my thinking completely wrong on this and there are deeper reasons why this doesn't work?
NOTE:I do set android:exported="true"but android.intent.action.MAIN works even without it because it becomes exported anyway if you use action.MAIN
As the Android documentation states:
When you want to handle multiple kinds of intents, but only in specific combinations of action, data, and category type, then you need to create multiple intent filters.
Otherwise you can group them into one intent-filter.

adding custom action won't start the activity when running it in the emulator

I have the following code in my Manifest:
<activity android:name="com.fletech.android.apparent.CategoriesGrid"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
When I run the app in Eclipse it starts this activity in the emulator, as expected.
But when I also add:
<action android:name="com.fletech.android.apparent.action.APPARENT_MAIN" />
right below the other action, and run the app, it only installs it to the emulator but doesn't run it. Why?
What I wanted to achieve is this: I would like to be able to show a dialog to the user (from another apps) to chose between all my apps that have "com.fletech.android.apparent.action.APPARENT_MAIN" as an action.
If you want to specify another launch scenario, you should just add another whole intent-filter block rather than putting all of the action clauses in the same one.

Adding My App to The Gallery App menu

I am trying to set my application what will be a tool to edit pictures, to the menu in the gallery app of the android phone. I know it should go with the intent-filter but I can not get it to work.
<activity android:name=".Compass" android:label="#string/main_compass_tool_button">
<intent-filter android:label= "#string/main_compass_tool_button">
<action android:name="android.intent.action.SHARE"/>
<data android:mimeType="image/*"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The reason it is not working is because the action should be
android.intent.action.SEND
Not
android.intent.action.SHARE
I've mixed up the two also. SHARE is what you are supposed to show in the interface when sending a SEND intent - there is no SHARE intent.

Categories

Resources