Skip to content

Instantly share code, notes, and snippets.

@appcdr
appcdr / app.js
Created August 23, 2011 21:30
Appcelerator: Facebook photo albums sample app
(function() {
var mainWindow, tableview;
function setupWindow() {
mainWindow = Titanium.UI.createWindow({
title : 'Tab 1',
backgroundColor : '#fff'
});
@appcdr
appcdr / piece1.js
Created August 24, 2011 01:31
Appcelerator: Facebook photo albums pieces
Titanium.Facebook.appid = "134793934930";
Titanium.Facebook.permissions = [
'publish_stream',
'read_stream',
'user_photos',
'friends_photos'
];
@appcdr
appcdr / app.js
Created August 24, 2011 13:54
TableViewSection sample
var win = Ti.UI.createWindow();
var tableview = Ti.UI.createTableView();
var section = Titanium.UI.createTableViewSection();
section.headerTitle = "Hello";
var row1 = Titanium.UI.createTableViewRow({title:"Hello 1"});
var row2 = Titanium.UI.createTableViewRow({title:"Hello 2"});
section.add(row1);
section.add(row2);
tableview.setData([section]);
win.add(tableview);
@appcdr
appcdr / app.js
Created August 24, 2011 17:20 — forked from mattapperson/app.js
Appcelerator: Facebook photo albums sample app
(function() {
Titanium.Facebook.appid = "134793934930";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream', 'user_photos', 'friends_photos'];
Titanium.Facebook.addEventListener('login', function(e) {
if(e.success) {
getAlbumCovers();
return;
} else if(e.error || e.cancelled) {
@appcdr
appcdr / app.js
Created August 24, 2011 19:24
Appcelerator: Android Intent Filter app
Ti.UI.backgroundColor = '#fff';
var win = Ti.UI.createWindow();
var label = Ti.UI.createLabel({
text:"I'll bet you just clicked on a link to http://www.appcelerator.com",
color:'#000',
font: {
fontSize:32
},
width:'80%'
@appcdr
appcdr / AndroidManifest.xml
Created August 24, 2011 19:42
Appcelerator: Android Intent Filter AndroidManifest.xml
<!-- TI_APPLICATION -->
<activity android:name=".IntentFilterTestActivity"
android:label="Intent Filter Test" android:theme="@style/Theme.Titanium"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
@appcdr
appcdr / snippet.js
Created August 26, 2011 14:40
Android Send Text Intent
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_SEND,
type: "text/plain"
});
intent.putExtra(Ti.Android.EXTRA_TEXT, 'Some text that we want to share');
intent.addCategory(Ti.Android.CATEGORY_DEFAULT);
Ti.Android.currentActivity.startActivity(intent);
@appcdr
appcdr / app.js
Created August 26, 2011 15:39
Appcelerator: Android Send Intent sample app
Ti.UI.backgroundColor = '#000000';
var win = Ti.UI.createWindow();
var label = Ti.UI.createLabel({
text: 'Say Something!',
color:'#eeeeee',
font: {
fontSize:'20dp',
fontWeight:'bold'
},
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_SEND,
type: "text/plain"
});
intent.putExtra(Ti.Android.EXTRA_TEXT, 'Some text that we want to share');