How to accept bluetooth received file in Android application?

how to send files via bluetooth android
bluetooth file transfer android to iphone
bluetooth file transfer (pc)
how to send files via bluetooth iphone
how to send files from phone to laptop via bluetooth windows 10
transfer files from android to pc bluetooth
bluetooth android to ipad
auto accept bluetooth file transfers android

I would like to implement an application to receive a file from a Bluetooth device.

Before receiving, a notification will be raised to accept an incoming file request.

From there, i would like to activate "accept" and download the file automatically without raising an accept dialog when the user receive a second file from another Bluetooth paired device, without notification disturbance when the user launchs an application.

I developed an app that include this kind of task, and you can use BluetoothChat example. You must set the secure flag to false: ` boolean secure = false;

        try {
            if (secure) {
                tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME_SECURE,
            } else {
                tmp = mAdapter.listenUsingInsecureRfcommWithServiceRecord(
                        NAME_INSECURE, MY_UUID_INSECURE);
        } catch (IOException e) {
            Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);

        mmServerSocket = tmp;

And then read the buffer from the InputStream that you can find in ConnectedThread:

while (true) {
            try {

                bytes =;
                 /*write bytes in a file*/

            } catch (IOException e) {
                Log.e(TAG, "disconnected", e);


How to accept bluetooth received file in Android application?, The way Bluetooth is implemented across various Android smartphones can differ. But while the UI may not look the same the underlying principles are identical. Sending the files. Now locate the file that you to send over Bluetooth. Hit the Share button and tap the Bluetooth icon from the list that opens. When you choose Bluetooth you need to click Scan for Devices and the phone will begin scanning for nearby Bluetooth-enabled devices.

You can try using the Bluetooth socket connection to set a client server TCP like connection.

How to send and receive files over Bluetooth on an Android phone, Bluetooth file transfer makes it easy to wirelessly send documents, photos, The directions below should generally apply to iPhone and Android, regardless of The receiving device is visible (discoverable) to other devices. I was wondering if there was a way to accept every incoming Bluetooth file transfers on the android without tapping on "Yes I agree to accept the incoming file" So, whenever someone sends my android device with a file, I do not need to agree/accept. It will automatically receive it.

ON ROOTED DEVICES, You can just install only two apps on your phone to achieve your goal.

  1. XPosed Installer
  2. Auto-Accept

This way you hook System service.

import android.util.*;

import static;

public class Tutorial implements IXposedHookLoadPackage

    private String TAG="TUTORIAL";
    public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
        if (!lpparam.packageName.equals(""))
            Log.i(TAG,"Not: "+lpparam.packageName);
        Log.i(TAG,"Yes "+lpparam.packageName);  

        findAndHookMethod("", lpparam.classLoader, "isWhitelisted", String.class,new XC_MethodHook() {
                protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                    Log.v(TAG,"HOOK DONE");
                    param.setResult(true); /* you can compare the sender address(String) with your computer and determine if you return true or just allow the original method to be called after this returns.*/



For more information, please visit my answer in SO.

I'll post some direct links here.


Dropbox link of the auto accepting app

Dropbox link of the project files (zip)

Xposed apk site

Towelroot site to root your phone

Auto-Accept github repository

Send & Receive ANY Type of File Over Bluetooth, If you want to view files that have been received through Bluetooth, then follow the steps i will mention below. 1. If your phone has an app drawer, then open it  Receive files on Windows 10 from Android. After selecting “Receive files” in Windows, choose the “Share” option for any file on the Android device, then select “Bluetooth“. From the Android, select the Windows 10 PC as the you want to send to. The file should successfully be received on the Windows device.

How to Use Bluetooth to Transfer Files Between Devices, Select “Send or receive files via Bluetooth” from the Windows 10 device. Choose “Send files” to How to Transfer Apps from Your Old Android · How to Transfer  For Android Beam file transfer, the directory path points to the location of the other transferred files, if any. To get the directory path, get the path part of the URI, which contains all of the URI except the file: prefix. Create a File from the path part, then get the parent path of the File :

How to see sent files via Bluetooth in my Android Phone, Now that you're connected, you can start sending and receiving files. Open up the Bluetooth app (in this case, Blueman); Set the device to  To set up a Bluetooth file transfer between smartphones, tablets, and PCs, enable Bluetooth (and visibility), then send the desired files. If a desktop or laptop is involved, set up (or pair) the mobile device to the computer before transferring files over Bluetooth.

Transfer Files Between Android & Windows 10 Via Bluetooth , For example, an application could receive broadcasts that indicate a connected device's battery level and could notify the user or take other  Settings/bluetooth/received files shows the file; select open, it tells me the size and type of file but won't let me do a go_÷=%_€ed thing with it. Tried installing some app that supposedly facilitates bluetooth file transfers, it tried to transfer EVERYTHING on my device. Uninstalled that POS pronto. REALLY frustrated here.

  • Check if this helps:…
  • @Gelvis You need to kill the system service that accepts connection primarily.