O'Reilly logo

PhoneGap 4 Mobile Application Development Cookbook by Zainul Setyo Pamungkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a custom submenu

Your application may include an option for users to update or change settings, or perhaps the ability to truly exit the application gracefully by closing down all services and storing state or data.

How to do it...

In this recipe, we will create a simple application that interacts with the device's native menu button to create a sliding submenu:

  1. Firstly, create a new PhoneGap project named submenu by running the following command:
    phonegap create submenu com.myapp.submenu submenu
    
  2. Add a devices platform. You can choose to use Android as follows:
    cordova platform add android
    
  3. Open www/index.html and let's clean up unnecessary elements. We'll also manipulate the DOM elements, so include a reference to the xui.js file within ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required