Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
We've created an app, which is like a Bluetooth SPP terminal. You can send a command to a connected Bluetooth device and the apps adds incoming messages to a TextView.
Problem is that when reading the InputStream of the BluetoothSocket suddenly doesn't receive any data anymore, where the data set the device is sending isn't complete yet (our end-of-file line isn't received, it stops halfway).
We built the exact same app in Java using Android SDK, this app does reach the end of file line.
I’ve included two example projects in the attachment archive. One in c#/xamarin and one in java. The app in java works as expected, when I connect to a device and send a command, it keeps receiving data from the Bluetooth device, until I see the end of file line.
The Xamarin app is the same code, but converted to C#/Xamarin. After I send a command to the Bluetooth device ,I do receive data back from it, but it stops suddenly and I never receive data again.
Steps to reproduce:
The BluetoothDeviceName should be the name (devicename, not the mac address) of the device you’re going to connect with. It should’ve been paired via the Android settings menu before running the app. Since this is an testing app I didn’t want to deal with the device discovery process in the app.
We are connecting to a device, but the problem occurs using any Bluetooth device. As an example we tried connecting with a pc that sends back a large amount of data after receiving a command.
After the BluetoothDeviceName has been set, and the app is running on a device, you should be able to connect to the bluetooth device by clicking the ‘Connect’ button. When the connecting process has been successful the button text changes to ‘Disconnect’.
After that we send a command to the device by typing it in the top edittext, and clicking send button. The device will receive our command and start sending a large amount of data. The last line contains an end of file code.
The app will then start receiving data and show it in the textview. (this process may be a little bit slow, since it is a test app and we didn’t want to spend time on working out ui things properly, just tried getting the connection to work).
After it’s done we see it stopped before the end-of-file line, the last line it’s showing is not complete either.
The included Java app has the same code as the Xamarin app (we converted the Java app to Xamarin) but the Java app does receive the entire file, as we can see the end-of-file line.
Visual Studio Professional 2012 update 4
Tested on Android devices running Android 5.0 and 4.4
Created attachment 10467 [details]
Unfortunately, the provided URL is no longer valid. :-(
Could you please make it available again?
Created attachment 10747 [details]
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.