【问题标题】:How to change Bluetooth storage location in Android?如何在 Android 中更改蓝牙存储位置?
【发布时间】:2014-08-09 18:23:21
【问题描述】:

我有一个应用程序。它用于使用蓝牙发送和接收文件。我的问题是,我希望更改默认位置以在运行时使用蓝牙存储文件。你能告诉我,这种情况有没有可能?

【问题讨论】:

    标签: android bluetooth file-transfer


    【解决方案1】:

    无法将其配置到 Android 4.1 Jelly Bean:

    使用随附的蓝牙接收器,您现在无法更改位置,因为它是硬编码的。您需要一个可以在此处配置的第三方应用程序,例如蓝牙文件传输。

    在 ./packages/apps/Bluetooth/src/com/android/bluetooth/opp/ 中可以看到。

    Constants.java 定义了这个:

    public static final String DEFAULT_STORE_SUBDIR = "/bluetooth";
    

    BluetoothOppReceiveFileInfo.java 没有位置开关:

    File receiveFile = new File(uniqueFileName);
    if (sDesiredStoragePath == null) {
        sDesiredStoragePath = Environment.getExternalStorageDirectory().getPath() +
            Constants.DEFAULT_STORE_SUBDIR;
    }
    

    【讨论】:

      猜你喜欢
      • 2016-07-05
      • 1970-01-01
      • 2017-01-26
      • 1970-01-01
      • 2013-03-06
      • 1970-01-01
      • 2016-11-06
      • 2022-01-17
      • 2020-12-27
      相关资源
      最近更新 更多