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 data = { | |
| "place" : "117464364938130", | |
| "coordinates" : { | |
| 'latitude' : 40.7798027, | |
| 'longitude' : -73.9481371, | |
| }, | |
| "access_token" : Ti.Facebook.accessToken | |
| }; |
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 data = { | |
| "place" : "117464364938130", | |
| "coordinates" : JSON.stringify({ | |
| 'latitude' : 40.7798027, | |
| 'longitude' : -73.9481371, | |
| }), | |
| "access_token" : Ti.Facebook.accessToken | |
| }; |
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
| BH = new BirdHouse({ | |
| service : 'twitter', | |
| consumer_key: "xxxxxxxxxxxx", | |
| consumer_secret: "xxxxxxxxxxxxxxxxxxxxxxx" | |
| }); | |
| BH.short_tweet("hello motto") |
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 processRSS = function(_feedURL, _tableView) { | |
| // create table view data object | |
| var data = []; | |
| Ti.API.info(" "+_feedURL); | |
| var xhr = Ti.Network.createHTTPClient(); | |
| xhr.open("GET",_feedURL.replace(/\"/g,"")); | |
| xhr.setRequestHeader('Accept', 'application/json'); | |
| xhr.onerror = function(e) { |
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 defaultColor = "#035385"; | |
| var window = Titanium.UI.createWindow({ | |
| backgroundColor:'#999' | |
| }); | |
| var weatherData = [ | |
| { title:"Mountain View (North America) - Cloudy", color:defaultColor}, | |
| { title:"Washington, DC (North America) - Mostly Cloudy", color:defaultColor }, | |
| { title:"Brasilia (South America) - Thunderstorm", color:defaultColor }, | |
| { title:"Buenos Aires (South America) - Clear", color:defaultColor }, |
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
| Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
| Titanium.Geolocation.distanceFilter = .25; | |
| Ti.Geolocation.purpose = "Callbacks Are Your Friend"; | |
| // make the API call | |
| Ti.Geolocation.getCurrentPosition(function(e) { | |
| // do this stuff when you have a position, OR an error | |
| if (e.error) { | |
| Ti.API.error('geo - current position' + e.error); |
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
| Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
| Titanium.Geolocation.distanceFilter = .25; | |
| Ti.Geolocation.purpose = "Callbacks Are Your Friend"; | |
| // global to hold the coords from the callback | |
| var global_var_coords; | |
| // make the API call | |
| Ti.Geolocation.getCurrentPosition(function(e) { | |
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
| Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
| Titanium.Geolocation.distanceFilter = .25; | |
| Ti.Geolocation.purpose = "Callbacks Are Your Friend"; | |
| // GLOBAL LISTENER | |
| Ti.App.addEventListener('location.updated',function(coords){ | |
| Ti.API.debug(JSON.stringify(coords)); | |
| } | |
| // make the API call |
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
| // | |
| // file_with_location.js | |
| // | |
| Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
| Titanium.Geolocation.distanceFilter = .25; | |
| Ti.Geolocation.purpose = "Callbacks Are Your Friend"; | |
| /** | |
| * @param {Object} _callback call on completion of location query | |
| */ | |
| function currentLocation(_callback) { |
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
| Ti.include('file_with_location.js'); | |
| // open a single window | |
| var window = Ti.UI.createWindow({ | |
| backgroundColor:'white' | |
| }); | |
| var coordsLbl = Titanium.UI.createLabel({ | |
| text:"NO LOCATION", | |
| left: 10, |