Desigining a mobile app for an existing Spring MVC application (Spring Mobile or Phonegap)
Asked Answered
P

2

6

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:

  • Is it worth it to put my effort on Phonegap or Spring Mobile?
  • If I choose Spring Mobile, how do I publish a mobile app in the Android Play store?

Some pros and cons or any links for reference would be helpful.

Porscheporsena answered 17/5, 2014 at 16:48 Comment(0)
Z
15

Intro

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.

Differences

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.

Effort

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 really want to use Spring 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.

Best course of action

  • Separate client and server side code
  • Choose a client side mobile JavaScript framework.
  • Use Spring as RESTful web service, or any other RESTful framework such as Play.
  • Wrap your client side code into Phonegap (Cordova)
  • Publish as Android, iPhone application

Links

  1. How to create jQuery Mobile application with Phonegap | Mac version
  2. Sencha Touch vs jQuery Mobile
  3. Secrets of a good jQuery Mobile page architecture
  4. If you already have experience with jQuery, learn the differences between jQuery and jQuery Mobile
Zoe answered 17/5, 2014 at 17:50 Comment(2)
that was nicely explained in the prespective of application desigining. Thanks...Porscheporsena
so are you saying that i should remove view part (.jsp ) from spring application ? and keep all that separatly using htmlDressage
S
0

http://projects.spring.io/spring-android/

Spring for Android is a framework that is designed to provide components of the Spring family of projects for use in Android apps. Like all Spring projects, the real power of Spring for Android is found in how easily it can be extended.

Sink answered 25/6, 2017 at 7:13 Comment(1)
question also: If I choose Spring Mobile, how do I publish a mobile app in the Android Play store?Logy

© 2022 - 2024 — McMap. All rights reserved.