Mimicking mobile counterparts

Several years ago I had a conversation with a cool guy working at Opera, Charles McCathieNevile. He told me in mixed English/Italian, "Mobile is tutto casino!" (Mobile is total chaos). This was true in 2004 and it's still just as true today due to the high device fragmentation and difference in screen resolutions.

In order to emulate devices you can use several tools including the ones provided by the major SDK vendors. Usually these tools are time-consuming and sometimes not easy to configure; for this reason, I strongly encourage you to use the web as your development and debugging platform.

One of the greatest advantages to using PhoneGap is that you can use web standards and thus avoid having to continuously test the app in the browser emulator that comes with the SDK of each mobile platform. It doesn't mean that you don't need to emulate the app at all or that you don't have to test it in a real device, but you can safely assume that it's enough to test the UI and the main user interactions inside your desktop browser.

There is a very interesting open source project called Ripple that lets you emulate several mobile platforms in your browser. Unfortunately, at the time of writing, it's available only for Chrome. You can get the Ripple extension for Chrome at https://chrome.google.com/webstore/detail/ripple-emulator-beta/geelfhphabnejjhdalkjhgipohgpdnoc; after you install the extension, you can access it from the top right of your Chrome installation.

Mimicking mobile counterparts

By clicking on the Ripple icon, the extension starts to emulate one of the available platforms, including Mobile Web, PhoneGap, and Blackberry 10 Web Works. The Mobile Web platform offers several devices to emulate with skins and different orientations.

When selecting the PhoneGap platform, you can emulate the device and test in a familiar browser environment the app features and interactions with the Apache Cordova framework.

Mimicking mobile counterparts

All the relevant device information and settings are available in the same window you can use to debug your app.

On the left side you can select the device, its orientation, get detailed information about the device, and simulate the accelerometer. On the right side it's possible to set up the network settings, the lag, the geo location information, and play with events. You can select the event you want to emulate and then fire it; in this way you can easily simulate device-specific events such as the pressure of the back button or of the home button. If you have an appropriate XML configuration file in the app folder, you can get a graphical representation of it inside Ripple.

Have a go hero – improve the "Hello World" app

Review the instruction provided to add interactivity to the "Hello World" app and make the necessary changes to open a modal window when the app starts.

Pop quiz – getting started with mobile apps

Q1. Is it possible to debug an iOS app installed on a device using iWebInspector?

  1. It's not possible at all.
  2. Yes, it's the main purpose of this software.
  3. Yes, it's the main purpose of this software but you have to make some changes in the source code.

Q2. Which is the main advantage in using Adobe Edge Inspect and weinre together?

  1. There is no particular advantage.
  2. The app source code is executed faster.
  3. You can simultaneously debug multiple devices running on the same app.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.2.122