Skip to content

Instantly share code, notes, and snippets.

@saggy
saggy / 00-README.txt
Created October 15, 2012 07:55 — forked from bob-sims/00-README.txt
Demo of charts display using simulated web service data. Charts are rendered in WebViews using the RGraph JS library within Titanium Mobile, which works nicely on Android.
This app uses RGraph library to build Android-compatible pie charts using Titanium Mobile.
Brief screencast to demo functionality:
http://youtu.be/itTEwQmvNfY?hd=1
This was for a work prototype/mockup, so excuse the esoteric text labels and fake activity indicator.
I borrowed heavily from prior art.
Aaron Saunder's "Titanium Appcelerator Quickie: Google Charts and Appcelerator"
// get the collection object
Alloy.Collections.instance("Fugitive");
// delete all items
Alloy.Collections.Fugitive.deleteAll();
/**
* This sample lets you record and share video with Appcelerator Titanium on Android.
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html
*/
/**
* First, create our UI. We'll have two buttons: record, and share.
*/
var win = Titanium.UI.createWindow({
Alloy.Globals.gc = function(ob, parent) {
if (ob.children) {
for (var c = (ob.children.length - 1); c >= 0; c--) {
Alloy.Globals.gc(ob.children[c], ob);
}
}
if (parent) {
parent.remove(ob);
ob = null;
}
Alloy.Globals.settings = {}; // Create Empty Object.
/* Settings Getter - Can also just access Alloy.Globals.settings[key] */
Alloy.Globals.settings.get = function(key) {
return Alloy.Globals.settings[key] || null;
}
/* Settings Saver */
Alloy.Globals.settings.set = function(key,value) {
var settings = Alloy.createCollection('settings');
Alloy.Globals.gc = function(ob, parent) {
if (ob.children) {
for (var c = (ob.children.length - 1); c >= 0; c--) {
Alloy.Globals.gc(ob.children[c], ob);
}
}
if (parent) {
parent.remove(ob);
ob = null;
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adriatic.test" android:versionCode="1"
android:versionName="1">
<uses-sdk android:minSdkVersion="11" />
<!-- TI_MANIFEST -->
<application android:icon="@drawable/appicon"
android:label="Test Application" android:name="TestApplication"
@saggy
saggy / app.js
Created June 25, 2013 16:24 — forked from viezel/app.js
// This is an example of use.
// Here we use the new Bearer Token thats make it possible to get tweets without user login
// More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth
// Full Codebird API is here: https://github.com/mynetx/codebird-js
var Codebird = require("codebird");
var cb = new Codebird();
cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY');
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null);
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
layout: 'vertical'
});
var bt1 = Ti.UI.createButton({title: 'send message (method 1)', top: 200});
bt1.addEventListener('click', function(e)
var container = Ti.UI.createView({backgroundColor: "white", layout: "vertical"});
var layout = [
{
title: "Parent 1",
isparent: true,
opened: false,
sub: [
{