When developing mobile applications, you have to run them on different devices to see how they look, feel and function. DevExtreme comes with tools that allow you to test your application on devices.
Here they are.
Press F5 to run a DevExtreme application being implemented in Visual Studio. The simulator will run. It will show the application in different devices.
Use the following capabilities of the simulator to test your application.
Choose a device
Choose between the Portrait or Landscape orientation
Choose between the full or half sized device
Scan the QRCode to run the application on a real device (read below).
NOTE: Some behavior of widgets in the simulator may differ from the one on a real device. This is because the simulator just emulates a device, but a desktop browser actually runs the application. So some device-specific behavior is not accessible in the simulator. For instance, if native scrolling is set, a simulated scrolling is applied in the simulator. To test such device-specific features, run your application on a device.
The simulator runs to show your application because the DevExtreme project has the Run in simulator property set to true by default. Right-click the project with your application and switch to the Debug tab in the invoked pane. Here you can see the Simulator section and the Run in simulator property in it. If you uncheck this property, the application will run in the browser as a web application. This mode is useful to test the URIs that are generated when navigating between views.
As you can see, you can set the default device and orientation for the simulator using project properties.
Run in Device Browser
Run the application in the simulator as described above. The simulator provides a QR Code. Scan it by the device on which you are going to test the application. The QR Code represents a link to your application provided by the dxproxi service. This link is valid only while the Visual Studio debugger is running. As a result, you can load the application in the device's browser.
Run on Device
Use the Courier application to test an app on a device as a real-world application, rather than as a website. Courier hosts your DevExtreme web app and allows you to experience how your mobile web app will behave on a mobile device once deployed. The following list explains how to use the DevExtreme Courier.
Run your application in a Visual Studio debugger and locate the QR code in the simulator.
From the Courier application, scan the QR Code using the Scan button. The QR code represents a link to your application. This link is valid only while the Visual Studio debugger is running.
This will load your application on your device. Test the application. Take a note of the Courier menu that is available while testing an application.
The great thing about using this approach is that you don't have to build native packages every time you test your application on a device.
Use Hardware Functions
Since the application's native packages are prepared using the PhoneGap Build, you can utilize the PhoneGap API to access the device's hardware features within the application. Check out the PhoneGap API Reference to see which device capabilities you can leverage. The Courier application allows you to test these functions without building a native package.
Download and include the PhoneGap library (specific to the device) into the application to be tested. Currently, version 2.3.0 is supported.
Reference it in the index.html file.HTML
The android version of the Courier application has the following permissions for the PhoneGap API.
The following plugins are added to the iOS version of the Courier application.
- Debug Console
Check out the DevExtreme device access examples article to see sample DevExtreme applications that utilize the PhoneGap API.