Skip to content

Instantly share code, notes, and snippets.

@yagitoshiro
yagitoshiro / gist:1247519
Created September 28, 2011 09:54
Titanium Mobile (Android) sample -- save file to sdcard and register to photo gallery.
save_button.addEventListener('click', ()->
if Ti.Filesystem.isExternalStoragePresent
save_image = Ti.Filesystem.getFile(path).read()
new_path = Titanium.Filesystem.externalStorageDirectory + Date.now().toString() + ".png"
f = Ti.Filesystem.getFile(new_path)
result = f.write(save_image)
unless result
return null
@adampax
adampax / gist:1241077
Created September 25, 2011 20:05
Use Titanium Picker to Update Scrollable View
var win = Titanium.UI.createWindow({
title : 'test'
});
var view1 = Ti.UI.createView({
backgroundColor:'red'
});
var l1 = Ti.UI.createLabel({
text:'View 1',
color:'#fff',