MyEclipse Mobile Web Simulator Guide (ii)

Source: Internet
Author: User

In the Mobile Web Simulator Guide (i) article, the small section shows you how to start the Web emulator, how to set up the emulator configuration, and how to set up the operating system version. Next, we'll show you more about the MyEclipse Mobile Web Simulator, Welcome to the tasting!

4. Emulation Cordova API

The PhoneGap build service uses the PhoneGap runtime and APIs to create a hybrid application for your mobile project. The runtime includes JavaScript's cordova.js APIwhile also providing you with iOS and Android apps. Visit Apache Cordova Project for more project information and API documentation.

4.1 Testing with an accelerometer

The acceleration sensor tests the direction, roll, pitch, and deflection speed of the device. Shaking the button to test how the device shakes affects your application. Use an accelerometer to simulate motion to provide information for applications that use the Accelerometer API.

(1) Open Accelerometer panel

(2) Drag the 3D image of the device to change the degree of rotation, hold down the SHIFT key to adjust the alpha axis rotation. If your application uses the accelerometer API to respond to these actions on the device, you can preview the effects of these motions.

Change the rotation of the shaft

(3) Click Shake to simulate the device shaking.

4.2 test battery charge Change

By simulating the power state of various batteries, you can test the impact of battery power on your application. When the device is plugged in, you need to test the impact of different power percentages on your application. Analog battery power provides information for applications that use the events API.

(1) Open the Power Manger panel, and if your application uses the events API to respond to different stages of battery power, simulate the application below.

(2) Select the Plugged in check box to simulate the plugged-in power supply, which simulates the gradual increase in battery charge.

Battery Charging Simulation

(3) test different battery power by changing the percentage of battery charge.

Set the battery charge percentage

(4) Click Simulate Low battery to set the battery charge to 0, and also set a starting scale and increase speed.

Configuring a lower charge simulation4.3 testing geographic changes

The geolocation panel allows you to test changes in the physical location of the device, including the movement of the path. The simulation of the motion route provides geolocation information for applications that use the Geolocation API.

(1) Open the Geolocation panel.

(2) Use the map to find the coordinate position you want to mark or enter.

(3) Click Marker, then click on the map to mark the location. To create a route, mark each point on the route, and then double-click the map to complete the route.

Map a geographic route

(4) Click Play to draw the route. If your application uses the Geolocation API to respond to geo-location information, you can preview the impact of location changes on your application.

Analog route4.4 Test Platform Events

By simulating platform events, you can test the impact of using the events API on your application.

(1) Open the Platform events panel.

(2) Select an event that you want to test, and then click Fire Event.

Platform event emulation5. Automatic reload of emulator file changes

During development, changes on the emulator can be synced to your application, so you can open and test your code after you leave the emulator. Click the Toggle Auto-reload button on the toolbar to synchronize automatically with the emulator.

6. Debug and test the application

The mobile Web Simulator leverages Chrome's development tools to debug and detect your applications. Simply right-click the display screen in the Device Emulator and select the development tool that invokes the instrumentation element.

Learn more about chrome development tools:

    • Guide
    • Video

MyEclipse Mobile Web Simulator Guide (ii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.