当前位置: 首页>>代码示例>>Java>>正文


Java ActivityManager.getDeviceConfigurationInfo方法代码示例

本文整理汇总了Java中android.app.ActivityManager.getDeviceConfigurationInfo方法的典型用法代码示例。如果您正苦于以下问题:Java ActivityManager.getDeviceConfigurationInfo方法的具体用法?Java ActivityManager.getDeviceConfigurationInfo怎么用?Java ActivityManager.getDeviceConfigurationInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.ActivityManager的用法示例。


在下文中一共展示了ActivityManager.getDeviceConfigurationInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mGLSurfaceView = new GLSurfaceView(this);

        // Check if the system support OpenGL ES 2.0
        final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
        final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

        if (supportsEs2) {
            // Request an OpenGL ES 2.0 compatible context.
            mGLSurfaceView.setEGLContextClientVersion(2);

            // Set the renderer to out demo renderer, define below
//            mGLSurfaceView.setRenderer(new LessonThreeRenderer());
            mGLSurfaceView.setRenderer(new NativeThreeRenderer());
        } else {
            // This is where you could create an OpenGL ES 1.x compatible
            // renderer if you wanted to support both ES 1 and ES 2
            return;
        }
        setContentView(mGLSurfaceView);
    }
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:26,代码来源:LessonThreeActivity.java

示例2: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mGLSurfaceView = new LessonFiveGLSurfaceView(this);

        // Check if the system support OpenGL ES 2.0
        final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
        final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

        if (supportsEs2) {
            // Request an OpenGL ES 2.0 compatible context.
            mGLSurfaceView.setEGLContextClientVersion(2);

            // Set the renderer to out demo renderer, define below
//            mGLSurfaceView.setRenderer(new LessonFiveRenderer(this));
            mGLSurfaceView.setRenderer(new NativeFiveRenderer(this));
        } else {
            // This is where you could create an OpenGL ES 1.x compatible
            // renderer if you wanted to support both ES 1 and ES 2
            return;
        }
        setContentView(mGLSurfaceView);
    }
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:26,代码来源:LessonFiveActivity.java

示例3: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mGLSurfaceView = new GLSurfaceView(this);

        // Check if the system support OpenGL ES 2.0
        final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
        final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

        if (supportsEs2) {
            // Request an OpenGL ES 2.0 compatible context.
            mGLSurfaceView.setEGLContextClientVersion(2);

            // Set the renderer to out demo renderer, define below
//            mGLSurfaceView.setRenderer(new LessonTwoRenderer());
            mGLSurfaceView.setRenderer(new NativeTwoRenderer());
        } else {
            // This is where you could create an OpenGL ES 1.x compatible
            // renderer if you wanted to support both ES 1 and ES 2
            return;
        }
        setContentView(mGLSurfaceView);
    }
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:26,代码来源:LessonTwoActivity.java

示例4: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mGLSurfaceView = new GLSurfaceView(this);

        // Check if the system support OpenGL ES 2.0
        final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
        final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

        if (supportsEs2) {
            // Request an OpenGL ES 2.0 compatible context.
            mGLSurfaceView.setEGLContextClientVersion(2);

            // Set the renderer to out demo renderer, define below
//            mGLSurfaceView.setRenderer(new LessonFourRenderer(this));
            mGLSurfaceView.setRenderer(new NativeFourRenderer(this));
        } else {
            // This is where you could create an OpenGL ES 1.x compatible
            // renderer if you wanted to support both ES 1 and ES 2
            return;
        }
        setContentView(mGLSurfaceView);
    }
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:26,代码来源:LessonFourActivity.java

示例5: init

