-
-
Save vindriaoc/938493 to your computer and use it in GitHub Desktop.
Launch Custom Android Application from Android Browser with Titanium Mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
win.add(Ti.UI.createLabel({ text: 'Type appcelerator.com in a browser, and this app will get launched. Try it!' })); | |
win.open(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var activity = Ti.Android.currentActivity; | |
var win = Ti.UI.currentWindow; | |
activity.addEventListener("create", function(e) { | |
win.add(Ti.UI.createButton({title: 'Our app was launched when you typed appcelerator.com!'})); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ti:app xmlns:ti="http://ti.appcelerator.org"> | |
... | |
<android xmlns:android="http://schemas.android.com/apk/res/android"> | |
<activities> | |
<activity url="launchFromURL.js"> | |
<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="www.appcelerator.com"/> | |
</intent-filter> | |
</activity> | |
</activities> | |
</android> | |
... | |
</ti:app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment