Back from ApacheCon North America 2016

I just get back from ApacheCon North America that was be held from 11 May to 13 May @Vancouver, Canada. The conference organization was really great and there were a lot of attendees in the conference sessions.

HazemSaleh_ApacheCon2016

I had the chance to present “Advanced Apache Cordova” in 12 May, the session was interactive, contained three live demos and I was really amazed by the energy, enthusiasm, and responsiveness of the attendees during the session.

My session is uploaded below.

Finally, I would like to thank all the organizers of ApacheCon conference for making the conference looks so great.

iOS 9, Cordova, and jQuery mobile apps Integration tips

Unfortunately after having iOS 9 update, you may find your Cordova jQuery mobile app has the following problems:

  1. All of your app’s popups are suddenly closed after the first opening time!
  2. All your app’s back button are not working anymore!

The root cause of these problems is a bug in iOS9 UIWebView‘s window.location.hash as shown in the link below:
https://openradar.appspot.com/22186109

Fixes

In order to fix these issues, you can do the following workarounds.

Fixing the sudden closing pop-up

In order to fix this issue, make sure to set the data-history attribute of jQuery mobile popup to "false". An example of this is shown in the link below:
https://github.com/hazems/cordova-mega-app/blob/master/www/index.html

Fixing the broken back button

In order to fix this issue, make sure to disable the hash listening behaviour for jQuery mobile when the device is ready. You need to be careful when applying this fix, make sure that this fix will be applied for only iOS version 9 as shown in the code snippet below.

if (device.platform === "iOS"  && parseInt(device.version) === 9) {
  $.mobile.hashListeningEnabled=false;
} /* when the device is ready */

Checking a working Cordova jQuery mobile app in iOS 9

Finally, you can check a complete working Cordova jQuery mobile app in iOS 9. This app is one of the examples of the “JavaScript Mobile Application Development” book which can be reached at:
http://www.amazon.com/JavaScript-Native-Mobile-Apps-Development/dp/1783554177/
https://www.packtpub.com/web-development/javascript-native-mobile-apps-development

The example app uses Apache Cordova 5.3.3 and jQM 1.4.5. Enjoy!

Back from ApacheCon North America 2015

I just get back from ApacheCon North America that was be held from 13 April to 16 April @Austin, Texas, USA. The conference organization was really great and there were a lot of attendees in the conference sessions.
IMG_8838

I had the chance to present “Apache Cordova In Action” in 13 April, the session had many attendees and I was really amazed by the energy, enthusiasm, and responsiveness of the attendees during the session.
Feedback

The session went great and I was glad to give a free copy of my JavaScript Mobile Application Development book to one of the attendees who answered a JavaScript quiz at the end of my session.
Books

I uploaded my session below:

Finally, I would like to thank all the organizers of ApacheCon conference for making the conference looks so great.
Main

Back from JavaLand Germany 2015

JavaLand2015Main

I just get back from JavaLand that was be held from 24 March to 26 March @Brühl, Germany. The conference organization was more than fantastic and there were a lot of attendees in the conference sessions.

I had the chance to present “Developing Mobile Applications using JavaScript” in 25 March, the session had many attendees and I was really amazed by the energy, enthusiasm, and responsiveness of the attendees during the session.
screenshot

The session went great and I was glad to give a free copy of my JavaScript Mobile Application Development book to one of the attendees who answered a JavaScript quiz at the end of my session.
Books

I uploaded my session below:

In the conference, I really had the pleasure to work in the IBM Bluemix booth, it was really a very exciting experience for me.
IMG_8443

javaland5
IMG_8419

Finally, I would like to thank all the organizers of JavaLand conference for making the conference looks so great.
IMG_8429_2
IMG_8444
IMG_8372_2

Speaking in ApacheCon North America 2015

Screen Shot 2015-03-21 at 1.15.10 AM
@Monday, April 13 10:45 AM, I will be speaking in ApacheCon North America conference (that will be held from 13 April to 17 April @Austin, USA) about Apache Cordova under the session title “Apache Cordova In Action”. My session will be a practical one, it will discuss why there is a need for Hybrid mobile development, the current challenges of mobile development, and how using Apache Cordova can help in overcoming many of these technical challenges. It also highlights the best practices of using Apache Cordova with jQuery mobile. then, it demonstrates a real Cordova mobile app that works on three mobile platforms (Android, iOS, and Windows Phone 8.1).

Finally, I hope it will be an interesting session for all the mobile development passionate :):
https://apacheconna2015.sched.org/speaker/hazems

