How can I create a project in Android Studio for phones and tablets, where the APK on the Play Store is the same for both?
I am using build variants with build flavors, but there are two APKs for every device.
How can I create a project in Android Studio for phones and tablets, where the APK on the Play Store is the same for both?
I am using build variants with build flavors, but there are two APKs for every device.
You can just approximate if it's a tablet or not by checking the screendimension. If the app uses XLARGE or LARGE display dimensions, it could be a tablet or a "big" phone.
You can get informations about that with something like this:
if(getResources().getConfiguration().screenLayout == Configuration.SCREENLAYOUT_SIZE_LARGE
|| getResources().getConfiguration().screenLayout == Configuration.SCREENLAYOUT_SIZE_XLARGE) {
//doSomething
}
You can test which of these ones is the better one for you.
more reference: