Page 1 of 1

battery level, memory and Data consumption

Posted: Sun Dec 07, 2014 12:12 pm
by roey.oren
hi all,

is there any way to get by 'user code' the following things:
1. current battery level
2. memory
3. data consumption

i want to be able to test if my application is using too much from one of the params above.


10x.

Re: battery level, memory and Data consumption

Posted: Tue Dec 09, 2014 2:55 pm
by Support Team
Hi roey.oren,

You can get the information about your device by using the following lines of code:

Code: Select all

var app = repo.AndroidApp.Self.As<AndroidApp>();
var info = app.GetDeviceInfo();
Report.Info("Battery level: ",info.BatteryLevelPercent);
It is also possible to get other device information.
Please find more information about Non-UI testing on Android devices in our User Guide in this section.

Regards,
Markus (S)