How can i register my app as a downloader as shown in the screenshot below. I have tried adding below code in my manifest but didn't work.
<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" />
<data android:scheme="https" />
</intent-filter>
here is my activity in manifest:
<activity
android:name=".modules.downloader.home.HomeActivity"
android:theme="#style/AppTheme.NoActionBar">
<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.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
You need to provide MIME type as well. If you support all types of files, then you can give <data android:mimeType="*/*" />
<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:mimeType="*/*" android:scheme="http" />
<data android:mimeType="*/*" android:scheme="https" />
</intent-filter>
Related
I am using the following code in manifest but it is not working.
<activity
android:name=".Videoplay"
android:configChanges="orientation|keyboardHidden|screenLayout|screenSize"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.APP_MUSIC" />
<!-- <data android:mimeType="*/*"></data> -->
<data android:mimeType="audio/mpeg" />
<data android:mimeType="video/mpeg" />
<data android:pathPattern=".*\.mp3" />
<data android:pathPattern=".*\.ogg" />
<data android:pathPattern=".*\.wav" />
<data android:pathPattern=".*\.wma" />
<data android:pathPattern=".*\.flac"/>
<data android:pathPattern=".*\.mp4"/>
<data android:pathPattern=".*\.mkv" />
</intent-filter>
</activity>
Help me, what's going wrong because my app is not showing in the video intent.
Use the below 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="rtsp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
<data android:mimeType="application/sdp" />
</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="http" />
<data android:mimeType="video/*" />
</intent-filter>
activity
android:name=".activity.rechargetab.RechargeActivity">
<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="mobileleb"
android:host="recharge/checkout/status" />
</intent-filter>
</activity>
When I try mobileleb://recharge/checkout/status from the browser it searches google.Its not working. It does not start RechargeActivity.
add android:autoVerify="true" to intent-filter and specify scheme="http" or "https" or both
<activity
android:name=".activity.rechargetab.RechargeActivity">
<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="mobileleb" />
<data android:pathPattern ="/recharge/checkout/status" />
</intent-filter>
</activity>
I am trying to use intent filters to do this. I tried this Intent filter for files only but it didn't work. I want to make my app appear in the share menu for all types of files.
Here my intent filter
<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.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:host="*" />
</intent-filter>
Try this. It's working in my project
<intent-filter>
<!---->
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
Custom deeplinking scheme doesn't work in case other data tag is added to 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="#string/deep_link_scheme" />
<data android:scheme="http" android:host="myhost" />
<data android:scheme="https" android:host="myhost" />
</intent-filter>
Moving custom theme data tag to separate intent-filter fixes the problem, but what the real problem with the first solution?
<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="myhost" />
<data android:scheme="https" android:host="myhost" />
</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="#string/deep_link_scheme" />
</intent-filter>
I am developing a Media Player application.I want my application to list out in a chooser dialog opens when user select any media file.How can I make my application to list out in a chooser dialog like image below :
I have googled a lot but not found any related articles.Thanks in advance.
Use intent-filter in your AndroidManifest.xml
Example.
<!-- Main activity -->
<activity
android:name=".ui.activities.HomeActivity"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MUSIC_PLAYER" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.APP_MUSIC" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Now playing -->
<activity
android:name=".ui.activities.AudioPlayerActivity"
android:clearTaskOnLaunch="true"
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/itunes" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/itunes" />
</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="http" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/ogg" />
<data android:mimeType="application/x-ogg" />
<data android:mimeType="application/itunes" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.dir/playlist" />
<data android:mimeType="vnd.android.cursor.dir/albums" />
<data android:mimeType="vnd.android.cursor.dir/artists" />
</intent-filter>
<intent-filter>
<action android:name="com.andrew.apollo.AUDIO_PLAYER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="vnd.android.cursor.dir/audio"/>
</intent-filter>
</activity>