Recently I read a book about android which says that Starting with august 2019, Google play will only accept apps built using Api 26 or newer
. But recently we published android app that has minimum Api level 23 and it is successfully published. Can anyone tell whats the scenario, or the documentation in the book is wrong?
They are not talking about minSdk
, they are talking about targetSdk or compileSdk.
Notice that I used "or" because your targetSdk
can not be higher than your compileSdk
.
When you increment targetSdk number, you have to comply with the new api and rules enforced however using an old compile/target sdk will let you use the features in the same way as they worked in earlier versions (which is one of the root causes of security vulnerablities). That is why they placed the restriction so every app is forced to use 'new way of doing things' rather than old.
For example, Before Android 5.0, permissions were granted when app was installed but then it was changed so now you have to ask permissions on runtime. If you target Sdk api lower than Android 5.0, you don't have to do anything and it will work on newer devices as well. However, if you target api higher than Android 5, you must ask for permissions on runtime or the newer sdk code throws an exception.