I have an Android Xamarin appliation with android:minSdkVersion="15"
and android:targetSdkVersion="21"
. Turned out that IDE (xamarin studio, visual studio) and compilation process just ignore if I'm using something above API 15 which is not expected behavior here.
For example there is a method Path.addArc(float,float,float,float,float,float)
from API 21
and I was able to use it with the manifest settings above which gave me a run-time error NoSuchMethodError
.
There is an easy fix to use an overload Path.addArc(RectF,float,float)
from API 1
but my question is more about how to get a compile time error instead or a run-time.
[UPDATE]
Basically I want to maintain the backward compatibility for API 15
(minimum android version) while having API 21
as a target android version. And I want to get an IDE support when I'm trying to use any method above API 15
. That means I need a warning saying that I'm using a method which doesn't exist in the minimum android version defined so please do a run-time version check.
Is it possible?