Skip to content

Instantly share code, notes, and snippets.

@espinchi
espinchi / DeviceUtil.java
Last active Nov 9, 2021
Check if the running device is an emulator
View DeviceUtil.java
import android.os.Build;
/**
* Utility methods related to physical devies and emulators.
*/
public class DeviceUtil {
public static boolean isEmulator() {
return Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
View gist:178439
protected TextViewer(LayoutManager layoutManager, Object constaints, JLabel label) {
this.setLayout(layoutManager);
this.label = label;
this.add(label, constaints);
}