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.Media.showCamera({ | |
success:function(image,details) | |
{ | |
Titanium.Media.saveToPhotoGallery(image); | |
}, | |
cancel:function() | |
{ | |
}, |
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
window.onload = function() { | |
var url = "http://admin:admin@localhost:4567/protected"; | |
var xhr = Titanium.Network.createHTTPClient(); | |
xhr.onload = function() { | |
var alerty = Titanium.UI.createAlertDialog(); | |
alerty.setTitle(this.responseText); | |
alerty.show(); | |
}; | |
xhr.open("GET",url); | |
xhr.send(); |
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
<html> | |
<head> | |
<title>Fetch Image</title> | |
<script type="text/javascript" src="index.js"></script> | |
<link href="index.css" rel="stylesheet" type="text/css"/> | |
</head> | |
<body> | |
<h3>Fetch Image From URL:</h3> | |
<div style='font-weight:bold'>Title</div> | |
<input id="imgTitle" type="text"></input> |
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
<html> | |
<head> | |
<script> | |
window.onload = function() { | |
var db = Titanium.Database.open('mydb'); | |
//Create an populate database | |
db.execute('CREATE TABLE IF NOT EXISTS DATABASETEST (ID INTEGER, NAME TEXT)'); | |
db.execute('DELETE FROM DATABASETEST'); |
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
<script type="text/ruby"> | |
globalArray = [1, 2, 3, 4]; | |
</script> | |
<script> | |
globalArray.push(5); | |
globalArray.push(6); | |
var elem = gloalArray.pop(); // should be 6 | |
alert(elem); | |
</script> |
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 myApplication = function(){ | |
var name = 'Chris'; | |
var age = '34'; | |
var status = 'single'; | |
function createMember(){ | |
// [...] | |
} | |
function getMemberDetails(){ | |
// [...] | |
} |
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
Ti.UI.backgroundColor = "#fff"; | |
var masterWindow = Ti.UI.createWindow({ | |
backgroundColor: '#FFF', | |
title: 'Master Window' | |
}); | |
var masterNavigationGroup = Ti.UI.iPhone.createNavigationGroup({ | |
window: masterWindow | |
}); | |
var detailWindow = Ti.UI.createWindow({ | |
backgroundColor: '#FFF', |
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
grace.resource("/posts/:id",{ | |
get: function(params) { | |
var posts = google.all("Post"); | |
//returns either HTML or JSON, based on "accept" header | |
grace.render(posts); | |
}, | |
post: function(params) { | |
var post = google.new("Post",params); | |
grace.render(post); | |
}, |
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
<html> | |
<head> | |
<style> | |
#products { | |
display: -webkit-box; | |
-webkit-box-orient: vertical; | |
} | |
#products p { height:33%; margin:0; } | |
</style> |
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 will only work with our dev keystore and not on a production device! --> | |
<property name="ti.android.google.map.api.key.development">0ZnKXkWA2dIAu2EM-OV4ZD2lJY3sEWE5TSgjJNg</property> | |
<!-- get yours at http://code.google.com/android/maps-api-signup.html --> | |
<property name="ti.android.google.map.api.key.production">GET_ME_FROM_GOOGLE</property> |