Skip to content

Instantly share code, notes, and snippets.

06-10 13:34:03.623 12757 12776 E TiDownloadManager: (pool-2-thread-2) [24,243257] Exception downloading http://beerimages.pintley.com/12304/hades_mobileThumb.png
06-10 13:34:03.623 12757 12776 E TiDownloadManager: java.io.FileNotFoundException: /mnt/sdcard/com.pintley.Pintley/remote-image-cache/c4893e90ebeefd672ccd1b9fad902b7b8eec0e8e.hdr (Permission denied)
06-10 13:34:03.623 12757 12776 E TiDownloadManager: at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
06-10 13:34:03.623 12757 12776 E TiDownloadManager: at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
06-10 13:34:03.623 12757 12776 E TiDownloadManager: at java.io.FileOutputStream.<init>(FileOutputStream.java:94)
06-10 13:34:03.623 12757 12776 E TiDownloadManager: at java.io.FileOutputStream.<init>(FileOutputStream.java:66)
06-10 13:34:03.623 12757 12776 E TiDownloadManager: at java.io.FileWriter.<init>(FileWriter.java:42)
06-10 13:34:03.623 12757 12776 E TiDownloadManager: at org.appcelerator.titanium.util
@iotashan
iotashan / Analytics.js
Created September 14, 2011 20:14
Neat file that combines TestFlight and Google Analytics into one easy-to-use Module
exports.Analytics = function() {
// testflight
if (Ti.Platform.osname !== 'android') {
this.testflight = require("ti.testflight");
this.testflight.token('teamtokengoeshere');
Ti.API.debug("module is => " + this.testflight);
}
// Google
Titanium.include('/lib/analytics.js');
<cfcomponent name="CustomerConfig" entityname="CustomerConfig"
table="CustomerConfigs" persistent="true" output="false">
<cfproperty name="customerConfigID" type="numeric" fieldtype="id"/>
<cfproperty name="systemConfigs" singular="systemConfig" lazy="false" fieldtype="one-to-many" cfc="SystemConfig" fkcolumn="customerConfigID" inverse="true"/>
</cfcomponent>
test gist
function Common(input) {
this.phrase = input;
};
Common.prototype.doIt = function() {
return this.phrase;
};
module.exports = Common;
@iotashan
iotashan / NewWin.js
Created December 15, 2011 02:45
Creating a CommonJS singleton with Titanium
var secondCall = require('TestSingleton');
var NewWindow = function() {
var win = Titanium.UI.createWindow({
title:'Win 2',
backgroundColor:'#c00'
});
var label1 = Titanium.UI.createLabel({
color:'#999',
var MyCustomWindow = function(navController,title,number,points) {
var win = Ti.UI.createWindow({custom stuff here});
return win;
};
module.exports = MyCustomWindow;
@iotashan
iotashan / app.js
Created September 2, 2012 05:59
Example of using javascript loop labels with Titanium
outerloop:
for (var i=0;i<10;i++) {
Ti.API.debug('outerloop: '+i);
innerloop:
for (var x=0;x<10;x++) {
Ti.API.debug('innerloop: '+x);
if (x === i) {
break innerloop;
}
}
/**
* @author Shannon Hicks
*/
// detect screen density once because Ti.Platform.displayCaps calls are expensive
var retina = Ti.Platform.displayCaps.density == 'high';
var BeerRow = function(beer) {
// create a container object
var row = {};