Activity.getActivityInfo() on FR45 mostly not working as expected

I tested Activity.getActivityInfo() in the simulator and on my fr45.
It appears that only altitude and currentLocationAccuracy are recognized by my device.
The simulator guesses that Calories works but not LocationAccuracy.
//Capital letters means it's not null.  Probably a bad way to check, but it's simple sanity check.
var info = Activity.getActivityInfo();
// checks += info.ambientPressure ? "P" : "p"; //error API Level 2.4.0
checks += info.altitude ? "A" : "a";
checks += info.averageHeartRate ? "A" : "a";
// checks += info.averagePower ? "P" : "p"; //  Error: Symbol Not Found Error API Level 1.0.0
checks += info.calories ? "C" : "c";
checks += info.currentHeading ? "C" : "c";
checks += info.currentHeartRate ? "H" : "h";
checks += info.currentLocationAccuracy ? "9" : "l";
// checks += info.currentOxygenSaturation ? "O" : "o"; // API Level 3.2.0
// checks += info.currentPower ? "P" : "p"; // Error: Symbol Not Found Error, API Level 1.0.0
checks += info.elapsedDistance ? "D" : "d";
// checks += info.energyExpenditure ? "E" : "e"; // Error: Symbol Not Found Error, API Level 1.2.0
View.findDrawableById("Readings").setText( checks );
Using 4.0.7 on Linux to build and 4.1.0B1 to simulate
Using the following to compile and run: monkeyc -d fr45 -f monkey.jungle -o dw.prg -y ../devkey/developer_key && monkeydo dw.prg fr45
Using the following to build with vscode 1.63.2: ctrl + shift + P <Monkey C: Export Project>
On the device I get: Aacch9d
In the simulator I get: AaCchld

I tried going to the widgets and into activities to see if any of those might activate any of these readings.

On a side note, how do I iterate through this object?

In python I'd do something like this: [ if info[i] then 1 else 0 for i in info ]

Pretty printing an object and seeing the properties would be nice too (instead of "Obj: 177")

Top Replies

All Replies