Personally, it is my first time to visit Austin, beside enjoying technical stuff, I would like to visit some tourist places there, any suggestions are welcome :)?

I really wish to see all of you there in ApacheCon North America 2015!

Book Review #3 “Very good introduction into Apache Cordova”

Attached below the review of Werner Punz (a Web and Mobile Development Expert) about the “JavaScript Mobile Application Development” book:

JavaScript Mobile Application Development Book

JavaScript Mobile Application Development Book

Very good introduction into Apache Cordova
“This book is a very good introduction into Apache Cordova. It basically guides you from the basics to the API integration, then to the most common APIs. After that you get an overview on how to unit test the application and how to write your own plugins and in the end you will get a guide to the implementation of a complex Cordova app.
The only thing I personally found missing was in the IDE section a description on how to integrated Cordova in the Android Studio instead of Eclipse, since Eclipse is on its way out in the Android area of programming.”

Reference:

http://www.amazon.com/review/R19ORB0DCN16PA/

The book in Amazon:

http://www.amazon.com/JavaScript-Mobile-Application-Development-Hazem/dp/1783554177/

Speaking in JavaLand Germany 2015

Speaker in JavaLand 2015

Speaker in JavaLand 2015

@Wednesday, March 25 04:00 PM, I will be speaking in JavaLand Germany conference (that will be held from 24 March to 26 March @Brühl, Germany) about “Developing Mobile Applications using JavaScript”. My session will be a practical one, I will discuss mobile apps development using JavaScript and Apache Cordova. My session will also include Apache Cordova Integration tips with jQuery mobile on the three popular mobile platforms (Android, iOS and Windows Phone 8).

There is a JavaScript quiz at the end of my session, the one who will be able to answer it correctly will have a free copy of my new JavaScript book:
Books

I hope it will be an interesting session for all the mobile development passionate :):
https://www.doag.org/konferenz/konferenzplaner/konferenzplaner_details.php?locS=0&id=483801&vid=491546

Personally, it is my first time to visit Brühl, Germany, beside enjoying technical stuff, I would like to visit some tourist places there, any suggestions are welcome :D?

I really wish to see all of you there in JavaLand Germany 2015!

Review #2 about the “JavaScript Mobile Application Development” Book

Attached below the review of Safwat about the “JavaScript Mobile Application Development” book:

JavaScript Mobile Application Development Book

JavaScript Mobile Application Development Book

Excellent
“The book is an easy and comprehensive guide to whoever is interested in multi platform mobile development with examples it shows the full life cycle of developing mobile cordova apps.”

Reference:

http://www.amazon.com/review/R2N5YBCWJK44V2/

The book in Amazon:

http://www.amazon.com/JavaScript-Mobile-Application-Development-Hazem/dp/1783554177/

Tip #3: Implementing the Back button behavior for Android and Windows Phone 8 Apps

If you use Apache Cordova for developing your Android and Windows Phone 8 mobile apps, you may need to exit the app when the user clicks on the back button on the app’s home page, and to navigate back when the user clicks the back button and the current page is not the home page.

Note that back button usually exists in Android and Windows Phone 8 devices.

In order to do implement this behavior, you can implement the “backbutton” event handler after the “deviceready” event is triggered. This is an example to implement this in jQuery mobile.

    var homePage = "appHome";
   
    //Handle back buttons decently for Android and Windows Phone 8 ...
    function onDeviceReady() {
        document.addEventListener("backbutton", function(e){
            if ($.mobile.activePage.is('#' + homePage)){
                e.preventDefault();
                navigator.app.exitApp();
            } else {
                history.back();
            }
        }, false);
    }

    $(document).ready(function() {
        document.addEventListener("deviceready", onDeviceReady, false); 
    });

Using navigator.app.exitApp(), you can exit your mobile app when the app user is in the home page. And using history.back(), you can navigate back to the previous page when the app user is in other pages.

Reference:

“JavaScript Mobile Application Development” Book:

Back from JMaghreb 2014

JMaghreb 2014
I just get back from JMaghreb 2014 that was held in Casablanca, Morocco 05-06 November 2014. The conference organization was fantastic and there were a lot of attendees in the conference sessions.
Picture1
I had the chance to present “Developing JavaScript Mobile Apps Using Apache Cordova” in 06 November, the session had many attendees and I was really amazed by the energy, enthusiasm, and responsiveness of the attendees during the session.
Picture2
Picture3
Picture3

The session went great and I was glad to give a copy of my “JavaScript Mobile Application Development” book to one of the attendees who answered a JavaScript quiz at the end of my session.
Books

I uploaded my session below: