• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FREArray类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.adobe.fre.FREArray的典型用法代码示例。如果您正苦于以下问题:Java FREArray类的具体用法?Java FREArray怎么用?Java FREArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FREArray类属于com.adobe.fre包,在下文中一共展示了FREArray类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAttachmentImages

import com.adobe.fre.FREArray; //导入依赖的package包/类
private VKUploadImage[] getAttachmentImages( FREArray attachmentImages ) {
	if( attachmentImages == null ) return null;

	try {
		long length = attachmentImages.getLength();
		VKUploadImage[] result = new VKUploadImage[(int)length];
		for( int i = 0; i < length; i++ ) {
			FREBitmapData bmpData = (FREBitmapData) attachmentImages.getObjectAt( i );
			Bitmap bitmap = BitmapDataUtils.getBitmap( bmpData );
			result[i] = new VKUploadImage( bitmap, VKImageParameters.pngImage() );
		}
		return result;
	} catch( Exception e ) {
		e.printStackTrace();
		AIR.log( "Error parsing attachment images: " + e.getLocalizedMessage() );
		return null;
	}
}
 
开发者ID:marpies,项目名称:vk-ane,代码行数:19,代码来源:ShareFunction.java


示例2: call

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

	FREArray params = (args[1] != null) ? (FREArray) args[1] : null;
	VKParameters vkParameters = new VKParameters();
	String errorMessage = parseRequestParameters( params, vkParameters );

	mRequestId = FREObjectUtils.getInt( args[2] );
	/* Send request if there's no error parsing the parameters */
	if( errorMessage == null ) {
		String method = FREObjectUtils.getString( args[0] );
		/* Execute the request */
		AIR.log( "Sending VKRequest " + method );
		VKRequest request = new VKRequest( method );
		request.addExtraParameters( vkParameters );
		request.executeWithListener( getRequestListener( mRequestId ) );
	}
	/* Or dispatch error */
	else {
		AIR.log( "Error parsing request parameters: " + errorMessage );
		AIR.dispatchEvent( AIRVKEvent.VK_REQUEST_ERROR, StringUtils.getEventErrorJSON( mRequestId, errorMessage ) );
	}

	return null;
}
 
开发者ID:marpies,项目名称:vk-ane,代码行数:27,代码来源:RequestFunction.java


示例3: call

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


    try {
        String path = args[0].getAsString();
        ExpansionFile[] xapks = getFiles((FREArray) args[1], context);
        boolean overwrite = args[2].getAsBool();

        XAPKContext.client.unzip(path, xapks, overwrite);
    } catch (Exception e) {
        FREUtils.logEvent(context, LogLevel.FATAL, "Unable to retrieve path. [%s: %s]", e.getClass(), e.getMessage());
    }

    return null;
}
 
开发者ID:alebianco,项目名称:ANE-Android-Expansion,代码行数:17,代码来源:UnzipExpansionContent.java


示例4: getBytes

import com.adobe.fre.FREArray; //导入依赖的package包/类
private byte[] getBytes(FREContext context, FREArray array) throws IllegalStateException, IllegalArgumentException, FREInvalidObjectException, FREWrongThreadException, FRETypeMismatchException {

        byte[] bytes = new byte[(int) array.getLength()];
        for (int i = 0; i < array.getLength(); i++) {
            bytes[i] = (byte) array.getObjectAt(i).getAsInt();
        }
        return bytes;
    }
 
开发者ID:alebianco,项目名称:ANE-Android-Expansion,代码行数:9,代码来源:SetMarketSecurity.java


示例5: parseRequestParameters

import com.adobe.fre.FREArray; //导入依赖的package包/类
private String parseRequestParameters( FREArray params, VKParameters vkParameters ) {
	if( params != null ) {
		try {
			long length = params.getLength();
			String key = null;
			for( long i = 0; i < length; i++ ) {
				FREObject param = params.getObjectAt( i );
				/* Get key */
				if( i % 2 == 0 ) {
					key = FREObjectUtils.getString( param );
				}
				/* Get value */
				else {
					Object value = null;
					FREObjectType type = getFREObjectType( param );
					switch( type ) {
						case INT:
							value = FREObjectUtils.getInt( param );
							AIR.log( "FREObjectType: INT = " + FREObjectUtils.getInt( param ) );
							break;
						case DOUBLE:
							value = FREObjectUtils.getDouble( param );
							AIR.log( "FREObjectType: DOUBLE = " + FREObjectUtils.getDouble( param ) );
							break;
						case STRING:
							value = FREObjectUtils.getString( param );
							AIR.log( "FREObjectType: STRING = " + FREObjectUtils.getString( param ) );
							break;
						case ARRAY:
							value = FREObjectUtils.getListOfString( (FREArray) param );
							AIR.log( "FREObjectType: ARRAY = " + FREObjectUtils.getListOfString( (FREArray) param ) );
							break;
						case UNKNOWN:
							throw new Exception( "Parameter value for key " + key + " cannot be evaluated." );
					}
					if( value != null ) {
						vkParameters.put( key, value );
					}
				}
			}
		} catch( Exception e ) {
			e.printStackTrace();
			return e.getLocalizedMessage();
		}
	}
	/* No error message */
	return null;
}
 
