Skip to content

Instantly share code, notes, and snippets.

View SquirrelMobile's full-sized avatar

Squirrel SquirrelMobile

View GitHub Profile
@hansemannn
hansemannn / cache.js
Created December 12, 2018 10:19
Caching remote images in Titanium (asynchronously)
export default class Utils {
static loadCachedImageFromURL(url, cb) {
let filename;
try {
filename = url.substring(url.lastIndexOf('/') + 1);
} catch (err) {
cb(null);
}
@hansemannn
hansemannn / liveview-from-cli.md
Last active December 9, 2022 17:12
Use LiveView from the Titanium CLI (without Studio)
  1. Install LiveView globally:
npm i -g liveview
  1. Change the ~/.titanium/config.json to include the CLI hook (under paths -> hook):
{
	"user": { ... },
	"app": { ... },
	"cli": { ... },
@ricardoalcocer
ricardoalcocer / app.js
Last active September 3, 2021 14:43
Appcelerator Titanium Android Background Service
// start service
var SECONDS = 20; // every 10 seconds
var intent = Titanium.Android.createServiceIntent({
url: 'logservice.js'
});
intent.putExtra('interval', SECONDS * 1000); // Needs to be milliseconds
Titanium.Android.startService(intent);