Let the DeviceCapabilities demo support different resolution

The original implementation does not consider supporting different
resolution. This patch will support and has been tested in many phones
and emulators.