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


Java SystemUtils.isAndroidVersionOrHigher方法代码示例

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


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

示例1: onLoadBitmap

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	@Override
	public Bitmap onLoadBitmap(final Config pBitmapConfig, final boolean pMutable) {
		final BitmapFactory.Options decodeOptions = new BitmapFactory.Options();
		decodeOptions.inPreferredConfig = pBitmapConfig;
		decodeOptions.inDither = false;
//		decodeOptions.inScaled = false; // TODO Check how this behaves with drawable-""/nodpi/ldpi/mdpi/hdpi folders

		if (pMutable && SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB)) {
			decodeOptions.inMutable = pMutable;
		}

		final Bitmap bitmap = BitmapFactory.decodeResource(this.mResources, this.mDrawableResourceID, decodeOptions);

		if (pMutable) {
			return BitmapUtils.ensureBitmapIsMutable(bitmap);
		} else {
			return bitmap;
		}
	}
 
开发者ID:delight-im,项目名称:NationSoccer,代码行数:21,代码来源:ResourceBitmapTextureAtlasSource.java

示例2: isEthernetConnected

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static boolean isEthernetConnected(final Context pContext, final boolean pDefault) {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB_MR2)) {
		return ConnectivityUtils.isNetworkConnected(pContext, ConnectivityManager.TYPE_ETHERNET);
	} else {
		return pDefault;
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:ConnectivityUtils.java

示例3: isEthernetAvailable

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static boolean isEthernetAvailable(final Context pContext) throws ConnectivityUtilsException {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB_MR2)) {
		return ConnectivityUtils.isNetworkAvailable(pContext, ConnectivityManager.TYPE_ETHERNET);
	} else {
		throw new ConnectivityUtilsException();
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:9,代码来源:ConnectivityUtils.java

示例4: ColorSwapBitmapTextureAtlasSourceDecorator

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
public ColorSwapBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int pColorKeyColorARGBPackedInt, final int pTolerance, final int pColorSwapColorARGBPackedInt, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
	super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);

	this.mColorKeyColorARGBPackedInt = pColorKeyColorARGBPackedInt;
	this.mTolerance = pTolerance;
	this.mColorSwapColorARGBPackedInt = pColorSwapColorARGBPackedInt;
	this.mPaint.setXfermode(new AvoidXfermode(pColorKeyColorARGBPackedInt, pTolerance, Mode.TARGET));
	this.mPaint.setColor(pColorSwapColorARGBPackedInt);

	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.JELLY_BEAN)) {
		Debug.w("The class " + ColorSwapBitmapTextureAtlasSourceDecorator.class.getSimpleName() + " is deprecated for Android API Level: '" + Build.VERSION_CODES.JELLY_BEAN + "' and higher, since the class " + AvoidXfermode.class.getSimpleName() + " is deprecated since then.");
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:14,代码来源:ColorSwapBitmapTextureAtlasSourceDecorator.java

示例5: execute

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
/**
 * @see <a href="https://groups.google.com/forum/?fromgroups=#!topic/android-developers/8M0RTFfO7-M">groups.google.com/forum/?fromgroups=#!topic/android-developers/8M0RTFfO7-M</a>
 */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static <T> void execute(final AsyncTask<T, ?, ?> pAsyncTask, final T ... pParameters) {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB)) {
		pAsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, pParameters);
	} else {
		pAsyncTask.execute(pParameters);
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:12,代码来源:AsyncTaskUtils.java

示例6: isSupported

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
public static boolean isSupported(final Context pContext) {
	if (sSupported == null) {
		if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.ECLAIR_MR1)) {
			try {
				sSupported = SystemUtils.hasSystemFeature(pContext, PackageManager.FEATURE_BLUETOOTH);
			} catch (final SystemUtilsException e) {
				sSupported = Boolean.FALSE;
			}
		} else {
			sSupported = Boolean.FALSE;
		}
	}

	return sSupported;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:16,代码来源:Bluetooth.java

