I have an app where Fenix5 users reported crashes wereas my F5plus worked fine. I think I tracked it down to the ActivityRecording and enums of the sport/subsport.
_session = ActivityRecording.createSession({
:name => "Yada yada",
:sport => Activity.SPORT_RUNNING,
:subsport => Activity.SUB_SPORT_GENERIC
});
F5plus is on api level 3.3 and F5 is on api level 3.1. The issue is that the enum in Activity was introduced in 3.2. Before that the enum resides in ActivityRecording.
What is the proper way to handle this? Check for api level (how?) and use
ActivityRecording.SPORT_RUNNING
if its a F5 and use
Activity.SPORT_RUNNING
if it's a newer device?