1

Hi custom url scheme is not working for me. Here is my code

 <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".MainActivity" android:label="@string/app_name" android:launchMode="singleTask"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.LAUNCHER" /> <data android:scheme="http" android:host="jinilabs.test" /> </intent-filter> </activity> </application> 

when I type the url on the emulator browser - http://jinilabs.test It is giving me web page not available error. Is there anything wrong here? Plz let me know

2 Answers 2

3

Simply typing the URL into the bar won't do it. Your url needs to be a clickable link on a webpage because the browser method that checks if it's a custom url only fires when a link is clicked; it simply runs url's that are entered in the address bar(and ignores custom urls). Clicking this link should launch your app as it is now. If it still doesn't work, you may need additional code in your manifest file. Mine looked like this:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="appcall.thing" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="4" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".AppCallActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <data android:scheme="stoneware.app.switcher" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> </intent-filter> </activity> </application> </manifest> 

Of course, you will have to substitute some of the names in here for names relative to your app. I would also recommend starting your url scheme with something unique rather than http in case the http is confusing the browser. My url scheme, for example was stoneware.app.switcher:// Hopefully this can be of some use to you :)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot for the post, I suspected it after hour of looking for solution why it does not work from browser url.
0

Add this code to manifest file :

<uses-permission android:name="android.permission.INTERNET"></uses-permission> 

and then try.

3 Comments

hi Ravi, I have added that also. but even though it is not working
Hi Ravi, the above links didn't help me out. My internet is working fine and i am running on samsung nexus S.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.