5. How to use (GPS Sensors)
GenymotionManager genymotion =
GenymotionManager.getGenymotionManager(ctx);
// Position to reykjavik (257km away))
Log.d(GpsSampleFragment.TAG, "Force position to Reykjavik");
genymotion.getGps()
.setLatitude(64.13367829)
.setLongitude(-21.8964386);
// Then ensure warning is hidden
Assert.assertEquals(tvWarning.getVisibility(), View.GONE);
// Position near Dalvik
Log.d(GpsSampleFragment.TAG, "Force position near Dalvik");
genymotion.getGps()
.setLatitude(65.9446)
.setLongitude(-18.35744619);
// Ensure warning is shown
Assert.assertEquals(tvWarning.getVisibility(), View.VISIBLE);
6. How to use (Battery Status)
GenymotionManager genymotion =
GenymotionManager.getGenymotionManager(getActivity());
// Change battery level and charging status
Log.d(BatterySampleFragment.TAG, "Force full battery + charging");
genymotion.getBattery()
.setLevel(100)
.setStatus(Battery.Status.CHARGING);
// Then ensure warning is hidden
Assert.assertEquals(tvWarning.getVisibility(), View.GONE);
// Change battery level and charging status
Log.d(BatterySampleFragment.TAG, "Force low battery");
genymotion.getBattery()
.setLevel(3)
.setStatus(Battery.Status.DISCHARGING);
// Then ensure warning is visible
Assert.assertEquals(tvWarning.getVisibility(), View.VISIBLE);
// set battery mode back to HOST
genymotion.getBattery().setMode(Battery.Mode.HOST);
7. Excursus
• Need to login
• Free
• For personal use only
• Business
• €24.99, per month,per user
• Java API
• need to emulate sensors