This method tells intel.xdk to size down an application for a smaller device.
This method tells intel.xdk to size down an application for a smaller device. Use this method in your application’s intel.xdk.device.ready event to size a larger application down for use on a smaller device than it was originally designed for.
This method expects two values, the first is the width the application is designed for in portrait orientation, and the second is the width the application is designed for in landscape orientation.
Unfortunately, several newer Android devices have changed their version of the Android operating system to a point that this command does not work. At this point, the list of devices that are known to ignore this functionality include:
HTC EVO 4G
HTC Evolution 4G
- Apple iOS
- Google Android
- Microsoft Windows 8 - BETA
- Microsoft Windows Phone 8 - BETA
- widthPortrait: The width to set the device to display at in pixels when the device is in portrait orientation.
- widthLandscape: The width to set the device to display at in pixels when the device is in landscape orientation.
//use intel.xdk viewport to allow this iPad-designed application to size down to an iPhone //or an Android handset device with a resolution lower than 1024x768. var iPortraitWidth=768; var iLandscapeWidth=1024; intel.xdk.display.useViewport(iPortraitWidth,iLandscapeWidth);