sirjo66 Well-Known Member Licensed User Longtime User Oct 16, 2016 #1 Hello I have developed a program where the customer can view some videos, and with this source it works very well: Code: Dim ii As Intent ii.Initialize(ii.ACTION_VIEW, "http://www.sample-videos.com/video/mp4/240/big_buck_bunny_240p_2mb.mp4") ii.SetType("video/*") StartActivity(ii) When the program run, it ask to the customer wich player he wants to use and it works !! Now I want to develop my player and I need to know: 1) how can I tell to the OS that my program is for "video/*" ?? (so it appeare on list of players) 2) how can read receive parameters (file name of the video) when it is called ??? Many thanks Sergio Edit: I try to insert this in "manifest editor" but my player don't appeare on the list Code: AddActivityText(Main, <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="video/*" /> </intent-filter>) Last edited: Oct 16, 2016
Hello I have developed a program where the customer can view some videos, and with this source it works very well: Code: Dim ii As Intent ii.Initialize(ii.ACTION_VIEW, "http://www.sample-videos.com/video/mp4/240/big_buck_bunny_240p_2mb.mp4") ii.SetType("video/*") StartActivity(ii) When the program run, it ask to the customer wich player he wants to use and it works !! Now I want to develop my player and I need to know: 1) how can I tell to the OS that my program is for "video/*" ?? (so it appeare on list of players) 2) how can read receive parameters (file name of the video) when it is called ??? Many thanks Sergio Edit: I try to insert this in "manifest editor" but my player don't appeare on the list Code: AddActivityText(Main, <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="video/*" /> </intent-filter>)
sirjo66 Well-Known Member Licensed User Longtime User Oct 16, 2016 #2 and the result manifest file is: Code: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="sjs.VideoPlayer" android:versionCode="1" android:versionName="" android:installLocation="internalOnly"> <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/> <application android:icon="@drawable/icon" android:label="SJS Video Player" android:theme="@android:style/Theme.Holo"> <activity android:windowSoftInputMode="stateHidden" android:launchMode="singleTop" android:name=".main" android:label="SJS Video Player" android:screenOrientation="unspecified"> <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" /> <data android:mimeType="video/*" /> </intent-filter> </activity> </application> </manifest> Upvote 0
and the result manifest file is: Code: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="sjs.VideoPlayer" android:versionCode="1" android:versionName="" android:installLocation="internalOnly"> <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/> <application android:icon="@drawable/icon" android:label="SJS Video Player" android:theme="@android:style/Theme.Holo"> <activity android:windowSoftInputMode="stateHidden" android:launchMode="singleTop" android:name=".main" android:label="SJS Video Player" android:screenOrientation="unspecified"> <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" /> <data android:mimeType="video/*" /> </intent-filter> </activity> </application> </manifest>
Erel B4X founder Staff member Licensed User Longtime User Oct 17, 2016 #3 See this answer: http://stackoverflow.com/a/7371592/971547 You should use Activity.GetStartingIntent to get more information from the intent: https://www.b4x.com/android/forum/pages/results/?query=Activity.GetStartingIntent Upvote 0
See this answer: http://stackoverflow.com/a/7371592/971547 You should use Activity.GetStartingIntent to get more information from the intent: https://www.b4x.com/android/forum/pages/results/?query=Activity.GetStartingIntent