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.
Related
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.
I want to open my app from browser, when user opens any link that my app handles. So I'm using deeplinking. Here's my code in manifest file.
<activity
android:name=".ColorCaptureActivity"
android:label="#string/title_activity_color_capture"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter android:label="DeepLink">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="http"
android:host="www.somelink.com"/>
</intent-filter>
</activity>
Everything fine, but when I click on the link, android shows intent chooser, where displayed all apps that can handle this intent. I understand it's the default behaviour, but is there a way to not show the chooser popup and open my app directly?
Try implementing App Links to set your application as the default handler for the links.
Refer: https://developer.android.com/training/app-links#app-links-vs-deep-links
I am kind of stuck here, I have created a gallery app but for some reasons I do not know how to make it be recognized by the system as a gallery app so that I can pick images from it from other apps e.g Whatsapp, I see other 3rd party appearing on the menu except mine.
Add this in your Manifest
<activity android:name="YourActivity">
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="image/*"/>
</intent-filter>
</activity>
And then handle the intent when your activity gets opened and get the URI of the image from the EXTRAS.
I have my android application manifest file and I made a new activity. I want this activity to be able to handle images just like the built in image viewer. So I can tap an image in the browser, and it will ask if i want to use my application, or the default activity to view the image. What action can I use in the following intent filter:
<intent-filter>
<action android:name="android.intent.action." />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
I assume it would be listed at http://developer.android.com/reference/android/content/Intent.html but I cannot figure out which one is for viewing images.
You are looking for android.intent.action.VIEW
Intent.html#ACTION_VIEW
I am wondering if its possible to have someone click on a link in a browser on android, and it will make a camera pop up so you can capture a image then send it via mms?
Yes, this can be done. Just have the link be something that one of the components in your manifest has an intent filter set for. So for instance, lets say you have an activity called MyActivity. Then the following would go in the manifest:
<activity name="MyActivity">
<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="http" android:host="special.url.from/your/webpage"/>
</intent-filter>
</activity>
My activity then directs them to take a picture and send it via MMS.