Thank you for the quick reply.

I am running into a problem with the bluetooth le stuff specically, 
however. I tried this:

   if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

       mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();

   }
I have the min version for my application set to 18 and the max to 21. On 
the getBluetoothLeScanner call I get an error that my min sdk version is 
only 18 and needs to be 21. This is my whole problem how do I support < 21 
bluetooth and >= 21 bluetooth calls at the same time?


On Wednesday, January 28, 2015 at 6:58:10 PM UTC-7, MathieuB wrote:
>
> According to the official documentation :
>
> You can use Android 5.0 APIs while also supporting older versions by 
>> adding conditions to your code that check for the system API level before 
>> executing APIs not supported by your minSdkVersion 
>> <https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#min>.
>>  
>> To learn more about maintaining backward compatibility, read Supporting 
>> Different Platform Versions 
>> <https://developer.android.com/training/basics/supporting-devices/platforms.html>
>> .
>
>
> Example with honeycomb : 
>
> // Make sure we're running on Honeycomb or higher to use ActionBar APIs
>     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
>         ActionBar actionBar = getActionBar();
>         actionBar.setDisplayHomeAsUpEnabled(true);         } 
>
>
> In your case : 
>
> if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to