Friday, October 28, 2011

Android Supporting Links

Display Chart

http://mobile.tutsplus.com/tutorials/appcelerator/make-a-stock-quote-app-displaying-charts-with-raphael-js/

Eclipse Andriod Hello World

http://androidcodemonkey.blogspot.com/2010/01/hello-world-your-first-android.html

http://www.ceveni.com/2009/06/writing-android-hello-world-program.html

Eclipse Android Simple Tutorial
http://www.vogella.de/articles/Android/article.html#first_project


Jquery News application
http://mobile.tutsplus.com/tutorials/mobile-web-apps/use-jquery-mobile-to-build-a-native-android-news-reader-app-part-3/


Php Android JSON web services
http://www.codeproject.com/KB/android/jsonandroidphp.aspx

http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/

http://fahmirahman.wordpress.com/2011/04/26/the-simplest-way-to-post-parameters-between-android-and-php/

Thursday, October 27, 2011

Android app.js code for blog rss

Titanium.UI.setBackgroundColor('#000');

var win = Titanium.UI.createWindow({  
    title:'Query7 RSS Feed',
    backgroundColor:'#000'
});

var data = [];

// create table view
var tableview = Titanium.UI.createTableView({
 data:data,
 headerTitle: 'Query7 RSS',
 backgroundColor:'#000'
});

win.add(tableview);


var xhr = Titanium.Network.createHTTPClient();

xhr.onload = function()
{
 
 try
 {
  var doc = this.responseXML.documentElement;
  var items = doc.getElementsByTagName('item');
  var doctitle = doc.evaluate("//channel/title/text()").item(0).nodeValue;
  
  var urls = new Array();
  
  for(var c=0; c>>>>' + e.index);

   var intent = Titanium.Android.createIntent({
   
    action: Titanium.Android.ACTION_VIEW,
    data: urls[e.index],
   
   });
   
   intent.addCategory(Titanium.Android.CATEGORY_BROWSABLE);
   Ti.Android.currentActivity.startActivity(intent);
   
   
   });
  
   tableview.appendRow(row);
   

   
  }
 
 }
 catch(E)
 {
  alert(E);
 }
 
};

xhr.open('GET', 'http://feeds.feedburner.com/query7blog.rss');
xhr.send();

win.open();

http://query7.com/titanium-mobile-android-development-first-application

Android JSON data extract

http://stackoverflow.com/questions/7722830/unable-to-delete-data-from-json-object-in-titanium

http://stackoverflow.com/questions/7526860/unable-to-connect-to-json-service-in-android-application-of-titanium-studio



alert(jsontext.feeds[0].username) // abc

  // shift the beginning of the array
  jsontext.feeds.shift();

alert(jsontext.feeds[0].username) //bcd  ?

Android Application with JSON


var xhr = Titanium.Network.createHTTPClient();
xhr.onload = function()
{
    var data = JSON.parse(this.responseText);
 
    var itemList = data.list;
    var x = 0;
 
    for(var i in itemList)
    {
        var thisItem = itemList[i];
        Ti.API.info('Article Title: ' + thisItem.title);
    }
};
xhr.open('POST', 'https://readitlaterlist.com/v2/get');
xhr.send({
    format:     'json',
    username:   '--username--',
    password:   '--password--',
    apikey:     '7f5dfZc6T730xy6aobA2e66Sb7gdk507'
});
http://developer.appcelerator.com/question/46881/trying-to-parse-jsonxml---works-fine-on-iphone-not-on-android

PHP for Android

http://www.talkandroid.com/6211-php-for-android-install-it-and-start-testing/

Friday, October 14, 2011

Fb Share not working below 50x50 images

Facebook share script minimum expecting "50x50" size to share images. So you can't share below 50px images on facebook.

Conditions details from facebook

An image URL which should represent your object within the graph. The image must be at least 50px by 50px and have a maximum aspect ratio of 3:1. We support PNG, JPEG and GIF formats. You may include multiple og:image tags to associate multiple images with your page.

Reference link

http://developers.facebook.com/docs/opengraph/

Fb like for php and joomla not working for https

FB like not working for https for current status

https://www.facebook.com/pages/Visva-Solutions/126578200760580?sk=wall

Will work only for http for current status

http://www.facebook.com/pages/Visva-Solutions/126578200760580?sk=wall

Sample

<div style="width: 100px; text-align: center; float: right; padding-top: 125px; padding-right:80px;"><div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.facebook.com/pages/Visva-Solutions/126578200760580?sk=wall" send="false" layout="button_count" width="200" show_faces="false" font=""></fb:like></div>

Wednesday, October 12, 2011

Authorized.net Production URL

Change Test to production

Step 1: If you are passing x_test_request=true in your code, change to x_test_request=false

Step 2: Make sure you are posting to https://secure.authorize.net/gateway/transact.dll



Test UrL

https://test.authorize.net/gateway/transact.dll

Sunday, October 9, 2011

Create web services using JSON and XML

http://davidwalsh.name/web-service-php-mysql-xml-json


serverpage.php


/* require the user as the parameter */
if(isset($_GET['user']) &amp;&amp; intval($_GET['user'])) {

/* soak in the passed variable or set our own */
$number_of_posts = isset($_GET['num']) ? intval($_GET['num']) : 10; //10 is the default
$format = strtolower($_GET['format']) == 'json' ? 'json' : 'xml'; //xml is the default
$user_id = intval($_GET['user']); //no default

/* connect to the db */
$link = mysql_connect('localhost','username','password') or die('Cannot connect to the DB');
mysql_select_db('db_name',$link) or die('Cannot select the DB');

/* grab the posts from the db */
$query = "SELECT post_title, guid FROM wp_posts WHERE post_author = $user_id AND post_status = 'publish' ORDER BY ID DESC LIMIT $number_of_posts";
$result = mysql_query($query,$link) or die('Errant query: '.$query);

/* create one master array of the records */
$posts = array();
if(mysql_num_rows($result)) {
while($post = mysql_fetch_assoc($result)) {
$posts[] = array('post'=&gt;$post);
}
}

/* output in necessary format */
if($format == 'json') {
header('Content-type: application/json');
echo json_encode(array('posts'=&gt;$posts));
}
else {
header('Content-type: text/xml');
echo '&lt;posts&gt;';
foreach($posts as $index =&gt; $post) {
if(is_array($post)) {
foreach($post as $key =&gt; $value) {
echo '&lt;',$key,'&gt;';
if(is_array($value)) {
foreach($value as $tag =&gt; $val) {
echo '&lt;',$tag,'&gt;',htmlentities($val),'&lt;/',$tag,'&gt;';
}
}
echo '&lt;/',$key,'&gt;';
}
}
}
echo '&lt;/posts&gt;';
}

/* disconnect from the db */
@mysql_close($link);
}


http://mydomain.com/web-service.php?user=2&num=10
http://mydomain.com/web-service.php?user=2&num=10&format=json