com.adobe.fre.FREWrongThreadException Java Examples

The following examples show how to use com.adobe.fre.FREWrongThreadException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IsOperationalFunction.java    From face-detection-ane with Apache License 2.0 6 votes vote down vote up
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	AIR.log( "FaceDetection::isOperational" );

	Activity activity = AIR.getContext().getActivity();

	FaceDetector.Builder fb = new FaceDetector.Builder( activity.getApplicationContext() );
	final FaceDetector detector = fb.build();
	try {
		return FREObject.newObject( detector.isOperational() );
	} catch( FREWrongThreadException e ) {
		e.printStackTrace();
	}

	return null;
}
 
Example #2
Source File: AirGooglePlayGamesGetActivePlayerName.java    From ANE-Google-Play-Game-Services with Apache License 2.0 6 votes vote down vote up
@Override
public FREObject call(FREContext arg0, FREObject[] arg1) {
	
	Extension.context.createHelperIfNeeded(arg0.getActivity());
	Player player = Games.Players.getCurrentPlayer(Extension.context.getApiClient());
	
	FREObject playerName = null;
	if (player != null)
	{
		try {
			playerName = FREObject.newObject(player.getDisplayName());
		} catch (FREWrongThreadException e) {
			e.printStackTrace();
		}
	}
	
	return playerName;
}
 
Example #3
Source File: BitmapDataUtils.java    From face-detection-ane with Apache License 2.0 5 votes vote down vote up
/**
 * Switch color channels
 * http://stackoverflow.com/questions/17314467/bitmap-channels-order-different-in-android
 */
public static Bitmap getBitmap( FREBitmapData bitmapData ) throws FREWrongThreadException, FREInvalidObjectException {
	bitmapData.acquire();
	Bitmap bitmap = Bitmap.createBitmap( bitmapData.getWidth(), bitmapData.getHeight(), Bitmap.Config.ARGB_8888 );
	Canvas canvas = new Canvas( bitmap );
	Paint paint = new Paint();
	paint.setColorFilter( mColorFilter );
	bitmap.copyPixelsFromBuffer( bitmapData.getBits() );
	bitmapData.release();
	canvas.drawBitmap( bitmap, 0, 0, paint );
	return bitmap;
}
 
Example #4
Source File: IsAvailableFunction.java    From face-detection-ane with Apache License 2.0 5 votes vote down vote up
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	AIR.log( "FaceDetection::isAvailable" );
	Activity activity = AIR.getContext().getActivity();

	try {
		return FREObject.newObject( checkPlayServices( activity ) );
	} catch( FREWrongThreadException e ) {
		e.printStackTrace();
	}

	return null;
}
 
Example #5
Source File: Context.java    From google-play-game-services-ane with MIT License 5 votes vote down vote up
@Override
public FREObject call(FREContext context, FREObject[] args) {
	FREObject bool = null;
	try {
		 bool = FREObject.newObject(SignInActivity.mHelper.isSignedIn()) ;
	} catch (FREWrongThreadException e) {
		e.printStackTrace();
	}
	
	return bool;
}