Thoughts about coding and books

Jquery mobile mobileinit event not firing

Because Jquery mobile mobileinit event is triggered when mobile jquery starts to load then event listener must be binded before execution reach to loading jquery mobile javascript file. Usually mobileinit event is binded using selector $ from jquery like this: $(document).bind(“mobileinit”,onMobileInit); This dictates JS files loading sequence in PhoneGap and websites to be something like:Read more about Jquery mobile mobileinit event not firing[…]

Add Facebook login to PhoneGap/Cordova Android app Easiest way – UPDATED

First ensure that you have Basic PhoneGap application running on your android. Check this tutorial if needed. Official tutorial is not so good but might help you out if Phonegap Facebook tutorial here fails. For additional information go to https://github.com/davejohnson/phonegap-plugin-facebook-connect/blob/master/README.md.

  1. Download PhoneGap Facebook plugin from https://github.com/davejohnson/phonegap-plugin-facebook-connect/tree/master/www
  2. Move cdv-plugin-fb-connect.js into your android phonegap webroot assets/www
  3. Include it in index.html <script type=”text/javascript” charset=”utf-8″ src=”cdv-plugin-fb-connect.js”></script>
  4. Add <plugin name=”org.apache.cordova.facebook.Connect” value=”org.apache.cordova.facebook.ConnectPlugin” /> into res/xml/plugins.xml Read more about Add Facebook login to PhoneGap/Cordova Android app Easiest way – UPDATED

PhoneGap performance measurement results

I was wondering how much is loss in performance is one would write application in PhoneGap and javascript instead of native code. I wrote 2 very basic programs one in android and second in PhoneGap. This program did standard busy looping and common string operation indexOf in the for loop. One interesting issue i found is that when you use body onload and do not finish in time then you will get error “Application Error: The connection to the server was unsuccessful. (file:///android_asset/www/index.html)”

3 different loop times were measured in javascript and native android java. Examlpe Code in Android  was : Read more about PhoneGap performance measurement results

PhoneGap vs native Android and iPhone app performance and features

Overview PhoneGap is mobile framework that allows developers to create HTML 5 and JavaScript pages and sun these inside mobile devices. Please bear in mind that “webserver” runs inside the device. It is also possible to display external pages using plugin called ChildBrowser. While PhoneGap does not support PHP it does support javascript libraries likeRead more about PhoneGap vs native Android and iPhone app performance and features[…]