Hi,
I´m a little confused right now.. I initialize hasWeather with false and print it. After the check I print it again and it states true even if the simulated device is API 3.1 or lower.
Hi,
I´m a little confused right now.. I initialize hasWeather with false and print it. After the check I print it again and it states true even if the simulated device is API 3.1 or lower.
The main reason to use minSDK is preventing to download app to devices not fulfilled version.
If you have minSDk=1 it means everybody can do it so your app can't use any function above 1.0 or you have…
If it's too low for your app, the store displays a message and the app can't be installed.
Every one of my 50 or so production apps has a min ApiLevel of 1.x. To handle…
Ok. I have sideloaded the exact same code on a vivoactive 3 and looked into the logging txt. Has weather returns false as it is expected - why doesn´t do this in the simulator....
What target device? Sounds like it is something that actually has Weather.
Looks like you are doing this in the background for some reason. is hasWather global, or just in your background?
Globals are global to a process so the main app and background each have their own copy, with the background starting with what's in the main process.
check out on device that can't have 3.2 at all (e.g. s60) probably sim assumed upgrade. I've read somewhere that combo with level version doesn't work
For example on a vivoactive 3. There should no weather API availiable, right? The background process is the first one where the error occurs - I have another code snippet with weather for the foreground too. The variable hasWeather is restricted to the class.
What happens on a real device?
I have only a Fenix 6X on hand - maybe I can check later with sideloading on a Vivoactive 3 from my friend.
For what it's worth I put the following code in a data field app's AppBase.initialize/onStart and View.initialize()...
System.println("Toybox has :Weather = " + ((Toybox has :Weather) ? "true" : "false"));
...and ran the app on a simulated vivoactive3.
It printed out "false" every time.
I tried SDK 4.1.5 and the two "4.1.4 Compiler 2 Beta" SDKs.
sdk 4.1.5 win 10 eclipse
System.println(Toybox has :Weather)
vivo3 3.0/3.1
Background: 2022-8-10 18:23:57 >false<
2022-8-10 18:23:57 >false<
f6pro 3.2
Background: 2022-8-10 18:27:11 >true<
2022-8-10 18:27:11 >true<
Do the check after you call AppBase.initialize() You may also want
using Toybox.Weather;
In AppBase, initialize() is called for the main app as well as each time the background runs
You can see this in psx's post where the println occurs for both for the main app and the background.
5924610 Sorry if this is a stupid question but are you sure you're testing with vivoactive3 and not vivoactive3m (Vivoactive 3 Music)?
vivoactive3m supports API 3.2.0, vivoactive3 does not.
Have you tried any other non-3.2.0 devices, like fr230?