Java Code Examples for com.adobe.fre.FREObject#getAsString()

The following examples show how to use com.adobe.fre.FREObject#getAsString() . 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: SslGet.java    From vpn-over-dns with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public FREObject call(FREContext ctx, FREObject passedArgs[]) {
	try {
		FREObject input1 = passedArgs[0];
		url = input1.getAsString();

		FREObject input2 = passedArgs[1];
		query = input2.getAsString();

		FREObject input3 = passedArgs[2];
		timeout = input3.getAsInt();

		new Thread(this).start();

	} catch (final Exception ex) {
		ex.printStackTrace();
	}

	return null;
}
 
Example 2
Source File: InitFunction.java    From AndroidInAppPurchase with Apache License 2.0 6 votes vote down vote up
@Override
public FREObject call(FREContext arg0, FREObject[] arg1)
{
	ExtensionContext ctx = (ExtensionContext)arg0;
	
	try
	{
		FREObject input = arg1[0]; 
		String base64EncodedPublicKey = input.getAsString();
	
		Billing billing = Billing.getInstance();
		billing.init(arg0.getActivity(), ctx, base64EncodedPublicKey);
	}
	catch (Exception e)
	{ 
		e.printStackTrace();
	} 
	
	return null;
}
 
Example 3
Source File: NotificationStop.java    From vpn-over-dns with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public FREObject call(FREContext ctx, FREObject passedArgs[]) {
// Log.d("Alex", "NotificationStop");

	if (notificationinit.getBuilder() != null && notificationinit.getManager() != null) {
	    String msg = "";

	    try {
		FREObject input = passedArgs[0];
		msg = input.getAsString();
	    } catch (final Exception ex) {
		ex.printStackTrace();
	    }

	    notificationinit.getBuilder().setSmallIcon(android.R.drawable.stat_sys_download_done).setContentText(msg);
	    Notification n;
	    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) {
		n = notificationinit.getBuilder().build();
	    } else {
		n = notificationinit.getBuilder().getNotification();
	    }
	    /* http://www.laurivan.com/android-make-your-notification-sticky/ */
	    n.flags |= Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT;
	    notificationinit.getManager().notify(1, n);
	}
	// Log.i("notification", "stop");
	return null;
    }
 
Example 4
Source File: Cancel.java    From vpn-over-dns with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public FREObject call(FREContext ctx, FREObject passedArgs[]) {
	try {
		FREObject input = passedArgs[0];
		String host = input.getAsString();
		lookup.cancel(host);

	} catch (final Exception ex) {
		ex.printStackTrace();
	}

	return null;
}
 
Example 5
Source File: Lookup.java    From vpn-over-dns with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public FREObject call(FREContext ctx, FREObject passedArgs[]) {
	try {
		FREObject input = passedArgs[0];
		String host = input.getAsString();
		queries.query(host);

	} catch (final Exception ex) {
		ex.printStackTrace();
	}

	return null;
}
 
Example 6
Source File: NotificationStart.java    From vpn-over-dns with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public FREObject call(FREContext ctx, FREObject passedArgs[]) {
// Log.d("Alex", "NotificationStart");

	if (notificationinit.getBuilder() != null && notificationinit.getManager() != null) {
	    String msg = "";

	    try {
		FREObject input = passedArgs[0];
		msg = input.getAsString();
	    } catch (final Exception ex) {
		ex.printStackTrace();
	    }

	    notificationinit.getBuilder().setSmallIcon(android.R.drawable.stat_sys_download).setContentText(msg);
	    Notification n;
	    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) {
		n = notificationinit.getBuilder().build();
	    } else {
		n = notificationinit.getBuilder().getNotification();
	    }
	    /* http://www.laurivan.com/android-make-your-notification-sticky/ */
	    n.flags |= Notification.FLAG_NO_CLEAR | Notification.FLAG_ONGOING_EVENT;
	    notificationinit.getManager().notify(1, n);
	}
	// Log.i("notification", "start");
	return null;
    }
 
Example 7
Source File: BaseFunction.java    From ANE-Crashlytics with Apache License 2.0 5 votes vote down vote up
protected String getStringFromFREObject(FREObject object) {
	try {
		return object.getAsString();
	}
	catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}