Skip to content

Instantly share code, notes, and snippets.

View bob-sims's full-sized avatar

Bob Sims bob-sims

View GitHub Profile
@bob-sims
bob-sims / menu.js
Created February 23, 2011 23:48
a .js include file for use in Appcelerator Titanium cross-platform mobile apps to create option menus. Option menus display at the bottom of the screen in iPhone and when you press the menu button in an Android app. Credit to Justin Toth.
/*
// Credit to Justin Toth.
// My own edits have been only slight: added property for image (icon) attached to menu item button
To use:
Ti.include('menu.js');
function createMenu() {
@bob-sims
bob-sims / Appcelerator MapView annotation properties
Created March 27, 2011 15:36
Determining which Appcelerator Mobile MapView annotation properties work in Android.
var currentWin = Ti.UI.currentWindow;
// below example would require variable declarations for Name, Description, image, Lat, Longitude
// Docs:
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.Annotation-object
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.MapView-object
//
// CREATE MAP VIEW
//
@bob-sims
bob-sims / 00-readme.txt
Created November 28, 2011 22:28
CommonJS module to pull XML response from from (undocumented) Google Weather API, for use with Titanium Mobile
// console dump of sample returned object
I/TiAPI ( 244): (kroll$4: app://app.js) [797,3312] Object
I/TiAPI ( 244): {
I/TiAPI ( 244): weatherData => Object
I/TiAPI ( 244): {
I/TiAPI ( 244): forecastInfo => Object
I/TiAPI ( 244): {
I/TiAPI ( 244): city => 'Bydgoszcz, Kuyavian-Pomeranian Voivodeship',
@bob-sims
bob-sims / 00-README.txt
Created December 3, 2011 23:22
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"
@bob-sims
bob-sims / fetchYouTubeJSON.js
Created December 4, 2011 12:32
My take on retrieving YouTube JSON feed by CommonJS module for Ti Mobile, remains work in progress.
// To call, use this statement in app.js:
// require('fetchYouTubeJSON').fetchJSONData('https://gdata.youtube.com/feeds/api/users/...');
// fires app-level event to return data, use to populate TableView or similar
//
// maybe add some cache features? http://pastie.org/1541768
// http://pastebin.com/Eq1DLsdP
// once again, ripping from the talented @skypanther
exports.fetchYouTubeData = function(url) {
// Pulls the JSON feed data and returns it to caller
@bob-sims
bob-sims / googleCountryArray.js
Created December 22, 2011 20:37
My take on an array of language codes allowed by Google Search API (hl variable)
var googleCountryArray = ["af","sq","sm","ar","az","eu","be","bn","bh","bs","bg","ca","zh-CN","zh-TW","hr","cs","da","nl","en","en-uk","eo","et","fo","fi","fr","fy","gl","ka","de","el","gu","iw","hi","hu","is","id","ia","ga","it","ja","jw","kn","ko","la","lv","lt","mk","ms","ml","mt","mr","ne","no","nn","oc","fa","pl","pt-BR","pt-PT","pa","ro","ru","gd","sr","si","sk","sl","es","su","sw","sv","tl","ta","te","th","ti","tr","uk","ur","uz","vi","cy","xh","zu"];
@bob-sims
bob-sims / 00-README.TXT
Last active October 1, 2015 09:47
Demo CommonJS module for Titanium Mobile interaction with Drupal Services 3.x REST + JSON interface
This is a simple CommonJS module to wrap Titanium Ti.Network.HttpClient calls to interact with Drupal Services.
NOTE: Code updated at @TiConf using callback functions.
Tested using:
Drupal 6.24
Services 3.1
Titanium Mobile SDK 1.8.2 (Android 2.2 SDK)
@bob-sims
bob-sims / convertImages.sh
Created July 26, 2012 02:10
Automated Build of X-Platform Titanium Splash Screens and Icons
#! /bin/bash
# inspired by Greg McCormick's (@crushmedianet) post
# http://crushmedia.net/2012/04/23/automated-build-of-titanium-iconloading-files/
# updated 4 Aug 2012: creates clipped iPad backgrounds by cropping 768x1024, etc.
# create following base images + save in APPNAME/Resources/:
# appicon-android-512x512.png
@bob-sims
bob-sims / norva_drupal.md
Created August 1, 2012 02:36
GistDeck Brief: Ti Mobile + Drupal Web Services

Building Cross-Platform Native Mobile Apps With Titanium Mobile and Drupal Web Services

Hampton Roads Drupal Users Group

About Me

About Me

@bob-sims
bob-sims / 00-readme.md
Created September 24, 2012 21:53
Staff Directory demo app for Appcelerator #TiMob training

#Overview

I created this simple Staff Directory App as a demonstration for a small internal staff training workshop. Finished product shown below, goal throughout class was to explain code walkthrough and learning resources in pieces, allowing students to create app as a practical exercise.

..

My goals:

  • Show utility of Titanium Mobile to rapidly create simple, x-platform, enterprisey apps (clever term via @thiswayup)
  • Demonstrate use of app template (Master/Detail) included as part of Ti Studio.