Android Question read parameters on an intent call

sirjo66

Well-Known Member
Licensed User
Longtime User
Hello ;)

I have developed a program where the customer can view some videos, and with this source it works very well:
B4X:
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 :(
B4X:
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:

sirjo66

Well-Known Member
Licensed User
Longtime User
and the result manifest file is:
B4X:
<?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
Top