Skip to content

Instantly share code, notes, and snippets.

View csemrm's full-sized avatar

Mostafizur Rahman csemrm

View GitHub Profile
@csemrm
csemrm / acs.js
Created December 29, 2013 16:04
Android Push notification using device Tokenin Titanium
var currentUser = null;
var loggedIn = false;
var Cloud = require('ti.cloud');
var categories = [];
var event_types = [];
Cloud.debug = true;
var MapModule = require('ti.map');
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
Titanium.Geolocation.getCurrentPosition(function(e) {
if (e.error) {
alert('HFL cannot get your current location');
return;
@csemrm
csemrm / alloy.js
Created January 4, 2014 04:41
Alloy: Map view in Titanium 3.2.0.GA http://docs.appcelerator.com/titanium/latest/#!/api/Modules.Map Test Environment Mac OS X 10.8.5 Ti SDK 3.2.0.GA Ti CLI 3.2.0 Android
Alloy.Globals.Map = require('ti.map');
@csemrm
csemrm / app.js
Last active January 2, 2016 22:09
View Animation using Titanium appcelerator
/*
Hi, I have tested this issue in Ti SDK 3.3.0.RC. Its working good.
Testing Environment:
Titanium SDK: 3.3.0.RC, 3.2.3.GA
Titanium CLI: 3.2.3
IOS Simulator 7.1
@csemrm
csemrm / app.js
Created March 2, 2014 06:04
Android: Working example for setActive tab
var win1 = Ti.UI.createWindow({
title : 'Win 1'
});
var button = Ti.UI.createButton({
color : '#000',
style : Ti.UI.iPhone.SystemButtonStyle.BORDERED,
title : 'Set Active Tab 1'
});
@csemrm
csemrm / app.js
Created March 23, 2014 04:48
Titanium ACS post Objects: How to post data in ACS server
var Cloud = require('ti.cloud');
Cloud.debug = true;
var win = Ti.UI.createWindow({
backgroundColor : 'white',
layout : 'vertical',
});
var aTableView = Ti.UI.createTableView();
login();
@csemrm
csemrm / app.js
Created March 24, 2014 09:12
Android and IOS: Tweet posting in Twitter
/**
* I'm creating a simple twitter to learn Titanium. What I have a simple Twitter Login.
* For Titanium Tweet Post i have done the following
* go to https://dev.twitter.com/apps
it will ask for login
Create Application Screen
fill the form to create application
@csemrm
csemrm / app.js
Last active August 29, 2015 13:58
How to access XML element by attribute id?
var self = Ti.UI.createWindow({
backgroundColor : '#fff'
});
var xhr = Titanium.Network.createHTTPClient();
var aTableView = Ti.UI.createTableView();
xhr.onload = function() {
//Ti.API.info('http://appc.mrtechnologybd.com/node.xml ' + this.responseXML + ' text ' + this.responseText);
var doc = this.responseXML.documentElement;
@csemrm
csemrm / ExampleService.js
Created April 16, 2014 05:39
Android: How to open apps when click on notification?
if(!Ti.App.Properties.hasProperty('notificationCount')) {
Ti.App.Properties.setInt('notificationCount', 0);
} else {
Ti.App.Properties.removeProperty('notificationCount');
var activity = Ti.Android.currentActivity();
var intent = Ti.Android.createIntent({
action : Ti.Android.ACTION_MAIN,
// you can use className or url to launch the app
// className can be found by looking in the build folder
@csemrm
csemrm / alertdialog.js
Last active August 29, 2015 14:00
custom alert button for IOS and Android
var args = arguments[0] || {};
var buttonNames = args.buttonNames;
$.dialog.buttonNames = buttonNames;
function doClick(e) {
alert('You clciked on ' + buttonNames[e.index]);
};
$.dialog.show();