public static int DISPLAY_SCREEN_WIDTH = 0;
public static int DISPLAY_SCREEN_HEIGHT = 0;
private int MAX_PHONE_WIDTH = 500;
private int MAX_PHONE_HEIGHT = 800;
private boolean isDeviceATablet() {
boolean bIsDeviceATablet = false;
Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
DISPLAY_SCREEN_WIDTH = display.getWidth();
DISPLAY_SCREEN_HEIGHT = display.getHeight();
if( (DISPLAY_SCREEN_WIDTH > MAX_PHONE_WIDTH) || (DISPLAY_SCREEN_HEIGHT > MAX_PHONE_HEIGHT) )
bIsDeviceATablet = true;
if(bIsDeviceATablet)
Log.i("Device is identified as an Android TABLET.");
else
Log.i("Device is identified as an Android PHONE.");
return bIsDeviceATablet;
}
Subscribe to:
Post Comments (Atom)
Create a list in SwiftUI with sticky section headers
Sample Code import SwiftUI struct ContentView : View { @State var isCustomViewControllerDisplayed = false @State private va...

-
When you first start out programming iOS application, you’ll most likely notice the continued use of “delegates” throughout the SDK. The ...
-
To create a slider, you allocate it and initialize it with a frame just like any other UIKit control: slider = [[UISliderControl alloc...
-
A open source tool to detect bugs in Android and iOS apps before they ship - infer What is Infer? Infer is a static analysis tool ...
No comments:
Post a Comment