How do I create multiple screens / views using phoneGap?

I am creating a reading app and want to try using phoneGap for the first time. I like HTML, CSS and JS, but I don't have much experience with xCode. Let's say that for this home screen reader app I have a button. When the user clicks on the button, I would like it to be redirected to another screen / view. Is this the right thing to do to create a link on the homepage and when they click on it, redirect them to a different view? I don't think I need another model or controller, but I'm not sure.

+3


source to share


1 answer


The best way to implement multiple "views" in a Phonegap application is to use the Single Page Application design pattern.

Phonegap apps are native apps that set native webview as the default and ONLY native view for the app. While you can use plugins to implement other types of native views, the underlying Phonegap application only uses one native view.

Either way, you can program HTML / CSS / JS in your web browser.



If you are unfamiliar with the single page web page design pattern, this is the basic explanation:

  • One single html file
  • Use containers div

    with specific IDs to show and hide content
  • Ajax requests are used to manipulate data in the application (so no page refresh is required).
+7


source







All Articles