import android.app.ActivityManager; //导入方法依赖的package包/类
void init(OpenGLEngine engine) {
	// Check if the system supports OpenGL ES 2.0.
	final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
	final ConfigurationInfo configurationInfo = activityManager
			.getDeviceConfigurationInfo();
	final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

	if (supportsEs2) {
		// Request an OpenGL ES 2.0 compatible context.
		engine.setEGLContextClientVersion(2);

		// Set the renderer to our user-defined renderer.
		engine.setRenderer(getNewRenderer());
	} else {
		// This is where you could create an OpenGL ES 1.x compatible
		// renderer if you wanted to support both ES 1 and ES 2.
		return;
	}
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:20,代码来源:OpenGLES2WallpaperService.java

示例6: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
public void onCreate(SurfaceHolder surfaceHolder) {
	super.onCreate(surfaceHolder);
	
	// Check if the system supports OpenGL ES 2.0.
	final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
	final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
	final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;
	
	if (supportsEs2) 
	{
		// Request an OpenGL ES 2.0 compatible context.
		setEGLContextClientVersion(2);

		// Set the renderer to our user-defined renderer.
		setRenderer(getNewRenderer());
	} 
	else 
	{
		// This is where you could create an OpenGL ES 1.x compatible
		// renderer if you wanted to support both ES 1 and ES 2.
		return;
	}			
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:25,代码来源:OpenGLES2WallpaperService.java

示例7: IsSupported

import android.app.ActivityManager; //导入方法依赖的package包/类
public static boolean IsSupported(Context context) {
    ActivityManager am =
            (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    ConfigurationInfo info = am.getDeviceConfigurationInfo();
    if(info.reqGlEsVersion >= 0x20000) {
        // Open GL ES 2.0 is supported.
        return true;
    }
    return false;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:11,代码来源:ViEAndroidGLES20.java

示例8: supportsOpenGLES2

import android.app.ActivityManager; //导入方法依赖的package包/类
/**
 * Checks if OpenGL ES 2.0 is supported on the current device.
 *
 * @param context the context
 * @return true, if successful
 */
private boolean supportsOpenGLES2(final Context context) {
    final ActivityManager activityManager = (ActivityManager)
            context.getSystemService(Context.ACTIVITY_SERVICE);
    final ConfigurationInfo configurationInfo =
            activityManager.getDeviceConfigurationInfo();
    return configurationInfo.reqGlEsVersion >= 0x20000;
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:14,代码来源:GPUImage.java

示例9: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
public void onCreate(SurfaceHolder surfaceHolder) {
    super.onCreate(surfaceHolder);
    glSurfaceView = new WallpaperGLSurfaceView(GLWallpaperService.this);

    ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();

    final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000
            || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1 &&
            (Build.FINGERPRINT.startsWith("generic")
                    || Build.FINGERPRINT.startsWith("unknown")
                    || Build.MODEL.contains("google_sdk")
                    || Build.MODEL.contains("Emulator")
                    || Build.MODEL.contains("Android SDK built for x86")));

    particlesRenderer = new ParticlesRenderer(GLWallpaperService.this);
    if (supportsEs2) {
        glSurfaceView.setEGLContextClientVersion(2);
        glSurfaceView.setRenderer(particlesRenderer);
        rendererSet = true;
    } else {
        Toast.makeText(GLWallpaperService.this, "not support egl 2.0", Toast.LENGTH_LONG);
        return;
    }

    DisplayMetrics dm = getResources().getDisplayMetrics();
    screenX = dm.widthPixels;
    screenY = dm.heightPixels;
}
 
开发者ID:yjp123456,项目名称:3D_Wallpaper,代码行数:31,代码来源:GLWallpaperService.java

示例10: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
    boolean supportES2 = configurationInfo.reqGlEsVersion >= 0x2000;
    if (supportES2) {
        mGlSurfaceView = new GLSurfaceView(this);
        mGlSurfaceView.setEGLContextClientVersion(2);
        mGlSurfaceView.setRenderer(new RendererWrapper());
        rendererSet = true;
        setContentView(mGlSurfaceView);
    }
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:16,代码来源:NativeLesson1Activity.java

示例11: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mGlSurfaceView = new LessonEightGLSurfaceView(this);
        setContentView(mGlSurfaceView);
        // Check if the system support OpenGL ES 2.0
        final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
        final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

        if (supportsEs2) {
            // Request an OpenGL ES 2.0 compatible context.
            mGlSurfaceView.setEGLContextClientVersion(2);

            final DisplayMetrics displayMetrics = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);

            // Set the renderer to our demo renderer, defined below.
//            mRender = (Action) new LessonEightRenderer(this);
            mRender = (Action) new NativeEightRenderer(this);
            mGlSurfaceView.setRenderer((GLSurfaceView.Renderer) mRender, displayMetrics.density);
        } else {
            // This is where you could create an OpenGL ES 1.x compatible
            // renderer if you wanted to support both ES 1 and ES 2
            return;
        }

    }
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:29,代码来源:LessonEightActivity.java

示例12: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
public void onCreate(SurfaceHolder surfaceHolder) {
	super.onCreate(surfaceHolder);
	
	// Check if the system supports OpenGL ES 2.0.
	final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
	final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
	final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;
	
	if (supportsEs2) 
	{
		// Request an OpenGL ES 2.0 compatible context.
		setEGLContextClientVersion(2);
		
		// On Honeycomb+ devices, this improves the performance when
		// leaving and resuming the live wallpaper.
		setPreserveEGLContextOnPause(true);

		// Set the renderer to our user-defined renderer.
		setRenderer(getNewRenderer());
	} 
	else 
	{
		// This is where you could create an OpenGL ES 1.x compatible
		// renderer if you wanted to support both ES 1 and ES 2.
		return;
	}			
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:29,代码来源:OpenGLES2WallpaperService.java

示例13: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) 
{
	super.onCreate(savedInstanceState);
	
	mGLSurfaceView = new GLSurfaceView(this);

	// Check if the system supports OpenGL ES 2.0.
	final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
	final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
	final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

	if (supportsEs2) 
	{
		// Request an OpenGL ES 2.0 compatible context.
		mGLSurfaceView.setEGLContextClientVersion(2);

		// Set the renderer to our demo renderer, defined below.
		mGLSurfaceView.setRenderer(new LessonThreeRenderer());
	} 
	else 
	{
		// This is where you could create an OpenGL ES 1.x compatible
		// renderer if you wanted to support both ES 1 and ES 2.
		return;
	}

	setContentView(mGLSurfaceView);
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:30,代码来源:LessonThreeActivity.java

示例14: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) 
{
	super.onCreate(savedInstanceState);
	
	mGLSurfaceView = new LessonFiveGLSurfaceView(this);

	// Check if the system supports OpenGL ES 2.0.
	final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
	final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
	final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

	if (supportsEs2) 
	{
		// Request an OpenGL ES 2.0 compatible context.
		mGLSurfaceView.setEGLContextClientVersion(2);

		// Set the renderer to our demo renderer, defined below.
		mGLSurfaceView.setRenderer(new LessonFiveRenderer(this));
	} 
	else 
	{
		// This is where you could create an OpenGL ES 1.x compatible
		// renderer if you wanted to support both ES 1 and ES 2.
		return;
	}

	setContentView(mGLSurfaceView);
	
	// Show a short help message to the user.
	if (savedInstanceState == null || !savedInstanceState.getBoolean(SHOWED_TOAST, false))
	{
		Toast.makeText(this, R.string.lesson_five_startup_toast, Toast.LENGTH_SHORT).show();
	}
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:36,代码来源:LessonFiveActivity.java

示例15: onCreate

import android.app.ActivityManager; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);		

	glSurfaceView = new LessonEightGLSurfaceView(this);
	
	setContentView(glSurfaceView);

	// Check if the system supports OpenGL ES 2.0.
	final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
	final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
	final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

	if (supportsEs2) {
		// Request an OpenGL ES 2.0 compatible context.
		glSurfaceView.setEGLContextClientVersion(2);

		final DisplayMetrics displayMetrics = new DisplayMetrics();
		getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);

		// Set the renderer to our demo renderer, defined below.
		renderer = new LessonEightRenderer(this, glSurfaceView);
		glSurfaceView.setRenderer(renderer, displayMetrics.density);
	} else {
		// This is where you could create an OpenGL ES 1.x compatible
		// renderer if you wanted to support both ES 1 and ES 2.
		return;
	}		
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:30,代码来源:LessonEightActivity.java


注:本文中的android.app.ActivityManager.getDeviceConfigurationInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。