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


Java FREObject.newObject方法代码示例

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


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

示例1: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
public FREObject call(FREContext ctx, FREObject[] args){
    UsbContext usbCtx = (UsbContext) ctx;
    ArrayList<UsbAccessory> accessories = usbCtx.usbAccessories();
    Iterator<UsbAccessory> accessoryIterator = accessories.iterator();
    JSONArray jsonArray = new JSONArray();
    while (accessoryIterator.hasNext()) {
        UsbAccessory accessory = accessoryIterator.next();
        JSONObject jsonObject = new JSONObject();
        UsbEvent.addUsbToJson(accessory, jsonObject);
        jsonArray.put(jsonObject);
    }
    try{
        return FREObject.newObject(jsonArray.toString());
    }catch(FREWrongThreadException e){
    }
    return null;
}
 
开发者ID:GIGATeam,项目名称:UsbExtension,代码行数:18,代码来源:GetAccessoriesFunction.java

示例2: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
public FREObject call(FREContext ctx, FREObject[] args){
    UsbContext usbCtx = (UsbContext) ctx;
    Iterator<UsbDevice> deviceIterator = usbCtx.usbDevices().iterator();
    JSONArray jsonArray = new JSONArray();
    while (deviceIterator.hasNext()) {
        UsbDevice device = deviceIterator.next();
        JSONObject jsonObject = new JSONObject();
        UsbEvent.addUsbToJson(device, jsonObject);
        jsonArray.put(jsonObject);
    }
    try{
        return FREObject.newObject(jsonArray.toString());
    }catch(FREWrongThreadException e){
    }
    return null;
}
 
开发者ID:GIGATeam,项目名称:UsbExtension,代码行数:17,代码来源:GetDevicesFunction.java

示例3: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@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;
}
 
开发者ID:marpies,项目名称:face-detection-ane,代码行数:19,代码来源:IsOperationalFunction.java

示例4: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) 
{
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
	{
		try
		{
			View decorView = context.getActivity().getWindow().getDecorView();
			Point outSize = new Point();
			
			decorView.getDisplay().getRealSize(outSize);
			
			return FREObject.newObject(outSize.y);
		}
		catch (Exception e0) {}
	}
	
	try { return FREObject.newObject(0); }
	catch (Exception e1) { return null; }
}
 
开发者ID:mesmotronic,项目名称:air-ane-immersivemode,代码行数:21,代码来源:ImmersiveHeightFunction.java

示例5: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) 
{
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
	{
		try
		{
			View decorView = context.getActivity().getWindow().getDecorView();
			Point outSize = new Point();
			
			decorView.getDisplay().getRealSize(outSize);
			
			return FREObject.newObject(outSize.x);
		}
		catch (Exception e0) {}
	}
	
	try { return FREObject.newObject(0); }
	catch (Exception e1) { return null; }
}
 
开发者ID:mesmotronic,项目名称:air-ane-immersivemode,代码行数:21,代码来源:ImmersiveWidthFunction.java

示例6: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args)
{
	FREObject result = null;
	
	try
	{
		String url = args[0].getAsString();
		
		Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
		ResolveInfo resolveInfo = context.getActivity().getPackageManager().resolveActivity(i, PackageManager.MATCH_DEFAULT_ONLY);
		String defaultActivity = resolveInfo != null && resolveInfo.activityInfo != null ? resolveInfo.activityInfo.toString() : "None";
		
		if(AirCapabilitiesExtension.doLogging)
			Log.d(AirCapabilitiesExtension.TAG, "Resolved activity for URL \""+url+"\": " + defaultActivity);
		
		result = FREObject.newObject(resolveInfo != null && resolveInfo.activityInfo != null); 
	}
	catch (Exception e)
	{
		e.printStackTrace();
	}
	
	return result;
}
 
开发者ID:freshplanet,项目名称:ANE-AirCapabilities,代码行数:26,代码来源:CanOpenURLFunction.java

示例7: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args)
{
	try {

		Runtime info = Runtime.getRuntime();
		long freeSize = info.freeMemory();
		long totalSize = info.totalMemory();
		long usedSize = totalSize - freeSize;

		return FREObject.newObject(usedSize);
	}
	catch (Exception e) {
		e.printStackTrace();
	}

	return null;
}
 
开发者ID:freshplanet,项目名称:ANE-AirCapabilities,代码行数:19,代码来源:GetCurrentMemFunction.java

示例8: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext arg0, FREObject[] arg1) {
	
	AirExtensionContext ctx = (AirExtensionContext) arg0;
	tag = ctx.getIdentifier();
	
	FREObject result = null;
	try{
		Context context = ctx.getActivity();
		PhoneInfo phoneInfo = new PhoneInfo(context);
		String phoneNumber = phoneInfo.getPhoneNumber();
		if(phoneNumber!=null)
		{
			Log.d(tag, phoneNumber);
		}
		result=FREObject.newObject(phoneNumber);
		phoneInfo.remove();
		phoneInfo=null;
	}catch(Exception e){
		Log.d(tag,e.getMessage());
		e.printStackTrace();
	}
	
	return result;
}
 
开发者ID:leonhe,项目名称:AirExtension,代码行数:26,代码来源:GetPhoneNumber.java

示例9: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext arg0, FREObject[] arg1) {
	
	AirExtensionContext ctx = (AirExtensionContext) arg0;
	tag = ctx.getIdentifier();
	
	FREObject result=null;
	
	try{
		
		Context context = (Context) ctx.getActivity();
		
		PhoneInfo phoneInfo = new PhoneInfo(context);
		String imei=phoneInfo.getIMIE();
		Log.d("imei:",imei);
		result = FREObject.newObject(imei);
		phoneInfo.remove();
		phoneInfo=null;
	}catch(Exception e){
		Log.d(tag, e.getMessage());
		e.printStackTrace();
	}
	return result;
}
 
开发者ID:leonhe,项目名称:AirExtension,代码行数:25,代码来源:GetIMEIFunction.java

示例10: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) 
{
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
	{
		try
		{
			View decorView = context.getActivity().getWindow().getDecorView();
			Point outSize = new Point();
			
			decorView.getDisplay().getRealSize(outSize);
			
			return FREObject.newObject(outSize.x);
		}
		catch (Exception e0) {} 
	}
	
	try { return FREObject.newObject(0); }
	catch (Exception e1) { return null; }
}
 
开发者ID:mesmotronic,项目名称:air-ane-fullscreen,代码行数:21,代码来源:ImmersiveWidthFunction.java

示例11: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) 
{
	try
	{
		final FullScreenContext fsc = (FullScreenContext) context;
		
		int uiOptions = args[0].getAsInt();
		
		fsc.resetUi();
		fsc.setSystemUiVisibility(uiOptions);
	}
	catch (Exception e0)
	{
		try { return FREObject.newObject(false); }
		catch (Exception e1) { return null; }
	}
	
	try { return FREObject.newObject(true); }
	catch (Exception e2) {}
	
	return null;
}
 
开发者ID:mesmotronic,项目名称:air-ane-fullscreen,代码行数:24,代码来源:SetSystemUiVisibilityFunction.java

示例12: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
/**
 * Process the Call.
 * 
    * @param ctx Extension context used to invoke the method
    * @param args Collection of the parameters passed to the method, one FREObject for each parameter.
    * 
 * @return Returning FREObject
 */
@Override
public FREObject call(FREContext context, FREObject[] args) {
	// Try to process the call
	try {
		// Get The Extension Context
		ExtensionContext cnt	= (ExtensionContext) context;
		cnt.log(CLASS+"call");
		// Get the Extension context instance
        return FREObject.newObject(cnt.isInterstitialLoaded());
	} catch (Exception e) {
		// Print the exception stack trace
		e.printStackTrace();
	}
	// Return
	return null;
}
 
开发者ID:mnashwan,项目名称:AdMobAne,代码行数:25,代码来源:IsInterstitialLoaded.java

示例13: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
@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;
}
 
开发者ID:freshplanet,项目名称:ANE-Google-Play-Game-Services,代码行数:19,代码来源:AirGooglePlayGamesGetActivePlayerName.java

示例14: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
/**
 * Send multimedia message with text
 * 
 * @arg String uri of the multimedia file
 * @arg String mime type of the multimedia file
 * @arg String message to be sent
 * 
 * @param frecontext
 * @param args
 * @return integer
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		
		String uriString = args[0].getAsString();
		Uri uri = Uri.parse(uriString);
		
		String mimeTypeString = args[1].getAsString();
		MimeType mimeType = MimeType.valueOf(mimeTypeString);
		
		String message = args[2].getAsString();
		
		int ret = MessageAPI.sendMultiMediaMessageWithText(context, uri, mimeType, message);
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:33,代码来源:SendMultimediaMessageWithText.java

示例15: call

import com.adobe.fre.FREObject; //导入方法依赖的package包/类
/**
 * Send multimedia message
 * 
 * @arg String uri of the multimedia file
 * @arg String mime type of the multimedia file
 * 
 * @param frecontext
 * @param args
 * @return integer
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		
		String uriString = args[0].getAsString();
		Uri uri = Uri.parse(uriString);
		
		String mimeTypeString = args[1].getAsString();
		MimeType mimeType = MimeType.valueOf(mimeTypeString);
		
		int ret = MessageAPI.sendMultiMediaMessage(context, uri, mimeType);
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:30,代码来源:SendMultimediaMessage.java


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