Instantly share code, notes, and snippets.

View example.js
var filesPath = Titanium.API.application.dataPath +
Titanium.Filesystem.getSeparator();
var currentFile = 'file.mp4';
var filePath = null;
switch(Titanium.getPlatform()) {
// Apple
case 'osx':
filePath = "file:///" + filesPath + currentFile;
break;
View FileUtils.js
/**
* Class name: FileUtils.js
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: March 5, 2011
* Platform: Titanium
*/
var FileUtils = function (){
View database.js
/**
* Class name: database.js
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: March 5, 2011
* Platform: Titanium
*/
var database = function(dbName, table){
View index.html
<html>
<head></head>
<body style="background-color:#1c1c1c;margin:0">
<div style="border-top:1px solid #404040">
<div style="color:#fff;;padding:10px">Welcome to Titanium</div>
</div>
<script type="text/javascript">
var url = 'http://www.codeboxed.com';
// Initialize the HTTPClient object
View index.html
<html>
<head></head>
<body style="background-color:#1c1c1c;margin:0">
<div style="border-top:1px solid #404040">
<div style="color:#fff;;padding:10px">Welcome to Titanium</div>
</div>
<script type="text/javascript">
localFile = Titanium.Filesystem.getDesktopDirectory().toString() +
Titanium.Filesystem.getSeparator() +