Is there a way to check if Android device supports

2019-01-13 18:31发布

I need to check dynamically if the used device supports openGL ES 2.0. How can i do that?

7条回答
【Aperson】
2楼-- · 2019-01-13 19:05

For a while, I've been looking for the same answer, too. But unfortunately, I couldn't find a proper description for that. I just found a way a minute ago by myself, and I feel like I'd like to share it with everyone.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    FeatureInfo[] list = this.getPackageManager()
            .getSystemAvailableFeatures();

    Toast.makeText(this,
            "OpenGL ES Version: " + list[list.length - 1].getGlEsVersion(),
            Toast.LENGTH_LONG).show();
}
查看更多
登录 后发表回答