You don't need separate APK for just that.
Find out if the device is phone or tablet by the following code
mFile = context.getFilesDir().getAbsoluteFile();
mDisplayMetrics = context.getResources().getDisplayMetrics();
connMan = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
final double x = Math.pow(mDisplayMetrics.widthPixels / mDisplayMetrics.xdpi, 2);
final double y = Math.pow(mDisplayMetrics.heightPixels / mDisplayMetrics.ydpi, 2);
mScreenInches = Math.sqrt(x + y);
if mScreenUnches < 5
its phone
override onConfigurationChanged
and restrict based on the screen size
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Checks the orientation of the screen
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show();
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show();
}
}