Skip to content

Instantly share code, notes, and snippets.

View rajubd49's full-sized avatar

Md Harish Uz Jaman Mridha rajubd49

View GitHub Profile
@rajubd49
rajubd49 / app.js
Created April 16, 2015 12:58
Get phone's location, altitude, accuracy and speed - Appcelerator Titanium
Titanium.Geolocation.getCurrentPosition(function(e)
{
if (!e.success || e.error)
{
currentLocation.text = 'error: ' + JSON.stringify(e.error);
Ti.API.info("Code translation: "+translateErrorCode(e.code));
alert('error ' + JSON.stringify(e.error));
return;
}
var longitude = e.coords.longitude;
@rajubd49
rajubd49 / app.js
Created April 16, 2015 12:57
GET and POST special characters to server - Appcelerator Titanium
//How to GET and POST special characters to server
var win=Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var lbl = Titanium.UI.createLabel({
top:10,
width:300,
left:10,
@rajubd49
rajubd49 / app.js
Created April 16, 2015 11:07
Full Screen Video playback in iOS - Appcelerator Titanium
var vidWin = Titanium.UI.createWindow({
title : 'Video',
backgroundColor : '#fff'
});
var videoPlayer = Titanium.Media.createVideoPlayer({
top : 2,
autoplay : true,
backgroundColor : 'blue',
height : 300,
@rajubd49
rajubd49 / index.js
Last active August 29, 2015 14:19
Fly out/in a view - Appcelerator titanium
var newtop = Ti.Platform.displayCaps.platformHeight + 20;
function doBox(e) {
$.box.animate({
top:newtop,
duration:2000,
autoreverse: true
});
}
$.index.open();
@rajubd49
rajubd49 / app.js
Created April 16, 2015 10:14
Flip between views-iOS - Appcelerator Titanium
var state = true;
var window = Titanium.UI.createWindow({
backgroundColor: '#ffffff',
height: Ti.UI.FILL,
width: Ti.UI.FILL
});
var view = Ti.UI.createView({
top:165,
width:300,
@rajubd49
rajubd49 / app.js
Created April 16, 2015 10:04
Fire an event from local HTML - Appcelerator Titanium
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var webView = Ti.UI.createWebView({
url:'/localHtml.html',
backgroundColor:'transparent'
});
win.add(webView);
Ti.App.addEventListener("appC", function(e) {
var win1 = Titanium.UI.createWindow({
@rajubd49
rajubd49 / app.js
Created April 16, 2015 09:34
Email Attachment local file - Appcelerator Titanium
var win = Ti.UI.createWindow({
backgroundColor : "gray"
});
var btn = Ti.UI.createButton({
title : "open email dialogue",
top : 100,
left : 100,
height : 150,
width : 150
@rajubd49
rajubd49 / app.js
Created April 16, 2015 09:32
Change Image in click listener - Appcelerator Titanium
var win = Ti.UI.createWindow();
var like = Titanium.UI.createImageView({
image : '/image1.png',
left : 50,
top : 50,
height : 50,
width : 50
});
@rajubd49
rajubd49 / app.js
Created April 16, 2015 08:19
Camera Switching and camera support checking - Appcelerator Titanium
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var aButton = Ti.UI.createButton({
title : 'Camera',
height : 50,
@rajubd49
rajubd49 / app.js
Created April 16, 2015 08:12
Android Navigating Windows - Appcelerator Titanium
var mainWin = Ti.UI.createWindow({
backgroundColor: "blue"
});
var btn = Ti.UI.createButton({
title: "Click",
width: 200,
height: 50,
backgroundColor: "#fff",
color: "#000"
});