Functions to convert a geohash to/from a latitude/longitude point, and to determine bounds of a geohash cell and find neighbours of a geohash.
Methods summary:
encode: latitude/longitude point to geohashdecode: geohash to latitude/longitude
| 'use strict'; | |
| /** | |
| * Android sample showing speech recognition using Hyperloop. | |
| * | |
| * @version Titanium 6.1.2.GA | |
| * @version Alloy 1.9.13 | |
| * @version Hyperloop 2.1.3 | |
| */ |
| var AVAudioEngine = require('AVFoundation/AVAudioEngine'); | |
| var AVAudioPlayerNode = require('AVFoundation/AVAudioPlayerNode'); | |
| var AVAudioFile = require('AVFoundation/AVAudioFile'); | |
| var NSBundle = require('Foundation/NSBundle'); | |
| var win = Ti.UI.createWindow({ | |
| backgroundColor: '#fff' | |
| }); | |
| var btn = Ti.UI.createButton({ |
| var CLBeaconRegion = require("CoreLocation/CLBeaconRegion"), | |
| NSUUID = require("Foundation/NSUUID"), | |
| CLLocationManager = require("CoreLocation/CLLocationManager"), | |
| CLProximityFar = require("CoreLocation").CLProximityFar, | |
| CLProximityNear = require("CoreLocation").CLProximityNear, | |
| CLProximityImmediate = require("CoreLocation").CLProximityImmediate, | |
| CLProximityUnknown = require("CoreLocation").CLProximityUnknown, | |
| UILocalNotification = require("UIKit/UILocalNotification"), | |
| UIApplication = require("UIKit/UIApplication"), | |
| locationManager; |
| module.exports = { | |
| hyperloop: { | |
| ios: { | |
| xcodebuild: { | |
| frameworks: [ | |
| 'iAd' | |
| ] | |
| } | |
| } | |
| } |
| const SFAuthenticationSession = require('SafariServices/SFAuthenticationSession'); | |
| const NSURL = require('Foundation/NSURL'); | |
| const session = SFAuthenticationSession.alloc().initWithURLCallbackURLSchemeCompletionHandler( | |
| NSURL.alloc().initWithString('https://github.com/login/oauth/authorize?scope=repo&client_id=XXXXX'), | |
| 'appcgithub://', | |
| function(url, error) { | |
| if (error != null) { | |
| Ti.API.error('Error performing OAuth: ' + error.localizedDescription); | |
| cb({ success: false, error: 'Error performing OAuth: ' + error.localizedDescription }); |
| #!/bin/sh | |
| function ios-sim-inspector() { | |
| appName="$1" | |
| osascript <<EOF | |
| # Name of the device as visible in Safari->Develop menu | |
| set deviceName to "Simulator" | |
| # Number of seconds to wait for the simulator window to show up | |
| set maxWait to 20 |
Functions to convert a geohash to/from a latitude/longitude point, and to determine bounds of a geohash cell and find neighbours of a geohash.
Methods summary:
encode: latitude/longitude point to geohashdecode: geohash to latitude/longitude| /* | |
| * Below is the background service to monitor the health of the app internet connection. | |
| * It'll set a variable to tell any other controller what's going on with the current connection. | |
| * 1 = Everything's good. | |
| * 2 = Poor connectivity, but still have a connection. | |
| * 3 = We have internet, but are having problems with the API. | |
| * 4 = No internet. | |
| */ | |
| function appConnectionHealth() { |
| /* | |
| * Simple page indicator for scrollableViews for Appcelerator Titanium (Android). | |
| * To be added after the views have been set. | |
| * | |
| * var p = require('page.indicator'); | |
| * var options = { color: 'red' }; | |
| * var indicator = p.pageIndicator(myScrollableView, options); | |
| */ | |
| /** | |
| * Ti.DynamicLib | |
| * @abstract Support embedded binaries (aka dynamic libraries) in Titanium modules and Hyperloop. | |
| * @version 1.1.0 | |
| * | |
| * Install: | |
| * 1) Search and replace '../../src/<YourFramework>.framework' with your framework location. | |
| The path is relative to the `build/iphone` directory. | |
| * 2a) For classic modules: | |
| * - Add 'LD_RUNPATH_SEARCH_PATHS=$(inherited) "@executable_path/Frameworks" $(FRAMEWORK_SEARCH_PATHS)' |