Under Review
over 2 years ago

SDK 4.2.0 Beta 1 won't compile AppBase.getProperty

Given

  return Application.getApp().getProperty(s);
The compiler reports
  ERROR: fr235: test.mc: '$.Toybox.Application.AppBase.getProperty' is deprecated.
But fr235 doesn't support Application.Properties.getValue, so I *have* to use getProperty when compiling for fr235.
Parents
  • In fact I actually thought that was the case for getProperty; my impression was that it only worked on ciq-1.x devices, and that the newer apis *had* to be used in ciq-2.0 and later.

    I think I see my confusion. If you're using it to get properties controlled by settings, then you *have* to use Application.Properties.getValue on newer devices; but if you're just using it as generic storage, you can choose between getProperty and Storage.getValue.

Comment
  • In fact I actually thought that was the case for getProperty; my impression was that it only worked on ciq-1.x devices, and that the newer apis *had* to be used in ciq-2.0 and later.

    I think I see my confusion. If you're using it to get properties controlled by settings, then you *have* to use Application.Properties.getValue on newer devices; but if you're just using it as generic storage, you can choose between getProperty and Storage.getValue.

Children
No Data