开发者ID:marpies,项目名称:vk-ane,代码行数:49,代码来源:RequestFunction.java


示例6: call

import com.adobe.fre.FREArray; //导入依赖的package包/类
/**
 * Send app link message
 * 
 * @arg String message to be sent
 * @arg String title of the app
 * @arg String version of the app
 * @arg AppInfo[] app info
 * 
 * @param frecontext
 * @param args
 * @return integer
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		
		String message = args[0].getAsString();
		
		String appTitle = args[1].getAsString();
		
		String appVersion = args[2].getAsString();
		
		ArrayList<Map<String,String>> params = new ArrayList<Map<String,String>>();
		
		FREArray appParams = (FREArray) args[3];
		for (int n = 0; n < appParams.getLength(); n++) {
			FREObject param = (FREObject) appParams.getObjectAt(n);
			
			String id = param.getProperty("id").getAsString();
			String os = param.getProperty("os").getAsString();
			String deviceType = param.getProperty("deviceType").getAsString();
			String installUrl = param.getProperty("installUrl").getAsString();
			String executeUri = param.getProperty("executeUri").getAsString();
			
			HashMap<String,String> p = new HashMap<String,String>();
    		p.put("id", id);
    		p.put("OS", os);
    		p.put("deviceType", deviceType);
    		p.put("installUrl", installUrl);
    		p.put("executeUri", executeUri);
    		
    		params.add(p);
		}
		
		int ret = MessageAPI.sendAppLinkMessage(context, message, appTitle, appVersion, params);
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:54,代码来源:SendAppLinkMessage.java


示例7: getFiles

import com.adobe.fre.FREArray; //导入依赖的package包/类
private ExpansionFile[] getFiles(FREArray list, FREContext context) throws FREInvalidObjectException, FREWrongThreadException, IllegalStateException, FRETypeMismatchException, FREASErrorException, FRENoSuchNameException {

        ExpansionFile[] xapks = new ExpansionFile[(int) list.getLength()];

        for (int i = 0; i < list.getLength(); i++) {
            FREObject file = list.getObjectAt(i);

            boolean main = file.getProperty("main").getAsBool();
            int version = file.getProperty("version").getAsInt();
            long size = (long) file.getProperty("size").getAsInt();

            xapks[i] = new ExpansionFile(main, version, size);
        }

        return xapks;
    }
 
开发者ID:alebianco,项目名称:ANE-Android-Expansion,代码行数:17,代码来源:UnzipExpansionContent.java


示例8: call

import com.adobe.fre.FREArray; //导入依赖的package包/类
@Override
public FREObject call(FREContext arg0, FREObject[] arg1)
{
	try
	{
		FREArray freItems = (FREArray)arg1[0];
		FREArray freSubs = (FREArray)arg1[1];
		
		Billing billing = Billing.getInstance();
		
		List<String> items = null;
		List<String> subs = null;
		FREObject freObj;
		long len, i;
		
		if(freItems != null && freItems.getLength() > 0)
		{
			items = new ArrayList<String>();
			len = freItems.getLength();
			for(i = 0; i < len; i++)
			{
				freObj = freItems.getObjectAt(i);
				if(freObj != null)
					items.add(freObj.getAsString());
			}
		}
		
		if(freSubs != null && freSubs.getLength() > 0)
		{
			subs = new ArrayList<String>();
			len = freSubs.getLength();
			for(i = 0; i < len; i++)
			{
				freObj = freSubs.getObjectAt(i);
				if(freObj != null)
					items.add(freObj.getAsString());
			}
		}
		
		billing.restore(items, subs);
	}
	catch (Exception e)
	{
		e.printStackTrace();
	} 
	
	return null;
}
 
开发者ID:pozirk,项目名称:AndroidInAppPurchase,代码行数:49,代码来源:RestoreFunction.java


示例9: call

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

	ArrayList<String> permissions = (args[0] == null) ? null : (ArrayList<String>) FREObjectUtils.getListOfString( (FREArray) args[0] );

	AndroidActivityWrapper.GetAndroidActivityWrapper().addActivityResultListener( this );

	AIR.log( "AuthFunction | VKSdk::login" );

	VKSdk.login( AIR.getContext().getActivity(), (permissions != null) ? permissions.toArray( new String[0] ) : null );

	return null;
}
 
开发者ID:marpies,项目名称:vk-ane,代码行数:15,代码来源:AuthFunction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Group类代码示例发布时间:2022-05-23
下一篇:
Java TextRenderer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap