当前位置: 首页>>代码示例>>Java>>正文


Java Log.d方法代码示例

本文整理汇总了Java中com.github.snowdream.android.util.Log.d方法的典型用法代码示例。如果您正苦于以下问题:Java Log.d方法的具体用法?Java Log.d怎么用?Java Log.d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.snowdream.android.util.Log的用法示例。


在下文中一共展示了Log.d方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startAccept

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * Start the chat service. Specifically start AcceptThread to begin a
 * session in listening (server) mode. Called by the Activity onResume()
 */
public synchronized void startAccept() {
    Log.d(TAG, "BTS startAccept");

    // Cancel any thread attempting to make a connection
    if (mConnectThread != null) {
        mConnectThread.cancel();
        mConnectThread = null;
    }

    // Cancel any thread currently running a connection
    if (mConnectedThread != null) {
        mConnectedThread.cancel();
        mConnectedThread = null;
    }

    setState(STATE_LISTEN);

    // Start the thread to listen on a BluetoothServerSocket
    if (mSecureAcceptThread == null) {
        mSecureAcceptThread = new AcceptThread();
    }
    mSecureAcceptThread.start();
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:28,代码来源:BluetoothService.java

示例2: stop

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * Stop all threads
 */
public synchronized void stop() {
    Log.d(TAG, "BTS stop");

    if(cdt!=null)
        cdt.cancel();

    if (mConnectThread != null) {
        mConnectThread.cancel();
        mConnectThread = null;
    }

    if (mConnectedThread != null) {
        mConnectedThread.cancel();
        mConnectedThread = null;
    }

    if (mSecureAcceptThread != null) {
        mSecureAcceptThread.cancel();
        mSecureAcceptThread = null;
    }

    setState(STATE_NONE);
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:27,代码来源:BluetoothService.java

示例3: deletePreferences

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
private void deletePreferences() {
        TinyDB tinydb = new TinyDB(mContext);
//        String[] rolesName = tinydb.getListString(ROLES).toArray(new String[tinydb.getListString(ROLES).size()]);

        ArrayList<String> rolesName = tinydb.getListString(ROLES);

        Log.d("~", "[deletePreferences] roles length : " + rolesName.size());

        for (int i = 0; i < rolesName.size(); i++) {
            Log.d("~", "[deletePreferences] remove role : " + rolesName.get(i));

            SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
//            preferences.edit().remove(rolesName.get(i)).commit();
            tinydb.remove(rolesName.get(i));
        }
        tinydb.remove(ROLES);
        tinydb.remove(AdminPreferencesActivity.CURRENT_PERMISSIONS);
        tinydb.remove(AdminPreferencesActivity.CURRENT_ROLE);
    }
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:20,代码来源:BluetoothService.java

示例4: doDiscovery

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * Start device discover with the BluetoothAdapter
 */
private void doDiscovery() {
    Log.d(TAG, "doDiscovery()");

    // Indicate scanning in the title
    setProgressBarIndeterminateVisibility(true);
    setTitle(R.string.scanning);

    // Turn on sub-title for new devices
    findViewById(R.id.title_new_devices).setVisibility(View.VISIBLE);

    // If we're already discovering, stop it
    if (mBtAdapter.isDiscovering()) {
        mBtAdapter.cancelDiscovery();
    }

    // Request discover from BluetoothAdapter
    mBtAdapter.startDiscovery();
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:22,代码来源:DeviceListActivity.java

示例5: onReceive

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();

    Log.d(TAG, "[BroadcastReceiver] action : " + 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(/*BluetoothDevice.BOND_BONDED == device.getBondState() &&*/ !alreadyExistInList(mDiviceAdapter, device)){
            Log.d(TAG, "[BroadcastReceiver BluetoothDevice.BOND_BONDED]  : " + device.getName() + "\n" + device.getAddress());
            mDiviceAdapter.add(device.getName() + "\n" + device.getAddress());
        }
    } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
        setProgressBarIndeterminateVisibility(false);
        setTitle(R.string.select_device);
        if (mDiviceAdapter.getCount() == 0) {
            String noDevices = getResources().getText(R.string.none_found).toString();
            mDiviceAdapter.add(noDevices);
        }

        Log.d(TAG, "[BroadcastReceiver BluetoothAdapter.ACTION_DISCOVERY_FINISHED] devices count : " + mDiviceAdapter.getCount());
    }
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:27,代码来源:DeviceListActivity.java

示例6: connect

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * Start the ConnectThread to initiate a connection to a remote device.
 *
 * @param device The BluetoothDevice to connect
 */
public synchronized void connect(BluetoothDevice device, boolean isForms) {
    Log.d(TAG, "BTS connect to: " + device);
    this.isForms = isForms;

    // Cancel any thread attempting to make a connection
    if (mConnectThread != null) {
        mConnectThread.cancel();
        mConnectThread = null;
    }

    // Cancel any thread currently running a connection
    if (mConnectedThread != null) {
        mConnectedThread.cancel();
        mConnectedThread = null;
    }

    // Start the thread to connect with the given device
    mConnectThread = new ConnectThread(device);
    mConnectThread.start();
    setState(STATE_CONNECTING);

    //time limit for connection
    cdt = new CountDownTimer(CONNECTION_LIMIT *10000,10000) {
        @Override
        public void onTick(long millisUntilFinished) {}

        @Override
        public void onFinish() {
            if(getState()==STATE_CONNECTING) {
                stop();

                Message msg = mHandler.obtainMessage(Constants.MESSAGE_CONNECTION_LIMIT);
                mHandler.sendMessage(msg);
            }
        }
    };
    cdt.start();
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:44,代码来源:BluetoothService.java

示例7: connected

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * Start the ConnectedThread to begin managing a Bluetooth connection
 *
 * @param socket The BluetoothSocket on which the connection was made
 * @param device The BluetoothDevice that has been connected
 */
public synchronized void connected(BluetoothSocket socket, BluetoothDevice device) {
    Log.d(TAG, "BTS connected!");

    // Cancel the thread that completed the connection
    if (mConnectThread != null) {
        mConnectThread.cancel();
        mConnectThread = null;
    }

    // Cancel any thread currently running a connection
    if (mConnectedThread != null) {
        mConnectedThread.cancel();
        mConnectedThread = null;
    }

    // Cancel the accept thread because we only want to connect to one device
    if (mSecureAcceptThread != null) {
        mSecureAcceptThread.cancel();
        mSecureAcceptThread = null;
    }

    // Start the thread to manage the connection and perform transmissions
    mConnectedThread = new ConnectedThread(socket);
    mConnectedThread.start();

    setState(STATE_CONNECTED);

    //notify that we connected now
    Message msg = mHandler.obtainMessage(Constants.MESSAGE_CONNECTED);
    mHandler.sendMessage(msg);
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:38,代码来源:BluetoothService.java

示例8: getLogger

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
private static HttpLoggingInterceptor getLogger() {
    return new HttpLoggingInterceptor(new HttpLoggingInterceptor.Logger() {
        @Override
        public void log(String message) {
            Log.d(message);
        }
    });
}
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:9,代码来源:RetrofitAPI.java

示例9: getInjectLayoutId

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * get id of layout
 *
 * @param container the container of InjectLayout
 * @return the layout id
 */
public static int getInjectLayoutId(Object container) {
    InjectLayout injectLayout = container.getClass().getAnnotation(InjectLayout.class);
    if (injectLayout == null) {
        Log.d("Can not find annotation 'InjectLayout' on " + container.getClass().getName() + ".");
        return 0;
    }
    return injectLayout.value();
}
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:15,代码来源:LayoutInjectUtil.java

示例10: getInjectMenuId

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * get id of menu
 *
 * @param container
 * @return
 */
public static int getInjectMenuId(Object container) {
    InjectLayout injectLayout = container.getClass().getAnnotation(InjectLayout.class);
    if (injectLayout == null) {
        Log.d("Can not find annotation 'InjectLayout' on " + container.getClass().getName() + ".");
        return 0;
    }
    return injectLayout.menu();
}
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:15,代码来源:LayoutInjectUtil.java

示例11: deal

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
static void deal(ProceedingJoinPoint joinPoint) throws Throwable {
        try {

            IDialog iDialog = null;
            Object container = joinPoint.getTarget();

            Field[] fields = container.getClass().getFields();
            for (Field field : fields) {
                if (field.getAnnotation(LifeCircleInject.class) != null) {
                    if (IDialog.class.isAssignableFrom(field.getType())) {
                        iDialog = (IDialog) field.get(container);
                        iDialog.show();
                    }
                }
            }
            //proceed
            joinPoint.proceed();

            //after
            MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
            Method method = methodSignature.getMethod();
            SupportMethodLoading supportLoading = method.getAnnotation(SupportMethodLoading.class);
//        SupportMethodLoading supportLoading = (SupportMethodLoading) joinPoint.getSignature().getDeclaringType().getAnnotation(SupportMethodLoading.class);
            if (supportLoading != null && supportLoading.autoDismiss()) {
                if (iDialog != null) {
                    iDialog.dismiss();
                }
            }
            Log.d(joinPoint.getTarget().getClass().getName() + "." + joinPoint.getSignature().getName() + " finish");
        } catch (Exception e) {
            Log.e(e.getMessage());
        }
    }
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:34,代码来源:ASupportLoading.java

示例12: onCreate

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
@Override
public void onCreate(SQLiteDatabase db) {
    Log.d("onCreate(SQLiteDatabase db)");
}
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:5,代码来源:ZillaApplication.java

示例13: onUpgrade

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    Log.d("onUpgrade(SQLiteDatabase db)");
}
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:5,代码来源:ZillaApplication.java

示例14: onZillaAdapterButtonClick

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
@Override
public void onZillaAdapterButtonClick(Button button, int position) {
    User user = (User) adapter.getItem(position);
    Log.d(user.toString());
}
 
开发者ID:zillachan,项目名称:LibZilla,代码行数:6,代码来源:ListViewTestActivity.java

示例15: setState

import com.github.snowdream.android.util.Log; //导入方法依赖的package包/类
/**
 * Set the current state of the chat connection
 *
 * @param state An integer defining the current connection state
 */
private synchronized void setState(int state) {
    Log.d(TAG, "BTS setState() " + mState + " -> " + state);
    mState = state;
}
 
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:10,代码来源:BluetoothService.java


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