Create a gist now

Instantly share code, notes, and snippets.

@kopitime /app.js forked from dawsontoth/app.js
Created Apr 23, 2011

What would you like to do?
Launch Custom Android Application from Android Browser with Titanium Mobile
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();
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!'}));
});
<?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