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


Java Log.i方法代碼示例

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


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

示例1: openURL

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method
public boolean openURL(KrollDict options) {
	if ( (options != null) && options.containsKeyAndNotNull(Params.URL)) {
		Context context = TiApplication.getAppCurrentActivity();
		List<ResolveInfo> browsersList = Utils.allBrowsers(context);
		
		if (!browsersList.isEmpty()) {
			List<String> customTabBrowsers = getCustomTabBrowsers(context, browsersList);				
			
			// show supported browsers list or open directly if only 1 supported browser is available
			openCustomTab(context, customTabBrowsers, options);
	        
			return true;
			
		} else {
			Log.i(Params.LCAT, "No browsers available in this device.");
			return false;
		}
	}
	
	Log.i(Params.LCAT, "Check your paramters. URL parameter is mandatory.");
	return false;
}
 
開發者ID:prashantsaini1,項目名稱:ti-chrometabs,代碼行數:24,代碼來源:TichrometabsModule.java

示例2: isHTCSenseDevice

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
private boolean isHTCSenseDevice()
{
	boolean isHTC = false;
	
	FeatureInfo[] features = TiApplication.getInstance().getApplicationContext().getPackageManager().getSystemAvailableFeatures();
	if(features == null) { 
		return isHTC;
	}
	for (FeatureInfo f : features) {
		String fName = f.name;
		if (fName != null) {
			isHTC = fName.contains("com.htc.software.Sense");
			if (isHTC) {
				Log.i(TAG, "Detected com.htc.software.Sense feature "+fName);
				break;
			}
		}
	}
	
	return isHTC;
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:22,代碼來源:TiUIWebView.java

示例3: onConsoleMessage

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
public boolean onConsoleMessage(ConsoleMessage message)
{
	switch (message.messageLevel()) {
		case DEBUG:
			Log.d(CONSOLE_TAG, message.message() + " (" + message.lineNumber() + ":" + message.sourceId() + ")");
			break;
		default:
			Log.i(CONSOLE_TAG, message.message() + " (" + message.lineNumber() + ":"+ message.sourceId() + ")");
			break;
	}
	return true;
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:14,代碼來源:TiWebChromeClient.java

示例4: listenerAdded

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void listenerAdded(String type, int count, KrollProxy proxy){
	super.listenerAdded(type, count, proxy);
	Log.i(LCAT, "listenerAdded");
	try {
		sendQueuedNotification();
	} catch (JSONException e) {
		Log.d(LCAT, "sendQueuedNotificationError" + e);
	}
}
 
開發者ID:dieskim,項目名稱:countly-sdk-appcelerator-titanium-android,代碼行數:10,代碼來源:TitaniumCountlyAndroidMessagingModule.java

示例5: cancelNotificationById

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
/**
 * Cancel a notification by the id given in the payload.
 * @param notificationId
 */
@Kroll.method
public void cancelNotificationById(int notificationId) {
    try {
        NotificationManager notificationManager = (NotificationManager) TiApplication.getInstance().getApplicationContext().getSystemService(TiApplication.NOTIFICATION_SERVICE);
        notificationManager.cancel(notificationId);
        Log.i(LCAT, "Notification " + notificationId + " cleared successfully");
    } catch (Exception ex) {
        Log.e(LCAT, "Cannot cancel notification:" + notificationId + " Error: " + ex.getMessage());
    }
}
 
開發者ID:morinel,項目名稱:gcmpush,代碼行數:15,代碼來源:GCMModule.java

示例6: checkPlayServices

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
private boolean checkPlayServices(Activity activity) {
    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(TiApplication.getInstance().getApplicationContext());
    if (resultCode != ConnectionResult.SUCCESS) {
        if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
            GooglePlayServicesUtil.getErrorDialog(resultCode, activity, PLAY_SERVICES_RESOLUTION_REQUEST).show();
        } else {
            Log.i(TAG, "This device is not supported.");
            TiApplication.getAppCurrentActivity().finish();
        }
        return false;
    }
    return true;
}
 
開發者ID:hyperlab,項目名稱:TiAndroidNotifications,代碼行數:14,代碼來源:TiGCMModule.java

示例7: onHandleIntent

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
protected void onHandleIntent(Intent intent) {
    try {
        String senderId = TiApplication.getInstance().getAppProperties().getString(TiGCMModule.PROPERTY_SENDER_ID, "");
        InstanceID instanceID = InstanceID.getInstance(this);
        String token = instanceID.getToken(senderId, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
        Log.i(TAG, "GCM Registration Token: " + token);
        TiGCMModule.getInstance().fireRegister(token);
    } catch (Exception e) {
        Log.d(TAG, "Failed to complete token refresh", e);
        e.printStackTrace();
        TiGCMModule.getInstance().fireError("Failed to complete token refresh.");
    }
}
 
開發者ID:hyperlab,項目名稱:TiAndroidNotifications,代碼行數:15,代碼來源:RegistrationIntentService.java

示例8: MoventoWebviewAndroidModule

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public MoventoWebviewAndroidModule()
{
	super();
	Log.i(TAG, "MoventoWebviewAndroidModule");
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:6,代碼來源:MoventoWebviewAndroidModule.java

示例9: shouldOverrideUrlLoading

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
public boolean shouldOverrideUrlLoading(final WebView view, String url)
{
	Log.d(TAG, "url=" + url, Log.DEBUG_MODE);

	if (webView.getProxy().hasProperty(TiC.PROPERTY_BLACKLISTED_URLS)) {
	    String [] blacklistedSites = TiConvert.toStringArray((Object[])webView.getProxy().getProperty(TiC.PROPERTY_BLACKLISTED_URLS));
	    for(String site : blacklistedSites) {
	        if (url.equalsIgnoreCase(site) || (url.indexOf(site) > -1)) {
	            KrollDict data = new KrollDict();
	            data.put("url", url);
	            data.put("message", "Webview did not load blacklisted url.");
	            webView.getProxy().fireEvent(TiC.PROPERTY_ON_STOP_BLACKISTED_URL, data);
	            return true;
	        }
	    }
	}

	if (URLUtil.isAssetUrl(url) || URLUtil.isContentUrl(url) || URLUtil.isFileUrl(url)) {
		// go through the proxy to ensure we're on the UI thread
		webView.getProxy().setPropertyAndFire(TiC.PROPERTY_URL, url);
		return true;
	} else if(url.startsWith(WebView.SCHEME_TEL)) {
		Log.i(TAG, "Launching dialer for " + url, Log.DEBUG_MODE);
		Intent dialer = Intent.createChooser(new Intent(Intent.ACTION_DIAL, Uri.parse(url)), "Choose Dialer");
		webView.getProxy().getActivity().startActivity(dialer);
		return true;
	} else if (url.startsWith(WebView.SCHEME_MAILTO)) {
		Log.i(TAG, "Launching mailer for " + url, Log.DEBUG_MODE);
		Intent mailer = Intent.createChooser(new Intent(Intent.ACTION_SENDTO, Uri.parse(url)), "Send Message");
		webView.getProxy().getActivity().startActivity(mailer);
		return true;
	} else if (url.startsWith(WebView.SCHEME_GEO)) {
		Log.i(TAG, "Launching app for " + url, Log.DEBUG_MODE);
		/*geo:latitude,longitude
		geo:latitude,longitude?z=zoom
		geo:0,0?q=my+street+address
		geo:0,0?q=business+near+city
		*/
		Intent geoviewer = Intent.createChooser(new Intent(Intent.ACTION_VIEW, Uri.parse(url)), "Choose Viewer");
		webView.getProxy().getActivity().startActivity(geoviewer);
		return true;
	} else {
		String extension = MimeTypeMap.getFileExtensionFromUrl(url);
		String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
		if (mimeType != null) {
			return shouldHandleMimeType(mimeType, url);
		}
		return super.shouldOverrideUrlLoading(view, url);
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:52,代碼來源:TiWebViewClient.java


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