Hi,
I'm writing a simple data field and I would like to take the current temperature but somehow I can not find this variable. Does anyone know where to look for this variable?
Thank you,
Peter
The team of developers would have to redo all the activity. It would be simpler to add the missing information to the Activity.info.
Is there actually shared memory possible between two different types of programs?
So, for example, a Widget or Application could retrieve data and store it in the object store. Then a Watchface or Datafield would retrieve the data for displaying purposes.
This would create limitless possibilities for Watchfaces (weather, calendar, sunset info) and datafields (temp)
It could be perfect!!! All information we need is: name of the application whose data you want to read and name of property and of course static function Application.getProperty(applicationName, propertyName) returning object.
Given your example, what is "applicationName", for example? is the the "appName" in the resources.xml file, or is the name of the .prg file (which matches the name of the .str file for the object store? (which changes when you install from the app store vs side loading.)
Also, if something needed two object stores (it's own and another's) there is only so much available memory for anything CIQ.. And data fields are limited to 16k on some devices
It must be "well known name" so from resources.xml and App's static function should take some parsing to investigate correct storage file. It seems to me that necessary information is in OUT.BIN file (maybe somewhere else).
But getting such object ready from another application (reference to a copy of it) should take much less memory than calculating it locally from the beginning, not to mention the processor time. Using 'has' or checking 'null' value is not a problem.
With an app, you can also access about anything, while recording a .fit file too...
Please forgive me but I'm totally new in CID SDK and again I have a few question (widget application):
1. I'm looking for variable NormalizedPower and without success, how to get it?
2. What is the difference between Sensor.Info.power and Activity.Info.currentPower?
3. How to get temperature from internal sensor and how from Tempe sensor?
4. Sensor.Info.temperature is null at least in simulator, is this correct?
I'm writing nothing special, just want put some more values then four into my layout.
Thank you,
Peter
sensors=Sensor.setEnabledSensors( [Sensor.SENSOR_TEMPERATURE] );
Sensor.enableSensorEvents(method(:sensorEvents));
if(sensors!=null && sensors.size()>0) {
gotTempe=true;
}
Thank you jim_m_58 for your replay. So how and when I should use function Sensor.Info.getInfo()?
function sensorEvents(sensor_info) {
if ((sensor_info.temperature!=null && sensor_info.temperature instanceof Float)) {
.....