I created a web application on Openshift using Spring MVC and MySQL.
Now I want to go mobile for this application. I want to publish the same application as a mobile app (Android mainly). Primarily, this mobile version should play with HttpPost/Webservice security authorisation too.
I know Pivotal has a Spring Mobile project which helps create a mobile site for the same application (with more sophistication like spring form tags and all).
On the other hand, Phonegap can create a cross-platform mobile app with the help of HTML5 and CSS.
My questions are:
Some pros and cons or any links for reference would be helpful.
First, let me give you a warning. While this is a constructive question (better than average questions asked here), people usually like questions from users who spent some time searching for an answer themselves. I will explain this part later.
Phonegap (Cordova) and Spring Mobile are two completely different frameworks, they serve completely different purposes. You could have found that Googling.
Phonegap (Cordova) is a wrapper framework used for hybrid mobile app creating. Your HTML/CSS/JavaScript code is wrapped into native shell and you can use JavaScript <-> Native bridge code to access native phone functionality. Though you can use it as it is with vanilla JavaScript, it is often used with other mobile frameworks like jQuery Mobile, Sencha Touch, or Kendo UI.
Spring Mobile is an extension to Spring MVC that aims to simplify the development of mobile web applications. Spring Mobile is a framework that provides capabilities to detect the type of device making a request to your Spring web site and serve alternative views based on that device.
Everything depends what are you going to do. Hybrid mobile applications are usually done with separate client and server side code. Communication is done using AJAX. Because of this I would skip Spring Mobile and use only Spring as a RESTful web service framework. I personally prefer Play framework, but that's just me.
Of course, you would still need to choose a client-side JavaScript framework, or you can create everything from scratch. I would advise you to use prebuilt frameworks like mentioned jQuery Mobile.
If you really want to use Spring Mobile, it can still be done. Phonegap can be used to wrap remote web sites into mobile applications. This approach has several downsides. The application is useless if your site is down and you will not be able to create iOS application because these kinds of applications are rejected on first sight.