Skip to content

Instantly share code, notes, and snippets.

View csemrm's full-sized avatar

Mostafizur Rahman csemrm

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE us-patent-grant SYSTEM "us-patent-grant-v45-2014-04-03.dtd" [ ]>
<us-patent-grant lang="EN" dtd-version="v4.5 2014-04-03" file="USD0723366-20150303.XML" status="PRODUCTION" id="us-patent-grant" country="US" date-produced="20150217" date-publ="20150303">
<us-bibliographic-data-grant>
<publication-reference>
<document-id>
<country>US</country>
<doc-number>D0723366</doc-number>
<kind>S1</kind>
<date>20150303</date>
fs.exists('data/ipg150303.xml', function (exists) {
console.log("exists" + exists);
if (exists) {
console.log("exists" + exists);
fs.readFile('data/ipg150303.xml', 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
data = data.split('<?xml version="1.0" encoding="UTF-8"?>');
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/
/*
Copyright 2011-2013 Abdulla Abdurakhmanov
Original sources are available at https://code.google.com/p/x2js/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@csemrm
csemrm / app.js
Created December 28, 2014 09:20 — forked from rakhimoni/app.js
var win = Titanium.UI.createWindow({
backgroundColor : 'red',
});
// get refernce to the current window
var queslabel = Titanium.UI.createLabel({
text : 'Question',
height : 50,
color : '#000000',
font : {
<?php
// Put your device token here (without spaces):
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Put your private key's passphrase here:
$passphrase = 'xxxxxxx';
// Put your alert message here:
$message = 'A push notification has been sent!';
@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();
@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 / 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 / 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