This file contains 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 sample lets you record and share video with Appcelerator Titanium on Android. | |
* Tested on 3.2.1 of TITANIUM MOBILE SDK, should work on 3.x. I don't know about previous versions. | |
* | |
* Based on https://gist.github.com/dawsontoth/832488 | |
* which does not fire the activity callback on 3.x | |
*/ | |
/** | |
* First, create our UI. We'll have two buttons: record, and share. |
This file contains 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
// I was unhappy about there was close to no control over the "pageControl" | |
// in scrollableViews, so I hacked my own | |
// ----- | |
// Configuration | |
var pageColor = "#c99ed5"; | |
PagingControl = function(scrollableView){ | |
var container = Titanium.UI.createView({ | |
height: 60 |
This file contains 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('lib/htmlparser.js'); | |
Ti.include('lib/soupselect.js'); | |
var select = soupselect.select; | |
var body = '<html><head><title>Test</title></head>' | |
+ '<body>' | |
+ '<img src="http://l.yimg.com/mq/i/home/HKGallery.gif" />' | |
+ '<div id="block">' | |
+ ' <div class="row">Row 1</div>' |
This file contains 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 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); |
This file contains 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
// How Publish a Tweet (Titanium) | |
// Full Codebird API is here: https://github.com/mynetx/codebird-js | |
// Codebird for Appcelerator Titanium. Using the Twitter API 1.1: https://gist.github.com/viezel/5781083 | |
//THANKS VIEZEL | |
This file contains 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 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
/** | |
* We'll start by making a window with a button... | |
*/ | |
var win = Ti.UI.createWindow({ | |
backgroundColor : '#fff' | |
}); | |
var shareButton = Ti.UI.createButton({ | |
width : 90, | |
bottom : 10, | |
height : 30, |
This file contains 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 file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number} | |
// add the following methods to GeolocationModule.mm | |
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region | |
{ | |
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(region.center.latitude),@"lat",NUMDOUBLE(region.center.longitude),@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil]; | |
if ([self _hasListeners:@"enteredRegion"]) | |
{ | |
[self fireEvent:@"enteredRegion" withObject:event]; |
This file contains 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 custom loading indicator | |
// ============================================================================== | |
var indWin = null; | |
var actWin = null; | |
var indicatorShowing = false; | |
var actInd; | |
var actIndAndroid; | |
var screenWidth = Titanium.Platform.displayCaps.platformWidth; |
This file contains 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({ | |
title: 'Video Record', | |
backgroundColor: '#fff' | |
}); | |
var videoUri = null; | |
function startRecording(){ | |
var intent = Titanium.Android.createIntent({ action: 'android.media.action.VIDEO_CAPTURE' }); |
NewerOlder