简体   繁体   中英

Convert bootstrap mobile site to phonegap app

I have an MVC4 web application using bootstrap 3 and jQuery. The mobile design is exactly what we need but I want to create a native mobile application which replicates the mobile site like for like. Is there any way to convert a bootstrap site to a Phonegap application as I know this is based on HTML and JS?

I was wondering if there was even any way of using an Iframe like approach where the app would load the mobile site into? The only thing we want to use a native application for is push alerts and marketing abilities.

Any guidance would be appreciated.

Thanks in advance

If your MVC app is a SPA (single page app) that uses Ajax extensively to communicate with the back-end, you might be lucky.

First, since MVC is server-side your gonna have to generate static HTML pages to use in your Cordova app ..this shouldn't be a problem, just go to each page and save the source-code as a HTML file.

Also your communication will need to be Ajax based .. jsonP, will be a lot easier to get working, but you can always configure cross domain communication.

And then you need to reorganize all your pages and stuff to be compatible with the way Cordova organizes directories and stuff.

But basically ..you just generate static pages, make sure Ajax works, and reorganize directory structure and the likes.

Will probably be a bit more complicated, and you'll have to think of things like authentication maybe, and rework some code here and there, but it's definitely not impossible to do.

If you can get a dump of your site to work off a usb drive (pure html, js, ajax), then you can make it into a Cordova app :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM