當前位置: 首頁>>代碼示例>>Java>>正文


Java Log.e方法代碼示例

本文整理匯總了Java中org.appcelerator.kroll.common.Log.e方法的典型用法代碼示例。如果您正苦於以下問題:Java Log.e方法的具體用法?Java Log.e怎麽用?Java Log.e使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.appcelerator.kroll.common.Log的用法示例。


在下文中一共展示了Log.e方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onReceivedSslError

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
{
	/*
	 * in theory this should be checked to make sure it's not null but if there is some failure 
	 * in the association then usage of webViewProxy should trigger a NPE to make sure the issue 
	 * is not ignored
	 */
	KrollProxy webViewProxy = this.webView.getProxy();
	
	KrollDict data = new KrollDict();
	data.put(TiC.ERROR_PROPERTY_CODE, error.getPrimaryError());
	webView.getProxy().fireSyncEvent(TiC.EVENT_SSL_ERROR, data);

	boolean ignoreSslError = false;
	try {
		ignoreSslError = webViewProxy.getProperties().optBoolean(TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR, false);

	} catch(IllegalArgumentException e) {
		Log.e(TAG, TiC.PROPERTY_WEBVIEW_IGNORE_SSL_ERROR + " property does not contain a boolean value, ignoring"); 
	}

	if (ignoreSslError == true) {
		Log.w(TAG, "ran into SSL error but ignoring...");
		handler.proceed();

	} else {
		Log.e(TAG, "SSL error occurred: " + error.toString());
		handler.cancel();
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:32,代碼來源:TiWebViewClient.java

示例2: getJSValue

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
synchronized public String getJSValue(String expression)
{
	// Don't try to evaluate js code again if the binding has already been destroyed
	if (!destroyed && interfacesAdded) {
		String code = "_TiReturn.setValue((function(){try{return " + expression
			+ "+\"\";}catch(ti_eval_err){return '';}})());";
		Log.d(TAG, "getJSValue:" + code, Log.DEBUG_MODE);
		returnSemaphore.drainPermits();
		synchronized (codeSnippets) {
			codeSnippets.push(code);
		}
		try {
			if (!returnSemaphore.tryAcquire(3500, TimeUnit.MILLISECONDS)) {
				synchronized (codeSnippets) {
					codeSnippets.removeElement(code);
				}
				Log.w(TAG, "Timeout waiting to evaluate JS");
			}
			return returnValue;
		} catch (InterruptedException e) {
			Log.e(TAG, "Interrupted", e);
		}
	}
	return null;
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:26,代碼來源:TiWebViewBinding.java

示例3: requestPermission

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
/**
 * Request a permission and optionally register a callback for the current activity
 * 
 * @param requestedPermission permission as defined in Manifest
 * @param permissionCallback function called with result of permission prompt
 * @param requestCode - 8 Bit value to associate callback with request - if none is provided a system generated will used
 * @return true in case of valid request, false if requested permission is not a valid one
 */
@Kroll.method
public boolean requestPermission(String requestedPermission,
		@Kroll.argument(optional = true) KrollFunction permissionCallback,
		@Kroll.argument(optional = true) Integer requestCode) {

	Log.d(LCAT, "Requesting permission: " + requestedPermission);

	if (!isValidPermissionString(requestedPermission)) {
		Log.e(LCAT, "Requested permission is not supported :"
				+ requestedPermission);
		return false;
	}

	return handleRequest(new String[]{requestedPermission}, requestCode, permissionCallback);

}
 
開發者ID:stgrosshh,項目名稱:tipermissions,代碼行數:25,代碼來源:TipermissionsModule.java

示例4: requestPermissions

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
/**
	 * Request a permission and optionally register a callback for the current activity
	 * 
	 * @param requestedPermissions Array of permissions as defined in Manifest
	 * @param permissionCallback function called with result of permission prompt
	 * @param requestCode - 8 Bit value to associate callback with request - if none is provided, a system generated one is used
	 * @return true in case of valid request, false if requested permission is not a valid one
	 */
	@Kroll.method
	public boolean requestPermissions(@Kroll.argument String[] requestedPerms,
			@Kroll.argument(optional = true) KrollFunction permissionCallback,
			@Kroll.argument(optional = true) Integer requestCode)
			 {

//		String[] requestedPermissions = new String[]{requestedPerms};//(String[])requestedPerms;
		for(String permission:requestedPerms) {
			Log.d(LCAT, "Requesting permission: " + permission);

			if (!isValidPermissionString(permission)) {
				Log.e(LCAT, "Requested permission is not supported :"
						+ permission);
				return false;
			}
		}

		return handleRequest(requestedPerms, requestCode, permissionCallback);

	}
 
開發者ID:stgrosshh,項目名稱:tipermissions,代碼行數:29,代碼來源:TipermissionsModule.java

示例5: EnablePush

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public static void EnablePush(TiApplication app) {
  Context appContext = app.getApplicationContext();
  Activity appActivity = app.getAppCurrentActivity();

  if (appContext == null) {
    Log.e(TAG, "Application context is null, can't initialize Parse");
    return;
  }
  else if (appActivity == null) {
    Log.e(TAG, "Application activity is null, can't initialize Parse");
    return;
  }
  else {
    //PushService.setDefaultPushCallback(appContext, appActivity.getClass());
    ParseAnalytics.trackAppOpened(appActivity.getIntent());
    ParseInstallation.getCurrentInstallation().saveInBackground();
  }
}
 
開發者ID:E2010,項目名稱:android-parse-module-titanium-3-5,代碼行數:19,代碼來源:ParseSingleton.java

示例6: getResource

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
private int getResource(String type, String name) {
    int icon = 0;
    if (name != null) {
        /* Remove extension from icon */
        int index = name.lastIndexOf(".");
        if (index > 0) {
            name = name.substring(0, index);
        }
        try {
            icon = TiRHelper.getApplicationResource(type + "." + name);
        } catch (TiRHelper.ResourceNotFoundException ex) {
            Log.e(LCAT, type + "." + name + " not found; make sure it's in platform/android/res/" + type);
        }
    }

    return icon;
}
 
開發者ID:morinel,項目名稱:gcmpush,代碼行數:18,代碼來源:GCMIntentService.java

示例7: setIcon

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method @Kroll.setProperty
public void setIcon(Object icon)
{
	if (icon instanceof Number) {
		notificationBuilder.setSmallIcon(((Number)icon).intValue());
	} else {
		String iconUrl = TiConvert.toString(icon);
		if (iconUrl == null) {
			Log.e(TAG, "Url is null");
			return;
		}
		String iconFullUrl = resolveUrl(null, iconUrl);
		notificationBuilder.setSmallIcon(TiUIHelper.getResourceId(iconFullUrl));
	}
	setProperty(TiC.PROPERTY_ICON, icon);
}
 
開發者ID:falkolab,項目名稱:Ti.NotificationFactory,代碼行數:17,代碼來源:NotificationProxy.java

示例8: getImage

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method
public TiBlob getImage(String filePath) {
	filePath = filePath.replaceFirst("file://", "");
	
       if (null != filePath) {
           return TiBlob.blobFromImage( BitmapFactory.decodeFile(filePath) );
       }
       
       Log.e(Defaults.LCAT, "File path missing");
       return null;
   }
 
開發者ID:prashantsaini1,項目名稱:titanium-android-imagepicker,代碼行數:12,代碼來源:ImagepickerModule.java

示例9: InitializeParse

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void InitializeParse(String appId, String clientKey, TiApplication application) {
  Context appContext = application.getApplicationContext();

  if (appContext == null) {
    Log.e(TAG, "Application context is null, cannot continue...");
    return;
  }
  else if (appId != null && appId.isEmpty()) {
    Log.e(TAG, "Application key is required! Parse has NOT been initialized.");
    return;
  }
  else if (clientKey != null && clientKey.isEmpty()) {
    Log.e(TAG, "Client key is required! Parse has NOT been initialized.");
    return;
  }

  if (!initialized) {
    Log.d(TAG, "Initializing with: '" + appId + "' and '" + clientKey + "'.");
    Parse.initialize(appContext, appId, clientKey);

    initialized = true;
  }
  else
  {
    Log.e(TAG, "Parse has already been initialized!");
  }
}
 
開發者ID:E2010,項目名稱:android-parse-module-titanium-3-5,代碼行數:28,代碼來源:ParseSingleton.java

示例10: InitializeParseWithConfig

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void InitializeParseWithConfig(String appId, String clientKey, String serverUrl, TiApplication application) {
   Context appContext = application.getApplicationContext();

   if (appContext == null) {
     Log.e(TAG, "Application context is null, cannot continue...");
     return;
   } else if (appId != null && appId.isEmpty()) {
     Log.e(TAG, "Application key is required! Parse has NOT been initialized.");
     return;
   } else if (serverUrl != null && serverUrl.isEmpty()) {
  Log.e(TAG, "Server Url is required! Parse has NOT been initialized.");
  return;
}

   if (!initialized) {
     Log.d(TAG, "Initializing with: '" + appId + "' and '" + serverUrl + "'.");
     
     Parse.initialize(new Parse.Configuration.Builder(appContext)
       .applicationId(appId)
       .clientKey(null)
       .server(serverUrl)
       .build());

     initialized = true;
   }
   else
   {
     Log.e(TAG, "Parse has already been initialized!");
   }
}
 
開發者ID:E2010,項目名稱:android-parse-module-titanium-3-5,代碼行數:31,代碼來源:ParseSingleton.java

示例11: onError

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
public void onError(Context context, String errorId) {
    Log.e(LCAT, "Error: " + errorId);

    if (GCMModule.getInstance() != null) {
        GCMModule.getInstance().sendError(errorId);
    }
}
 
開發者ID:morinel,項目名稱:gcmpush,代碼行數:9,代碼來源:GCMIntentService.java

示例12: onRecoverableError

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
public boolean onRecoverableError(Context context, String errorId) {
    Log.e(LCAT, "RecoverableError: " + errorId);

    if (GCMModule.getInstance() != null) {
        GCMModule.getInstance().sendError(errorId);
    }

    return true;
}
 
開發者ID:morinel,項目名稱:gcmpush,代碼行數:11,代碼來源:GCMIntentService.java

示例13: setSound

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method @Kroll.setProperty
public void setSound(String url)
{
	if (url == null) {
		Log.e(TAG, "Url is null");
		return;
	}
	sound = Uri.parse(resolveUrl(null, url));
	notificationBuilder.setSound(sound, audioStreamType);
	setProperty(TiC.PROPERTY_SOUND, url);
}
 
開發者ID:falkolab,項目名稱:Ti.NotificationFactory,代碼行數:12,代碼來源:NotificationProxy.java

示例14: unsubscribe

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method
public void unsubscribe(final HashMap options) {
    // unsubscripe from a topic
    final String senderId = (String) options.get("senderId");
    final String topic  = (String) options.get("topic");
    final KrollFunction callback = (KrollFunction) options.get("callback");

    if (topic == null || !topic.startsWith("/topics/")) {
        Log.e(LCAT, "No or invalid topic specified, should start with /topics/");
    }

    if (senderId != null) {
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {
                try {
                    String token = getToken(senderId);
                    if (token != null) {
                        GcmPubSub.getInstance(TiApplication.getInstance()).unsubscribe(token, topic);

                        if (callback != null) {
                            // send success callback
                            HashMap<String, Object> data = new HashMap<String, Object>();
                            data.put("success", true);
                            data.put("topic", topic);
                            data.put("token", token);
                            callback.callAsync(getKrollObject(), data);
                        }
                    } else {
                        sendError(callback, "Cannot unsubscribe from topic " + topic);
                    }
                } catch (Exception ex) {
                    sendError(callback, "Cannot unsubscribe from topic " + topic + ": " + ex.getMessage());
                }
                return null;
            }
        }.execute();
    }
}
 
開發者ID:morinel,項目名稱:gcmpush,代碼行數:40,代碼來源:GCMModule.java

示例15: sendError

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void sendError(KrollFunction callback, String error) {
    Log.e(LCAT, error);
    if (callback != null) {
        HashMap<String, Object> data = new HashMap<String, Object>();
        data.put("success", false);
        data.put("error", error);

        callback.callAsync(getKrollObject(), data);
    }
}
 
開發者ID:morinel,項目名稱:gcmpush,代碼行數:11,代碼來源:GCMModule.java


注:本文中的org.appcelerator.kroll.common.Log.e方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。