I have an application which has a file browser and a created image viewer. In these activities we can share.
I added the option to receive simple data (shares) from other applications by adding the the manifest
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/jpeg" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/jpeg" />
</intent-filter>
The issue is, I receive shares from elsewhere no problem. I share within the application, I can select, my application. I would like it to not be sharable to my application from my application. I see apps such as the samsung gallery does not suffer this annoying problem (which means there is a fix and I cannot ignore it)
The Samsung gallery app actually does not show up in its own share menu because you cannot share files via that app, but only view them.
If you are severly annoyed by your app appearing in the system-built chooser dialog, you could always build your own. Simply get all the apps that you could use for sending via PackageManager.queryIntentActivities(android.content.Intent, int), then display them in a custom dialog.
Related
I am trying to implement an AppLink (deeplink) such that when the app-link is triggered it does not bring up the popup asking for my App or Chrome, I want it to just launch my app so I can direct them to the proper place in the app.
I have read various android articles and posts and cannot get the AppLink to work the way I want.
Here is my manifest xml:
<activity android:name=".MainActivity">
<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="www.example.com" />
</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="https"
android:host="www.example.com" />
</intent-filter>
</activity>
I read in the android doc here the following:
A deep link is an intent filter that allows users to directly enter a
specific activity in your Android app. Clicking one of these links
might open a disambiguation dialog, which allows the user to select
one of multiple apps (including yours) that can handle the given URL.
For example, figure 1 shows the disambiguation dialog after the user
clicks a map link, asking whether to open the link in Maps or Chrome.
Android App Links are a special type of deep link that allows your
website URLs to immediately open the corresponding content in your
Android app (without requiring the user to select the app).
I added auto verify to the intent and have the assetlinks.json file but still prompts to choose my app or chrome. I DO NOT want the prompt for chrome... only my app.
So, what am I missing?
Has anyone here got an app link to work that DOES NOT pop up the option for Chrome?
Can anyone point me to a sample app or code or an article that actually works?
Thanks for any assistance with this.
I want to write a NFC tag that opens a specific note in Google Keep when touched.
I have an URL in the form of https://keep.google.com/u/0/#LIST/<id> that does the desired action of opening the note in the installed Google Keep app on my phone when I read it with a QR-reader or click on it as a link.
When I write this URL to the tag an touch the tag afterwards, it opens in the browser. Is the NFC handler skipping other apps and opening it directly in a browser? When I clear the app-defaults for the browser, it shows a selection menu for the installed browsers after tapping the tag. Does anyone have an idea what I am doing wrong?
Links on NFC tags are not launched as intents with the typical VIEW action. Consequently, other apps may not pick those links up correctly and you will instead experience the web browser to be opened. Only apps that specifically register for the intent action NDEF_DISCOVERED will be able to receive links from NFC tags. It seems that Google Keep currently does not do this, so there's not much you can do without creating your own wrapper app that handles these URLs and passes them on to Google Keep.
You should enable deeplinks in your activity. Also you should indicate your activity NFC tag discoverable as follows. You can learn anything about deep linking via this link
<activity
android:name="ExampleActivity"
android:label="Example">
<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:host="example.com"
android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
I am working on an application where i have to create a link of my application and copy that link to text buffer and paste that link in my device in any text editor. Now when i tap on that link my application should open and show appropriate data. I don't know how to implement this i searched on internet I did not find any solution which can explain this feature implementation. give me the best way to implement this.
I have tried this but can not understand
Launch your application when a link taped
You have to use other app to start it. You should register intent-filter with other action and category in your app. The most common action should be ACTION_VIEW combine with category BROWSABLE, then you can use a url in brower or sms to open you app. The intent-filter should be like:
<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="openmyapp"
android:scheme="http" />
</intent-filter>
I've seen this question asked 100+ times but none of the answers are working for me. I want my app to handle all files with ics or vcs extensions, *no matter where they come from. *Except, I don't want to have to download them myself if they come from http/https, I just want the browser to at least let the user save them and then open with my app. Currently the browser says "content not supported on this phone".
Here is what I currently have, but I've been trying everything:
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="*" />
<date android:mimeType="text/calendar" />
<data android:scheme="https" />
</intent-filter>
With the above, when I click an https link, one that comes from my server and I know my server is sending the text/calendar mime-type, the droid asks what app they want to use to open the link. The list has my app or the browser. If I select my app, it runs my activity and gives me the Uri. I want the browser to download the file though, I don't want to have to download it myself... same way other file types work, images, pdfs, etc. If I select the browser, it starts the download but then stops with a "content not supported on this phone" error.
I also tried this:
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="*" />
<data android:scheme="file" />
<data android:pathPattern=".*\\.ics" />
</intent-filter>
Also tried with the scheme set to "content", and lots of other variations I found on SO and other places.
You should consider that the browsers are implementing this download behavior for binary files and you can not change it by a intent-filter.
Other applications like pdf viewer declare an intent-filter identical to your second approach (except for the file-extension).
Therefore I would recommend to just download the file yourself. As it just requires a few lines of code this should not be a big problem.
I have an android containing an activity that can receive pictures sent to it by the android share menu. The activity has this configuration in the manifest file:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<data android:mimeType="image/*" />
</intent-filter>
I am using the mimeType filter to allow only images to be sent to the activity.
Apparently, this is not working on all devices. I have tested it on the Nexus S and Galaxy S/S2 and it worked great, but I've got complaints from some users (especially xperia) saying the app it not showing in the Share menu when it's opened on a photo from the gallery.
The app is using SDK 2.1 sdk 7.
There is no rule that says that an activity have a "share" menu that supports any particular Intent filter.
That being said, I would add:
<category android:name="android.intent.category.DEFAULT" />
to your filter.