Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9076149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:02:49+00:00 2026-06-16T19:02:49+00:00

I have device which sends data via Bluetooth using OBEX Object Push Profile (OPP).

  • 0

I have device which sends data via Bluetooth using OBEX Object Push Profile (OPP).

Using adb logcat i see that my android device receives a connection (but abort this connection?)

08-22 11:14:37.939: I/BtOppRfcommListener(22586): Accepted connectoin from 00:07:CF:5F:52:A0
08-22 11:14:37.939: I/BtOpp Service(22586): Start Obex Server
08-22 11:14:38.109: D/Obex ServerSession(22586): java.io.IOException: Software caused connection abort
08-22 11:14:38.109: D/PowerManagerService(180): @PowerManagement: 'BtOppObexServer' releaseWakeLock when screen locked
08-22 11:14:39.219: D/BluetoothEventLoop(180): Device property changed: 00:07:CF:5F:52:A0 property: Connected value: false

When I install Bluetooth File Transfer (Free application from market) then i’m able to receive files.
But I wouldn’t like to install other application.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:02:50+00:00Added an answer on June 16, 2026 at 7:02 pm

    I believe I have (at least a partial) solution which should then allow files to be intercepted via OPP and custom code added. The first step is to go to settings > apps > running > Bluetooth Share and kill the BluetoothOppService

    Then I used reflection to access a method on BluetoothAdapter (code below) which allows listening on a specific port. After which we can intercept the incoming OPP communication and interact with the input and output streams. This SO thread will help with the OPP communication part, but as an initial step I read the data stream and reponded with an OPP ‘OK’ message ie os.writeByte(ObexSession.OBEX_SUCCESS | ObexSession.OBEX_FINAL_BIT);

    // simplified exception handling
    public class BluetoothAdapterProxy
    {
        public static final int CHANNEL_OPP = 12;
    
        final BluetoothAdapter target;
        static final Class<?> targetClass = BluetoothAdapter.class;
        Method listenOn;
    
        public BluetoothAdapterProxy(BluetoothAdapter target)
        {
            this.target = target;
            Class<?>[] args = new Class[] { int.class };
            try
            {
                this.listenOn = targetClass.getDeclaredMethod(
                    "listenUsingRfcommOn", args);
            }
            catch (NoSuchMethodException e)
            {
                e.printStackTrace();
            }
        }
    
        public BluetoothServerSocket listenUsingRfcommOn(int channel)
        {
            try
            {
                return (BluetoothServerSocket) (listenOn.invoke(target, 
                    new Object[] { channel }));
            }
            catch (Exception e)
            {
                // complain loud, complain long
                throw new RuntimeException(ex);
            }
        }
    }
    

    Usage: initialise using

    serverSocket = new BluetoothAdapterProxy(BluetoothAdapter.getDefaultAdapter())
        .listenUsingRfcommOn(BluetoothAdapterProxy.CHANNEL_OPP);
    

    After which, use the following from a separate Thread (to prevent blocking) and remote devices can connect via socket = serverSocket.accept();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one device which sends data on COM port say on COM13. Now
I have a GPS device which sends data to my server, I need to
I am writing an application which sends data to bluetooth printer. Can anyone help
I have a device which when a certain application is on send data to
I have a external device which sends events to the UI and I change
I am using Web2Py to create a simple app which sends Push notifications through
I have a custom made device with which I send/receive data trough the serial
I have a USB GSM device which I use for Internet connection as well
I have to communicate with a device which listens on a port for all
HI, I have a device that exposes a telnet interface which you can log

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.