0

As the title says,

Is it possible to programmatically delete the Bluetooth received file list?

And if yes then, please provide a reference or a piece of code.

Thanks in advance

Ex: In the below picture I have only one item. Is it possible to delete it programmatically enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • 1
    get the bluetooth directory path and delete those files [get the path](https://stackoverflow.com/questions/12087952/bluetooth-folder-different-path-on-different-phones). [Delete file](https://stackoverflow.com/questions/24659704/how-do-i-delete-files-programmatically-on-android) – Jyoti JK Feb 13 '18 at 12:07
  • @Developer Just tested your suggestion and it didn't work. The code deleted all the files including the Bluetooth folder. But I can still see the information in the history – Greşanu Emanuel - Vasile Feb 13 '18 at 12:53
  • Here is the link ( https://drive.google.com/file/d/1GwHty6j1mSHCWXRbhs3glyk-zYRI5_Tb/view?usp=sharing ) to the implementation. From the above comment. – Greşanu Emanuel - Vasile Feb 13 '18 at 13:02

1 Answers1

1

I had found so far two ways to make the programmatically delete the Bluetooth recent history list. Solution 1: (That works) Is to run the command pm clear com.android.bluetooth

Solution 2: (Requires more work) I am trying to use in Android Manifest:

<uses-permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE" />

And in the Java code:

getApplicationContext().getContentResolver().delete(Uri.parse("content://com.android.bluetooth.opp/btopp"), null, null);

And

getApplicationContext().getContentResolver().delete(Uri.parse("content://com.android.bluetooth.opp/btopp3"), null, null);