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


Java Log.d方法代碼示例

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


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

示例1: onReceive

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    Log.d(LCAT,  action);
    // When discovery finds a device
    if (BluetoothDevice.ACTION_FOUND.equals(action)) {
        // Get the BluetoothDevice object from the Intent
        BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
        if(device != null)
        {
        	Log.d(LCAT,  device.getName());
        	Log.d(LCAT,  "Adding device to array.");
         // Add the name and address to an array adapter to show in a ListView
         mArray[counter] = device;
         counter++;
        }
    }
}
 
開發者ID:eyesore,項目名稱:appc-android-bluetooth,代碼行數:18,代碼來源:BluetoothService.java

示例2: reload

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void reload()
{
	switch (reloadMethod) {
	case DATA:
		if (reloadData != null && reloadData instanceof TiBlob) {
			setData((TiBlob) reloadData);
		} else {
			Log.d(TAG, "reloadMethod points to data but reloadData is null or of wrong type. Calling default", Log.DEBUG_MODE);
			getWebView().reload();
		}
		break;
		
	case HTML:
		if (reloadData == null || (reloadData instanceof HashMap<?,?>) ) {
			setHtml(TiConvert.toString(getProxy().getProperty(TiC.PROPERTY_HTML)), (HashMap<String,Object>)reloadData);
		} else {
			Log.d(TAG, "reloadMethod points to html but reloadData is of wrong type. Calling default", Log.DEBUG_MODE);
			getWebView().reload();
		}
		break;
	
	case URL:
		if (reloadData != null && reloadData instanceof String) {
			setUrl((String) reloadData);
		} else {
			Log.d(TAG, "reloadMethod points to url but reloadData is null or of wrong type. Calling default", Log.DEBUG_MODE);
			getWebView().reload();
		}
		break;
		
	default:
		getWebView().reload();
	}
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:35,代碼來源:TiUIWebView.java

示例3: onMessageReceived

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Override
public void onMessageReceived(String from, Bundle rawData) {
    Log.d(TAG, "Received message from: " + from);
    HashMap<String, Object> data = CttimekogcmModule.bundleToHashMap(rawData);

    boolean forceCreateNotification = false;
    if (data.containsKey("forceCreateNotification")) {
        if (data.get("forceCreateNotification").equals("true")) {
            forceCreateNotification = true;
        }
    }

    try {
        CttimekogcmModule module = CttimekogcmModule.getInstance();
        if(module != null && !forceCreateNotification) {
            if(KrollRuntime.isInitialized() && TiApplication.isCurrentActivityInForeground()) {
                module.fireMessage(data, true);
                return;
            }
        }
    } catch (Exception e) {
        Log.d(TAG, "Couldn't send fireMessage to CttimekogcmModule");
    }

    NotificationPublisher.createNotification(this, data);
}
 
開發者ID:a-voityuk,項目名稱:CTTimekoGCM,代碼行數:27,代碼來源:ListenerService.java

示例4: clearSchedule

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method
public void clearSchedule() {
    TiApplication app = TiApplication.getInstance();

    int ntfCount = app.getAppProperties().getInt(PROPERTY_NOTIFICATION_COUNTER, 0);

    Log.d(TAG, "Clearing " + ntfCount + " notifications");

    if(ntfCount > 0) {
        Intent intent = new Intent(app.getApplicationContext(), NotificationPublisher.class);
        for(int i = 0; i < ntfCount; i++) {
            PendingIntent pendingIntent = PendingIntent.getBroadcast(app.getApplicationContext(), i, intent, PendingIntent.FLAG_ONE_SHOT);
            AlarmManager alarmManager = (AlarmManager)app.getApplicationContext().getSystemService(Context.ALARM_SERVICE);
            alarmManager.cancel(pendingIntent);
            pendingIntent.cancel();
        }

        app.getAppProperties().setInt(PROPERTY_NOTIFICATION_COUNTER, 0);
    }
}
 
開發者ID:a-voityuk,項目名稱:CTTimekoGCM,代碼行數:21,代碼來源:CttimekogcmModule.java

示例5: connectBluetooth

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void connectBluetooth()
 {
	if (mBluetoothAdapter == null)
	{
	    Log.d(LCAT, "********** Device does not support Bluetooth");
	    mModule.sendMessage("This device does not support bluetooth.");
	}
	else if(mBluetoothAdapter.isEnabled())
	{
	    Log.d(LCAT, "********** Bluetooth is enabled");
	    mModule.sendMessage("Bluetooth is already enabled!");
	}
	else
	{
		Log.d(LCAT, "********** Bluetooth is disabled");
		Log.d(LCAT, "********** Attempting to enable Bluetooth");
		Intent intentBluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
		intentBluetooth.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

		mContext.startActivity(intentBluetooth);
	}
}
 
開發者ID:eyesore,項目名稱:appc-android-bluetooth,代碼行數:23,代碼來源:BluetoothService.java

示例6: 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

示例7: BluetoothClientThread

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public BluetoothClientThread(BluetoothConnection connection)
{
 super();
 Log.d(LCAT, "Creating new Client thread.");
 mConnection = connection;
 mDevice = connection.getDevice();
 try{
	 // using reflection in an effort to make it work - no different from calling createRfcommSocketToServiceRecord directly
	 Class<?> cls = Class.forName("android.bluetooth.BluetoothDevice");
	 Class<?> arg = Class.forName("java.util.UUID");
	 java.lang.reflect.Method method = cls.getMethod("createRfcommSocketToServiceRecord", new Class[]{arg});
	 mSocket = (BluetoothSocket) method.invoke(mDevice, mConnection.getServiceId().mUuid);

	 //mSocket = mDevice.createRfcommSocketToServiceRecord(mConnection.getServiceId().mUuid);
	 start();
 }
 catch(Exception e){
	 e.printStackTrace();
	 mConnection.relayError(e.getMessage());
 }
}
 
開發者ID:eyesore,項目名稱:appc-android-bluetooth,代碼行數:22,代碼來源:BluetoothClientThread.java

示例8: onAppCreate

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.onAppCreate
public static void onAppCreate(TiApplication app)
{
    String appId = TiApplication.getInstance().getAppProperties().getString(ParseModule.PROPERTY_APP_ID, "");
    String clientKey = TiApplication.getInstance().getAppProperties().getString(ParseModule.PROPERTY_CLIENT_KEY, "");
    String serverUrl = TiApplication.getInstance().getAppProperties().getString(ParseModule.PROPERTY_SERVER_URL, "");

    Log.d(TAG, "Initializing with: " + appId + ", " + clientKey + ", " + serverUrl);
    Parse.initialize(new Parse.Configuration.Builder(TiApplication.getInstance())
     .applicationId(appId)
     .clientKey(clientKey)
     .server(serverUrl + "/") // The trailing slash is important.
     .build()
 );
}
 
開發者ID:gimdongwoo,項目名稱:Titanium-Parse-Android,代碼行數:16,代碼來源:ParseModule.java

示例9: interceptOnBackPressed

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public boolean interceptOnBackPressed()
{
	if (mCustomView != null) {
		onHideCustomView();
		if (Log.isDebugModeEnabled()) {
			Log.d(TAG, "WebView intercepts the OnBackPressed event to close the full-screen video.");
		}
		return true;
	}
	return false;
}
 
開發者ID:chreck,項目名稱:movento-webview,代碼行數:12,代碼來源:TiWebChromeClient.java

示例10: getServiceList

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void getServiceList(String deviceAddress)
{
	BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(deviceAddress);
	Log.d(LCAT, device.getName());
	try{
		String[] services = getServiceDescriptions(servicesFromDevice(device));
		mModule.servicesFound(services);
	}
	catch(Exception e)
	{
		e.printStackTrace();
		mModule.sendError(e.getMessage());
	}
}
 
開發者ID:eyesore,項目名稱:appc-android-bluetooth,代碼行數:15,代碼來源:BluetoothService.java

示例11: onAppCreate

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.onAppCreate
public static void onAppCreate(TiApplication app)
{
	Log.d(TAG, "inside onAppCreate");
	
       if(!app.getAppProperties().hasProperty(PROPERTY_NOTIFICATION_COUNTER)) {
           app.getAppProperties().setInt(PROPERTY_NOTIFICATION_COUNTER, 0);
       }
}
 
開發者ID:a-voityuk,項目名稱:CTTimekoGCM,代碼行數:10,代碼來源:CttimekogcmModule.java

示例12: fireMessage

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void fireMessage(HashMap<String, Object> message, boolean appInForeground) {
    try {
        Log.d(TAG, "Fire message callback");
        if(messageCallback != null) {
            HashMap<String, Object> push = new HashMap<String, Object>();
            push.put("appInForeground", appInForeground);
            push.put(KEY_DATA, message);
            messageCallback.call(getKrollObject(), push);
            Log.d(TAG, "onMessage was called");
        }
    } catch (Exception e) {
        Log.d(TAG, "Couldn't send fireMessage");
    }
}
 
開發者ID:a-voityuk,項目名稱:CTTimekoGCM,代碼行數:15,代碼來源:CttimekogcmModule.java

示例13: abortPairing

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
public void abortPairing()
{
	Log.d(LCAT, "Aborting pair process");
	try {
		mServerSocket.close();
	}
	catch(IOException e){
		e.printStackTrace();
		mConnection.relayError(e.getMessage());
	}
	Log.d(LCAT, "Pairing aborted.");
}
 
開發者ID:eyesore,項目名稱:appc-android-bluetooth,代碼行數:13,代碼來源:BluetoothServerThread.java

示例14: handleRequest

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
private boolean handleRequest(String[] permissions, Integer requestCode, KrollFunction permissionCallback) {
	Activity activity = TiApplication.getAppCurrentActivity();

	if (!(activity instanceof TiBaseActivity)) {
		Log.w(LCAT,	"Requesting permission from non-Titanium activity - not supported");
		return false;
	}

	TiBaseActivity currentActivity = (TiBaseActivity) activity;
	// Do we need a callback and request code in any case?
	if (requestCode == null) {
		Log.d(LCAT, "No request code given - Ti Permissions module will generate one");
		requestCode = currentActivity.getUniqueResultCode();
	}

	// register callback in current activity
	// TODO what is the exact purpose of the context? We should provide the Activity's Proxy, not the module object
	KrollObject context = currentActivity.getActivityProxy().getKrollObject();

	Log.d(LCAT, "Registering callback");
	currentActivity.registerPermissionRequestCallback(requestCode, 
			permissionCallback, context,permissions);

	Log.d(LCAT, "Calling permission request");
	ActivityCompat.requestPermissions(activity,	permissions, requestCode);
	return true;
}
 
開發者ID:stgrosshh,項目名稱:tipermissions,代碼行數:28,代碼來源:TipermissionsModule.java

示例15: startMessaging

import org.appcelerator.kroll.common.Log; //導入方法依賴的package包/類
@Kroll.method
public void startMessaging(String apiKey,String url,String projectID) {
	
	Log.d(LCAT, "Start Messaging called");
	
	Countly.sharedInstance()
	.init(TiApplication.getAppCurrentActivity(),url, apiKey, null, DeviceId.Type.ADVERTISING_ID)
	.initMessaging(TiApplication.getAppCurrentActivity(), TiApplication.getAppRootOrCurrentActivity().getClass(), projectID, Countly.CountlyMessagingMode.PRODUCTION);
	
	Countly.sharedInstance().onStart();
}
 
開發者ID:dieskim,項目名稱:countly-sdk-appcelerator-titanium-android,代碼行數:12,代碼來源:TitaniumCountlyAndroidMessagingModule.java


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