0

We have a ASP.NET MVC website built that's optimized for the Mobile and Tablet devices using Responsive design.

We would like to reuse/package these views into a Phonegap application for creating iOS/Android/Windows apps.

Our initial thought was to have skeleton views in the Phonegap project and serve the content (including markup) remotely from the ASP.NET MVC website. However, my understanding is that Apple may not approve an app with such an architecture.

Any thoughts on how to design the Phonegap app is really appreciated.

DotnetDude
  • 11,617
  • 35
  • 100
  • 158

2 Answers2

1

As you hint at, Apple generally discourages websites masquerading as native apps via thin shells. See this SO for some discussion:

Does Apple reject "mobile web shell" applications?

For the current app I am working on, I do all my development by serving through Apache and testing in Chrome. I test on device by wrapping the same set of html/cs/js files with Cordova build process and pushing to device. The only reason that wouldn't work for you to is you must have a bunch of server side logic and conditional rendering of your views.

So either you:

1) Just go for it and try to submit a simple native wrapped website and very well may get approved no problem

OR

2) My recommendation is to do a little reworking of your view designs/interactions such as including a native-mobile-app style navbar, etc. so that the experience is more similar to an app than a web site. Then with your new client/app Views, swap out the server side Controller/Model interactions with a Rest/JSON api.

For example, currently you have something like this:

//Server side 
class mainController
{
  void fooAction()
  {
    string bar = getModelThatIncludesBar().bar;
    ...
    renderView($bar, 'fooView');
  }
}

Instead, more like this:

// Client side, poor mans MVC
bar = useAjaxToGetModelThatIncludesBar().bar;  // pretend this is synchronous :)
...
fooViewElementThatNeedsBarData.innerHtml = bar

Edit: I have drastically simplified things here to try to distill it down to the basic two choices I see. Message me or whatever if you want to chat about it.

Community
  • 1
  • 1
SoldierOfFortran
  • 782
  • 1
  • 7
  • 14
0

My suggestion is you need to separate your client and server side language. Then convert your server side language into web service either SOAP or REST so your client side can send and receive data from your server. Phonegap is allowed client side language only.

Nurdin
  • 23,382
  • 43
  • 130
  • 308