2

I have to develop a phone application on every platform so I thought of using phonegap. Seems pretty nice.

I have a web application coded in classic Asp and it's this webApplication that I need to strip down to be a phone app.

At first I thought it will be simple, my classic Asp render some html so phonegap is able to put it as an app.

But it's not that simple, because in my asp I have some code that is rendered server side, I've talked to some who tell me that some html could call the asp pages and this html could be used in phonegap. Don't think it's possible ...

Well if someone could help me here, maybe i've said something wrong in my little text don't hesitate to correct me :)

My solution (I think) : code some webServices in asp.net that will use the same database as my asp classic web application. And some html and jquery will call the webservices and those html and jquery will go trough phoneGap

What is the best way to transfer and asp classic web app to a multiplatform phone app ?

EDIT : After looking everywhere, effectively phonegap can't use asp pages. So I'm questionning myself should I do a mobile website or a mobile app with webservices?

EDIT 2: I'm going for an asp.net mobile website, someone have a great way to do this, I've seen the answer proposing mvc... more details?

1
  • "a mobile website" and "a mobile app with webservices" are not mutually exclusive. Your current app can most likely be segmented into separate components and responsibilities, once identified each can be factored into a service. Ideally these services get moved into a more modern framework, but if they're simple enough then classic asp will work fine. This collection of services can be used to drive your classic asp app, a mobile app, and a mobile-centric site. It may seem a little hand wavy, but as pointed out below, separating the UI from your business functionality is a good place to start.
    – nerraga
    Mar 1, 2012 at 17:35

6 Answers 6

3

You are on the correct path in wanting to use PhoneGap to create a multi-platform phone app via HTML5, and some mobile framework like jQuery Mobile.

Yes, you can leverage the power of ASP.NET to serve up your data but I wouldn't create an asmx web service. A SOAP-based service serving up XML may be too fat/overkill for your mobile web app. Instead, you may want to investigate using JSON which is more lightweight (remember, bandwidth is a concern with mobile apps). One can rapidly create an API to serve up your JSON data via the new ASP.NET Web API. With your API exposed, you can make an ajax call from your html page to retrieve the JSON and bind it using jQuery.

The bonus to using the ASP.NET Web API would be when it's time to upgrade that classic ASP web site you have there, you could leverage the API you already created.

1

I'd really consider rewriting the website using Mvc.Net. You may want to consider using the iUI for the views.

It will be much cheaper long-term to use modern technology than trying to shoe-horn legacy code into new usage areas.

1

It looks like you've made up your mind to go with a webapp instead of native apps via PhoneGap. I would recommend that you pick up this book by Jonathan Stark. It's very short - shorter than it should be when it gets into using PhoneGap - and although it focuses on iPhone development, much of the content is applicable to most mobile devices. The first few chapters give a great introduction on developing attractive, responsive, highly usable web apps for mobile devices. If you familiarize yourself with jQuery and jQTouch you can get some really great looking apps with relatively little effort, regardless of the server side technology you go with.

0

So i'm questionning myself should I do a mobile website or a mobile app with webservices ?

The answer to that question is always mobile website... given an outdated website that the client is wanting duplicate functionality in an app.

Do the work to convert the website or at least the portions that you need to use ajax and webservices. Once you have that in place pulling the same data to place in a mobile app will be easy... you've already done it once.

So my approach would be to convert this dataview into two separate elements Data and View. You can probably even keep the current asp pages without a lot of modification to the code since you can still call these web-service functions the same way as before in your asp code.

0

Well, if you really want to reuse your existing webpage you can do the following.

Create a index.html and the body.onload event, redirect to your webpage. Then build this index.html with phonegapbuild, and you will get your "native" application that simply loads your existing webpage.

2
  • That app would get rejected at least by Apple, not sure about other app store rules.
    – OlliM
    Mar 2, 2012 at 16:56
  • Oops, thanks for the info, I'm preparing something like this right now, no idea apple would reject it.
    – Alfz
    Mar 3, 2012 at 10:42
0

If you want to serve mobile users, you have 2 main options:

  • Create a mobile website. You can render html on the server all you want, no javascript programming needed. Maybe look into jQuery mobile, it can be a cheap and easy way to make the website better for mobile users.

  • Create a html web app (and package it inside PhoneGap if you want). This is basically a html page which loads just the data from the server in json format and updates the page contents dynamically with javascript. You need good js skills to implement this, you're server is just a REST api that server json - technology can be anything, at least asp.net mvc makes it easy. On the client side you'll want to use some good structuring frameworks, backbone.js ( http://documentcloud.github.com/backbone/ ) is a good option. Check out http://m.linkedin.com for an example of what a mobile web app can be.

  • 3rd hidden option: just create a native app for each platform, that'll get you the best user experience.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.