3

I've created one Jquery mobile mvc4 web application using webapi support, which is well looking site in almost all mobile device as well. but now i want to convert this MVC application to phonegap to use mobile feature supports like camera,accelerometer,sound etc..

What is the best way to start converting it to phonegap, will i need to create SOAP based web-Service for webapi code. I've searched on web regarding that but not getting enough help,support.

am i going right way ? or need something else ?

any help is appreciable.

Milan Mendpara
  • 3,091
  • 4
  • 40
  • 60
  • If your client app will still need to talk to a server outside, you can keep webapi in the server. But if your solution is entirely client side, what for do you need a webservice? – Eduardo Molteni Jan 18 '13 at 14:37

1 Answers1

0

Okay so in order to convert it first you are going to have to know Objective-C because that is the only language that is allowed on the iPhone but assuming you know that here are the steps you can take in making a conversion like that.

*Make sure that any outside information the application retrieves is either a) In a REST api you can use the new WebApi in fact I am using it right now and it works like a charm. Or b) Any script src= tags are converted to local files on disk. So if you had script src="My awesome css" make that file a local file on the phone.

*Next take any views and decide where all of their API calling code is. Make not of that and then get ready to be moving that code.

*Once that is all recorded startup a phonegap project and get rid of any extra .index files or anything you don't need.

*Create your applications PhoneGap plugin. Have the OBjective-C plugin make any API calls that you will be needing and then make the javascript plugin match the objective-C function.

*Where you had any calls in your previous views, make those now call the cordova (PhoneGap) plugin.

This is a very brief roadmap to get started.

Once the tediousness is over it is worth it though. I moved my IOS application to Android and they transfer pretty easy. Cheers

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Tony
  • 4,609
  • 2
  • 22
  • 32