示例7: isEthernetAvailable

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static boolean isEthernetAvailable(final Context pContext, final boolean pDefault) {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB_MR2)) {
		return ConnectivityUtils.isNetworkAvailable(pContext, ConnectivityManager.TYPE_ETHERNET);
	} else {
		return pDefault;
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:ConnectivityUtils.java

示例8: isEthernetConnected

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static boolean isEthernetConnected(final Context pContext) throws ConnectivityUtilsException {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB_MR2)) {
		return ConnectivityUtils.isNetworkConnected(pContext, ConnectivityManager.TYPE_ETHERNET);
	} else {
		throw new ConnectivityUtilsException();
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:ConnectivityUtils.java

示例9: fromWifiApState

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
public static WifiHotspotState fromWifiApState(final int pWifiApState) throws WifiUtilsException {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.ICE_CREAM_SANDWICH)) {
		switch (pWifiApState) {
			case 10:
				return DISABLING;
			case 11:
				return DISABLED;
			case 12:
				return ENABLING;
			case 13:
				return ENABLED;
			case 14:
				return FAILED;
			default:
				throw new WifiUtilsException("TODO...");
		}
	} else {
		switch (pWifiApState) {
			case 0:
				return DISABLING;
			case 1:
				return DISABLED;
			case 2:
				return ENABLING;
			case 3:
				return ENABLED;
			case 4:
				return FAILED;
			default:
				if (pWifiApState >= 10) {
					return WifiHotspotState.fromWifiApState(pWifiApState - 10);
				} else {
					throw new WifiUtilsException("TODO...");
				}
		}
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:38,代码来源:WifiUtils.java

示例10: isEthernetConnectedOrConnecting

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static boolean isEthernetConnectedOrConnecting(final Context pContext, final boolean pDefault) {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB_MR2)) {
		return ConnectivityUtils.isNetworkConnectedOrConnecting(pContext, ConnectivityManager.TYPE_ETHERNET);
	} else {
		return pDefault;
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:9,代码来源:ConnectivityUtils.java

示例11: onLoadBitmap

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig, final boolean pMutable) {
	final BitmapFactory.Options decodeOptions = new BitmapFactory.Options();
	decodeOptions.inPreferredConfig = pBitmapConfig;
	decodeOptions.inDither = false;

	if (pMutable && SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB)) {
		decodeOptions.inMutable = pMutable;
	}

	InputStream in = null;
	try {
		in = new FileInputStream(this.mFile);
		final Bitmap bitmap = BitmapFactory.decodeStream(in, null, decodeOptions);

		if (pMutable) {
			return BitmapUtils.ensureBitmapIsMutable(bitmap);
		} else {
			return bitmap;
		}
	} catch (final IOException e) {
		Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ". File: " + this.mFile, e);
		return null;
	} finally {
		StreamUtils.close(in);
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:29,代码来源:FileBitmapTextureAtlasSource.java

示例12: onLoadBitmap

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig, final boolean pMutable) {
	InputStream in = null;
	try {
		final BitmapFactory.Options decodeOptions = new BitmapFactory.Options();
		decodeOptions.inPreferredConfig = pBitmapConfig;
		decodeOptions.inDither = false;

		if (pMutable && SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB)) {
			decodeOptions.inMutable = pMutable;
		}

		in = this.mAssetManager.open(this.mAssetPath);

		final Bitmap bitmap = BitmapFactory.decodeStream(in, null, decodeOptions);

		if (pMutable) {
			return BitmapUtils.ensureBitmapIsMutable(bitmap);
		} else {
			return bitmap;
		}
	} catch (final IOException e) {
		Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ". AssetPath: " + this.mAssetPath, e);
		return null;
	} finally {
		StreamUtils.close(in);
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:30,代码来源:AssetBitmapTextureAtlasSource.java

示例13: isEthernetConnectedOrConnecting

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public static boolean isEthernetConnectedOrConnecting(final Context pContext) throws ConnectivityUtilsException {
	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.HONEYCOMB_MR2)) {
		return ConnectivityUtils.isNetworkConnectedOrConnecting(pContext, ConnectivityManager.TYPE_ETHERNET);
	} else {
		throw new ConnectivityUtilsException();
	}
}
 
开发者ID:mediamonks,项目名称:tilt-game-android,代码行数:9,代码来源:ConnectivityUtils.java

示例14: isSupportedByAndroidVersion

import org.andengine.util.system.SystemUtils; //导入方法依赖的package包/类
public static boolean isSupportedByAndroidVersion() {
	return SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.ECLAIR_MR1);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:4,代码来源:Bluetooth.java


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