• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Running using lower target SDK

kfrajer

Newbie
Hi,
I am running AS 3.4.1 (latest) and my app is launched on the device which has Android API 28.

However, I have setup my manifest and my gradle file for my app (it is sync'd) to targetSDK 26.

When I run my app, I choose my device as the target. I read the SDK which prints 28 using this code and printing it on the screen:

`AndroidAPIver = Build.VERSION.SDK_INT;`

What should I do so my app runs with targetSDK 26 on my phone?
I followed a guide like this (I found a cpl like that) but it did not work: https://abhiandroid.com/androidstudio/change-api-sdk-level-android-studio.html
 
Actually, my device is configured with Android API 28. When I run my app, it prints in my screen API 28. But I want to run using API 26. What I did is these two things:
1. I set the targetSDK to 26 in my manifest
2. I set the targetSDK and compileSdkVersion to 26 in my app build.gradle

That means my app should print 26 when launch on my device, right?
 
It will use whatever is installed on the. Phone. The Android version is backwards compatible. 26 will run on 28
 
Back
Top Bottom