This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Titanium.UI.createWindow(); | |
| win.backgroundColor = '#fff'; | |
| Ti.Geolocation.preferredProvider = "gps"; | |
| Ti.Geolocation.purpose = "GPS demo"; | |
| function translateErrorCode(code) { | |
| if (code == null) { | |
| return null; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // implement like this: | |
| var window = Ti.UI.createWindow({ | |
| backgroundColor:'#fff' | |
| }); | |
| // draw the gridlines first so your other elements stack on top of them | |
| // without requiring you to set the z-index property of each | |
| var grid = require('gridlines'); | |
| grid.drawgrid(10,window); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Creates an image view using Google's QR Code generator. | |
| * @param text The text to be encoded in the QR code | |
| * @param size The size of the QR code; Possible Sizes: 100x100, 150x150, 200x200, 250x250, 300x300, 350x350, 400x400, 500x500 | |
| */ | |
| function createQRCodeImageView(text, size) { | |
| var url = 'http://chart.apis.google.com/chart?cht=qr&chs=' + size + '&chl=' + encodeURI(text) + '&chld=H|0'; | |
| var width = size.split('x')[0], height = size.split('x')[1]; | |
| if (Ti.Android) { | |
| width += 'dp'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Include a small sensis helper library | |
| var mind = {}; | |
| Ti.include('sensis.js'); | |
| // Custom activity indicator | |
| var indWin = null; | |
| var actInd = null; | |
| function showIndicator() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({}); | |
| win.open(); | |
| var height = Ti.Platform.displayCaps.platformHeight-40; | |
| var width = Ti.Platform.displayCaps.platformWidth; | |
| var viewsArray = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This gist is only for Android. | |
| If you would like launch native apps | |
| on iPhone, iPad, you can find information about it in Appcelerator Docs: | |
| -https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.canOpenURL-method.html | |
| -https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html | |
| More info about iOS URL Schemes: http://handleopenurl.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = Ti.UI.createWindow({ | |
| fullscreen:false | |
| }); | |
| var table = Ti.UI.createTableView(); | |
| var row; | |
| var data = []; | |
| for(var i = 17301504; i < 17302359; i ++){ | |
| try{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // blog.clearlyinnovative.com | |
| // Aaron K. Saunders | |
| // Clearly Innovative Inc | |
| // | |
| var database_url = "http://greenlyyt.iriscouch.com/movie_store/"; | |
| var user_name, password; | |
| /** ---------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create a new project and copy this code into app.js | |
| // if you use this code, please give me credit :) | |
| function JustAView(text){ | |
| var view = Ti.UI.createView({ | |
| backgroundColor:"#"+((1<<24)*Math.random()|0).toString(16), | |
| width:200, | |
| height:100 | |
| }); | |
| var label = Ti.UI.createLabel({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // blog.clearlyinnovative.com | |
| // Aaron K. Saunders | |
| // Clearly Innovative Inc | |
| // | |
| // @see https://github.com/aaronksaunders/Appcelerator-Cocoafish-Native-Module | |
| // | |
| var cocoafishMgr = require('com.ci.cocoafish'); | |
| Ti.API.info("module is => " + cocoafishMgr); |