Reputation: 2281
The minSdkVersion
is manually set by the developer. But you can easily use a function at a higher level and not find out about it until runtime on a device that doesn't support it.
Is there a tool or compiler option that will warn you when you use a function that isn't supported by your minSdkVersion
?
I'm using SBT, Scala language, and IntelliJ IDEA. Also using android-sdk-plugin
for SBT.
EDIT: I see a difference between my project (written mostly in Scala) and a default Java android app. In the Java code, I get errors when trying to use functions that exceed the minSdkVersion
. But in the Scala project the IDE and SBT build system both don't seem to care at all. I suspect I'm missing a setting in my build.sbt
file via android-sdk-plugin
.
Upvotes: 1
Views: 371
Reputation: 97268
The API level check is performed by a lint tool which is part of the Android SDK. The lint tool works on a Java AST and cannot do anything about code which is written in a different language. To have these checks work for Scala code, someone would need to write an equivalent tool for Scala, but I'm not aware of the existence of any such tool.
Upvotes: 1