Hi everybody, Im trying to create my own url scheme so my android app can get called via an URL but for now I dont have a success.
Im trying to have this url to work : cedemo://com.cedemo.scan?X=toto
Here is part of my manifest file :
<activity android:name=".Gallery1" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.GALLERY" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="cedemo" android:host="com.cedemo.scan" />
</intent-filter>
</activity>
Does anyone can help telling me what is wrong ? Also, if someone find what is wrong, can someone tell me how I read the "X" variable from inside the android code from my app ?
thanks for helping !!
THANK YOU FOR THE FIRST ANSWER. I did the modification of the action and its worked fine. The thing is that I still cannot get the url variable value. Here is the code I tried.
final Intent intent = getIntent();
final String myScheme=intent.getScheme();
final Bundle myBundle=intent.getExtras();
final boolean inContestKey;
if(myBundle !=null)
inContestKey=myBundle.containsKey("inContest");
final Uri myURI=intent.getData();
final String value;
if(myURI!=null)
value = myURI.getQueryParameter("inContest");
But i receiving null from all the functions... what can i do ELSE ?
May be I should explain better the context of my software... 1. My software is started 2. My software launch then the browser 3. the user click a link in the browser and the browser go to the url scheme, back to the software with a variable "X" (for example) 4. the software should read the variable "X"
but in my case : myScheme,myBundle,myURI are set to null value... :(
any ideas ?