is Galaxy S2 - Android android.system

Android examples for android.system:Os Version

Description

is Galaxy S2

Demo Code

import android.os.Build;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Main{

    public static boolean isGalaxyS2() {
        try {//from ww w  .  j  av a2 s  . c om
            String toLowerCase = Build.MODEL.toLowerCase();
            boolean result = toLowerCase.contains("gt-i9100")
                    || toLowerCase.contains("gt-i9108")
                    || toLowerCase.contains("gt-i9103");
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

}

Related Tutorials