This file contains 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
win.add(createKraWebView({template: "templateexamaple.html",data:{name:"ole",role:"bass",presentation:"<p>Nice guy!</p>"}})); |
This file contains 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
### | |
------> HTTPClientWithCache <------ | |
This class is a wrapper around the standard Titanium.Network.HTTPClient(), but it adds a | |
few nice features: | |
* A cache backed by a SQLite database. All HTTPClientWithCache instances use the same database table, with | |
the primary cache key being a hash of the full URL (and any data parameters in a POST) | |
* The cache is automatically pruned before each query | |
* A retry mechanism, so that you can retry a particular query a number of times before failing. |
This file contains 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
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
Titanium.UI.setBackgroundColor('#000'); | |
Ti.Geolocation.purpose = "FUN"; | |
var win = Ti.UI.createWindow({ | |
exitOnClose: true, | |
backgroundColor:'#336699', | |
title: 'Main Window', | |
navBarHidden: false | |
}); |
This file contains 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
Titanium.UI.setBackgroundColor('#fff'); | |
var tibh = {}; //create app namespace | |
Ti.include('ui.js','network.js','db.js'); | |
tibh.tabGroup = tibh.ui.createApplicationTabGroup(); | |
tibh.tabGroup.open(); |
This file contains 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
/** | |
* We're going to create an infinite loading table view. Whenever you get close to the bottom, we'll load more rows. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Create our UI elements. | |
*/ | |
var table = Ti.UI.createTableView({ top: 0, right: 0, bottom: 0, left: 0 }); |
This file contains 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
Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
Titanium.Geolocation.distanceFilter = 0; | |
var win = Ti.UI.createWindow({backgroundColor: '#fff'}); | |
var label = Ti.UI.createLabel(); | |
win.add(label); | |
win.open(); | |
function reportPosition(e) { | |
if (!e.success || e.error) { |
This file contains 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
/** | |
* Define our parser class. It takes in some text, and then you can call "linkifyURLs", or one of the other methods, | |
* and then call "getHTML" to get the fully parsed text back as HTML! | |
* @param text that you want parsed | |
*/ | |
function Parser(text) { | |
var html = text; | |
var urlRegex = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi; |
This file contains 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
/** | |
* Creates a grid that you can click on. | |
* @param options | |
*/ | |
function createGrid(options) { | |
// default options | |
var defaultOptions = { | |
gridViewOptions: { | |
top: 0, |
This file contains 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' }); | |
var button = Ti.UI.createButton({ title: 'Share' }); | |
win.add(button); | |
win.open(); | |
button.addEventListener('click', function() { | |
var intent = Ti.Android.createIntent({ | |
action: Ti.Android.ACTION_SEND, | |
type: 'text/plain' | |
}); |
This file contains 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
/** | |
* This sample lets you record and share video with Appcelerator Titanium on Android. | |
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK | |
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html | |
*/ | |
/** | |
* First, create our UI. We'll have two buttons: record, and share. | |
*/ | |
var win = Titanium.UI.createWindow({ |
OlderNewer