本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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; }
}
示例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; }
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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; }
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}