Skip to content

Instantly share code, notes, and snippets.

View jonalter's full-sized avatar

Jonathan Alter jonalter

View GitHub Profile
@jonalter
jonalter / app.js
Created June 3, 2011 15:58
TabGroup window blur and focus
var tabGroup = Ti.UI.createTabGroup();
var win1 = Ti.UI.createWindow({
backgroundColor: 'blue'
});
win1.addEventListener('blur', function(e){
Ti.API.info('blur');
});
win1.addEventListener('focus', function(e){
Ti.API.info('focus');
@jonalter
jonalter / index.md
Created June 3, 2011 16:08
Android Urban Airship 1.0 documentation

urbanairship Module

Description

The UrbanAirship module is a way to connect to the UrbanAirship AirMail push notification service.

Accessing the urbanairship Module

To access this module from JavaScript, you would do the following:

@jonalter
jonalter / app.js
Created June 9, 2011 00:22
Remove a window's children
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var view1 = Ti.UI.createView({
backgroundColor: 'red',
height: 100,
width: 50,
top: 20,
left: 20,
@jonalter
jonalter / app.js
Created June 18, 2011 00:57
Android: delete all files from the sdcard that match a regex
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
layout: 'vertical'
});
var createButton = Ti.UI.createButton({
title: "create files",
top: 20,
height: 50,
width: 250,
@jonalter
jonalter / app.js
Created June 24, 2011 16:36
Geo Analytics Example
Titanium.UI.setBackgroundColor('#fff');
Ti.Geolocation.preferredProvider = "gps";
Ti.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
Ti.Geolocation.distanceFilter = 0;
Ti.Geolocation.purpose = "GPS demo";
// create tab group
var win = Ti.UI.createWindow({
layout: 'vertical'
@jonalter
jonalter / app.js
Created June 24, 2011 21:29
Open TabGroup from a home Window
var tabGroup;
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
layout: 'vertical',
exitOnClose: true,
navBarHidden: true
});
var createButton = Ti.UI.createButton({
@jonalter
jonalter / app.js
Created June 27, 2011 20:35
List files in the resourcesDirectory
var win = Ti.UI.createWindow({
backgroundColor: '#fff',
layout: 'vertical'
});
var testButton = Ti.UI.createButton({
title: "list files",
top: 20,
height: 50,
@jonalter
jonalter / app.js
Created July 7, 2011 05:28
Analytics Test App
Titanium.UI.setBackgroundColor('#fff');
// create tab group
var win = Ti.UI.createWindow({
layout: 'vertical'
});
var testOneButtonA = Ti.UI.createButton({
title: "featureEvent.android",
height: 50,
@jonalter
jonalter / index.html
Created July 11, 2011 19:24
Titanium Desktop file upload example
<html>
<head></head>
<body style="background-color:#ffffff;margin:10px">
<script>
var uploadFile = function(){
var text = document.getElementById('txt');
var dir = Titanium.Filesystem.getResourcesDirectory();
sep = Titanium.Filesystem.getSeparator(),
// filename = 'test.txt',
@jonalter
jonalter / index.html
Created July 19, 2011 01:18
Desktop PHP Get Value
<html>
<head>
</head>
<body style="background-color:#1c1c1c;margin:0">
<div style="border-top:1px solid #404040">
<div style="color:#fff;;padding:10px">
Welcome to Titanium
<script>
function openWindow(){
var win = Titanium.UI.createWindow("app://test.php?fname=Jonathan");