【发布时间】:2014-08-09 18:23:21
【问题描述】:
我有一个应用程序。它用于使用蓝牙发送和接收文件。我的问题是,我希望更改默认位置以在运行时使用蓝牙存储文件。你能告诉我,这种情况有没有可能?
【问题讨论】:
标签: android bluetooth file-transfer
我有一个应用程序。它用于使用蓝牙发送和接收文件。我的问题是,我希望更改默认位置以在运行时使用蓝牙存储文件。你能告诉我,这种情况有没有可能?
【问题讨论】:
标签: android bluetooth file-transfer
无法将其配置到 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;
}
【讨论】: