Phonegap is not ready yet.

This may sound like not true, but actually Phonegap(Cordova) is not ready yet for the prime-time. The point is something or the other will always get in your way if you try to do a little more than basic UI.
It’s a pity to see that Phonegap has reached a version number of 3.3, still feels uncomfortable to work with.
While for a basic static page navigation it may be a solution to go for, for mobile, but think twice if the UI is becoming even a little more than basic.

A simple childbrowser (inAppBrowser) is failing in the current version and I found people are finding workarounds or solutions to fix this. So the point is not that its fixable but its not dependable.
Again, from version 3.0.0 on-wards, one need to have an internet connection to start building! Well, its NPM and NodeJS, I know, but its not comfortable at all rather confusing.

The best Phonegap version as I know is 2.8.0. Its the stable of all.
If at all you are trying to develop on Phonegap, stick to this version(2.8.0) until they release a stable version again.

Happy coding.

My first Tizen store approved game

Its a pleasing experience to get something on the stores, which are more stricter or unknown. Being said that, it is exciting when something is out of the doors from those stores. It was the same feeling for me when my first Apple store approval has happened.
So the game which was written for iOS devices is modified to fit in all the platforms and released. The original “catch them all” game is ported to all the platforms with the help of OpenFL and HAXE. The name has been changed to “Catch Them All E”, “E” is for everywhere.
First, it was for the Tizen App Store and the wait. Its not much but have to wait for 3 days and finally its approved and available in the Store. Thats such a nice experience and could not have been possible without Joshua.

Well, then I did some modifications and ported it to HTML5. Though, OpenFL directly provides conversion, there are still things to consider while developing for different platforms. This version is available here.

Not too far behind, I ported it to iOS and submitted Apple store. Well it took 7 days and its on the Apple App store too.

I must say, without OpenFL and HAXE I could not have achieved all this.

Social plugin for Phonegap 2.6 and up

In my search to have the iOS 6 default social sharing plugin, I landed up at this page. While everything seems right for this plugin, I somehow faced some problems in the UX. Thought would look a little deeper into it and found that this plugin relies upon the old plugin architecture of Phonegap. It still works, but then if it does not, you know know why.
Now to implement social sharing in my project, I have done a quick round of update to the plugin. Its working in my phonegap version 2.6. And that should work on Phonegap 3 as well, as the new plugin implementation has not changed after version 2.0.
Here is the github link for the new plugin.
While currently this plugin only shares the link and the message, you have to send a third parameter as an empty string for the image parameter. I will do the code cleanup and fix as I get some time to look into it. For the time being, its ready to use in new Phonegap versions.

Happy coding :)

OpenFL is here

The NME or haxenme project is taking a mature shape. The library is now known as OpenFL, which can be assumed as the successor of NME. Actully, OpenFL does use NME behind the scenes.
So, if you are working on NME projects for sometime now, its time to shift to OpenFL.
A true cross-platform library over a true cross-platform language ie; HAXE.
The new site is up at http://www.openfl.org
The other links are as below
Download home
API documentation

The main difference one would see, by coming from NME is most of the packages are now in “flash” not the default “nme”. This is to make it consistent with flash API and at the same time, the add-on APIs are on “openfl” or in the respective packages.

Happy HAXE ing

Phonegap ( cordova ) and iOS longtap

This is perhaps the most significant effect of using a webview for iOS development. When working with Phonegap(cordova) which uses WebView, the user gets a longtap event as it use to on a web browser. All sort of long tap menus will come up in an application using Phonegap (ex : select, copy etc).
To suppress these unwanted menus on a native application, which uses Phonegap(Cordova), there are a number of options found throughout the internet, but the one which worked for me is a style declaration as below.

/* Disabling the default iOS bevaviour of copy-paste on long tap */
*:not(input):not(textarea) {
	-webkit-user-select: none; /* disable selection/Copy of UIWebView */
    -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */

}

Happy coding :)

Cordova(Phonegap), jQueryMobile and making a popup

This may seem obvious to make a pop-up with jQuerymobile with its popup API, but its a little more than just calling the api.
The problem is closing the popup. When working in a single page application in jQuerymobile and phonegap, the closing of the popup will take you to different jQueryMobile pages depending upon your setup.
The solution is to make the popup ready to be open just at the current page and while closing it should not make the application go to different pages. The trick is to while initialising the popup widget, initialise it with “{history: false}”, and thats all.
Here is a popup created with jQueryMobile API.

My PopUp

Title

Save Cancel

Here is the javascript code to initialise the widget and open it.

//making a popup which will not take you back to the previous page.
$('#popupDialog').popup({history: false});//awesomeness
$('#popupDialog').popup('open');

Happy coding :)

Settings Check for Apple Push Notification

While developing an iOS application with Push Notification, there might be a time, one comes across the following error message.

- no valid 'aps-environment' entitlement string found for application

Well, that means the APN (Apple Push Notification) server is denying to register your application. This situation arises when the signing certificate for the application differs from the one you generated for Push Notification.

The fix is to select the proper certificate in the settings for the project.
codeSigningCert

Happy coding.

Cordova (Phonegap) , alert message.

This might seem, very easy task. But then while making a customisable alert message, one need to think as to how to do it. While working on Cordova(phonegap), one can easily assume and which is true is the javascript alert script.

alert("Hello!");

The javascript alert will work. Then we do not have a customisation option except for the message. The solution Cordova provides is a function with the name as alert. The syntax is as below.

navigator.notification.alert(message, alertCallback, [title], [buttonName]);

In the very basic form, where one need to have a specific title, message and button name, the code I use is

navigator.notification.alert("My message", undefined,"My Alert", "ok");

Thats the simplest kind and if one need more generic, wrap the whole thing inside one of your own custom function as example below.

function showAlertWithTitle(title,message){
	navigator.notification.alert(message, undefined,title, "ok");
}

Hope coding.

iOS notifications from developer's view

Notifications in iOS devices such as iPhone and iPad are a way to tell the user about some important thing has happened. From a users perspective it is just a message reminding thing.
For a developer, one must note the difference between the type of notifications. Well, to be at its simplest form, there re two kinds of notifications. One is local notification and one is push notification (think this as server is telling the iOS device to show the notification).
Well, why should I bother about these two as a developer ?! That might be the question if you are doing the notification programming in iOS for the first time. The answer is, iOS gives very certain instructions as to what and how to do the notification implementation.
Here is the official link to the Apple documentation.

There are only three types of UX for either of the notification (local or push). They are
1. Displaying an alert message
2. Badge the application icon
3. Play a sound

The settings to control these notification types are located in the global settings menu of iOS. Remember it, the settings of all the applications, which use notifications are at one place in all iOS devices and that is the “settings” menu.
Well, another subtle but important option is “notification center”. Its the place, where all the notifications from all the applications reside. The settings, whether to keep the “notification” in “notification center” or not is also inside the global “settings” menu. Being a developer, the good thing about Apple and for that matter the iOS is, one does not code for adding settings item for notifications. It is done automatically for you by the OS (Operating System). All this magic happens, when you as a developer, makes a “certificate” for the application in Apple developer’s portal for the application saying “this application used notification”. Simple and elegant.

The major difference from developer’s point, between local notification and push notification is local notification is scheduled. That means, we can not show a notification if certain things happen in the application. Once application goes to background, we lost power as a developer to do anything at all with that application. So local notifications can only be scheduled for a normal application (for music streaming applications we do get a little more control). If at all we have to notify the user on certain data change, we have to fall back to push notifications. This one is pushed by Apple Push Notification server. Though, there are third party services which can push data, but all of the data push to an users device route through Apple Push Notification server.
The last thing to note is Push notifications are created on the server and pushed to the device, at max, upon tapping the notification, the underlying application can be brought to foreground and thats all one can do as a developer.

Tips for phonegap developers :
1. There are two different official plugins (one for local and one push notification), but then these plugins are not always up to date or might not support your version of the phonegap(cordova), do some reading before you settle down with the plugins.
2. The third party service providers (for push notification) might have their own plugins (a lot of do have), its better to use their plugins if you are developing upon their infrastructure.

Tip for push notification :
Make sure you are creating proper certificate with “push notification service” enabled at “Apple developer portal” and then using a profile on XCode which uses that certificate.

Some push notification servers are
1. http://www.pushwoosh.com
2. http://www.xtify.com
3. https://pushwizard.com

Would like to know if anything I am missing here, I am putting things here as I am doing hands-on with this iOS “notifications” for the first time.

Java for iOS and Android

It seems that its a long wait for the Java developers. But the good news is the wait is over. finally we have an SDK which expects us to write in Java and deploy our application into iOS and Android.
Codename One is an opensource SDK, library, deployment system, all in all a platform to develop for mobile platforms.
The short story is I tried to put a simple helloworld application to put in my android phone and it took only 30 minutes to make my development environment ready to deploy to the phone.
Well, the whole of the SDK is just a plugin to Eclipse or Netbeans, depends upon your preferred IDE of choice. Thats all to it. What a developer gets, is a GUI builder, a simulator, the SDK and the complete framework. Now go straight into the IDE and start building the application you want to do with the Java skills. Finally decide where you want to put it, iOS or Android, select the option and push it to the cloud, so that Codename One cloud will make the build for you to deploy into the device. Thats a no brainer deployment and code migration.
What all that means is, one is very well ready to develop iOS applications in windows machine. A very nice and well thought of SDK and framework.

Happy Coding.