Launch app on defined URL
To make your app launch on a specific URL you simply create an 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" android:host="xebralabs.blogspot.com" android:path="/travalert"/> </intent-filter>
This way you can have your application launched from a QR-code containing the specific URL. Nice thing is that if the app isn't installed the user will most likely have the url opened in a browser instead.
Hi, could you clarify what should be the url which will be used to launch that app, because I've tried few urls but always a browser has been opened
ReplyDeleteI managed to get it :). If someone complete example, let's take a look here: http://stackoverflow.com/questions/7416864/about-starting-android-app-from-an-url.
ReplyDeletein the comments below there is example project.
Glad to hear you solved it. Maybe I was a bit vague on the details ;)
ReplyDeleteString contents = intent.getStringExtra("SCAN_RESULT");
ReplyDeleteString format = intent.getStringExtra("SCAN_RESULT_FORMAT");
// Handle successful scan
} else if (resultCode == RESULT_CANCELED) {
// Handle cancel
}
}jkioiuiozui