I am concerned about what should I set the
I set the compileSdkVersion to be 23 which is the latest right now, will older device be able to run it?
compileSdkVersion on its own has nothing to do with what devices can and cannot run your app. Usually, you set this to be the latest version of the Android SDK.
How do I exactly know what should my minSdkVersion be in order to make sure that phone running lower api or version be unable to access it?
Frequently, the development tools will warn you on the fly when you try using something that is newer than your
minSdkVersion. You can run a full Lint check to reconfirm periodically.
How should I set my targetSdk?
In the absence of any particular reason to choose something else, I usually pick the latest or next-to-latest value at the time I create my project (e.g., 22 or 23 now).
targetSdkVersion helps with backwards compatibility, and usually my description is "it's the version of Android that you were thinking of at the time you were writing the code".