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


Java BluetoothSwap類代碼示例

本文整理匯總了Java中org.fdroid.fdroid.localrepo.type.BluetoothSwap的典型用法代碼示例。如果您正苦於以下問題:Java BluetoothSwap類的具體用法?Java BluetoothSwap怎麽用?Java BluetoothSwap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: onCreate

import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
public void onCreate() {
    super.onCreate();

    Utils.debugLog(TAG, "Creating swap service.");
    startForeground(NOTIFICATION, createNotification());

    CacheSwapAppsService.startCaching(this);

    SharedPreferences preferences = getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE);

    appsToSwap.addAll(deserializePackages(preferences.getString(KEY_APPS_TO_SWAP, "")));
    bluetoothSwap = BluetoothSwap.create(this);
    wifiSwap = new WifiSwap(this);

    Preferences.get().registerLocalRepoHttpsListeners(httpsEnabledListener);

    LocalBroadcastManager.getInstance(this).registerReceiver(onWifiChange, new IntentFilter(WifiStateChangeService.BROADCAST));

    IntentFilter filter = new IntentFilter(BLUETOOTH_STATE_CHANGE);
    filter.addAction(WIFI_STATE_CHANGE);
    LocalBroadcastManager.getInstance(this).registerReceiver(receiveSwapStatusChanged, filter);

    /*
    if (wasBluetoothEnabled()) {
        Utils.debugLog(TAG, "Previously the user enabled Bluetooth swap, so enabling again automatically.");
        bluetoothSwap.startInBackground();
    }
    */

    if (wasWifiEnabled()) {
        Utils.debugLog(TAG, "Previously the user enabled WiFi swap, so enabling again automatically.");
        wifiSwap.startInBackground();
    } else {
        Utils.debugLog(TAG, "WiFi was NOT enabled last time user swapped, so starting with WiFi not visible.");
    }
}
 
開發者ID:uhuru-mobile,項目名稱:mobile-store,代碼行數:37,代碼來源:SwapService.java

示例2: onCreate

import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
public void onCreate() {
    super.onCreate();

    Utils.debugLog(TAG, "Creating swap service.");

    SharedPreferences preferences = getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE);

    appsToSwap.addAll(deserializePackages(preferences.getString(KEY_APPS_TO_SWAP, "")));
    bluetoothSwap = BluetoothSwap.create(this);
    wifiSwap = new WifiSwap(this);

    Preferences.get().registerLocalRepoHttpsListeners(httpsEnabledListener);

    LocalBroadcastManager.getInstance(this).registerReceiver(onWifiChange, new IntentFilter(WifiStateChangeService.BROADCAST));

    IntentFilter filter = new IntentFilter(BLUETOOTH_STATE_CHANGE);
    filter.addAction(WIFI_STATE_CHANGE);
    LocalBroadcastManager.getInstance(this).registerReceiver(receiveSwapStatusChanged, filter);

    /*
    if (wasBluetoothEnabled()) {
        Utils.debugLog(TAG, "Previously the user enabled Bluetooth swap, so enabling again automatically.");
        bluetoothSwap.startInBackground();
    }
    */

    if (wasWifiEnabled()) {
        Utils.debugLog(TAG, "Previously the user enabled WiFi swap, so enabling again automatically.");
        wifiSwap.startInBackground();
    } else {
        Utils.debugLog(TAG, "WiFi was NOT enabled last time user swapped, so starting with WiFi not visible.");
    }
}
 
開發者ID:CmDnoEdition,項目名稱:fdroid,代碼行數:34,代碼來源:SwapService.java

示例3: getName

import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
@Override
public String getName() {
    return device.getName().replaceAll("^" + BluetoothSwap.BLUETOOTH_NAME_TAG, "");
}
 
開發者ID:uhuru-mobile,項目名稱:mobile-store,代碼行數:5,代碼來源:BluetoothPeer.java

示例4: BluetoothServer

import org.fdroid.fdroid.localrepo.type.BluetoothSwap; //導入依賴的package包/類
public BluetoothServer(BluetoothSwap swap, File webRoot) {
    this.webRoot = webRoot;
    this.swap = swap;

    start();
}
 
開發者ID:uhuru-mobile,項目名稱:mobile-store,代碼行數:7,代碼來源:BluetoothServer.java


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