当前位置: 首页>>代码示例>>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;未经允许,请勿转载。