Use this method to check if the device supports OpenGL ES 2.0. - Android Hardware

Android examples for Hardware:Device Feature

Description

Use this method to check if the device supports OpenGL ES 2.0.

Demo Code


//package com.java2s;

import android.app.ActivityManager;

import android.content.Context;

import android.content.pm.ConfigurationInfo;

public class Main {
    /**/*  www .j  a  va 2  s.c o  m*/
     * Use this method to check if the device supports OpenGL ES 2.0.
     * 
     * @param context
     * @return
     */
    public static boolean supportsOpenGLES20(Context context) {
        final ActivityManager manager = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo info = manager.getDeviceConfigurationInfo();
        return info.reqGlEsVersion >= 0x20000;
    }
}

Related Tutorials