Bug 15899 - Bluetooh insecure connection - Library missing a method
Summary: Bluetooh insecure connection - Library missing a method
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.10.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-11-04 07:53 UTC by Ing Williams Aguilera
Modified: 2013-11-04 09:21 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED INVALID

Description Ing Williams Aguilera 2013-11-04 07:53:07 UTC
Hi, I'm trying to set up my app for printing in an Intermec printer, through BlueTooth. The problem I have is that I need to set up an insecure connection through the Android.Bluetooth.BluetoothDevice.CreateInsecureRfcommSocketToServiceRecord Method That method appears in the API Documentation (online and inside Xamarin), but when I try to use it inside my app, it underlines it in red, and says that Bluetooth.Device does not contain a definition for that, my question is, why is this happening? What can I do? Is it a library problem? Do I need to update something?
Comment 1 Jonathan Pryor 2013-11-04 09:21:30 UTC
The BluetoothDevice.CreateInsecureRfcommSocketToServiceRecord(UUID) method was added in Android v2.3.3 (API-10). By default, projects reference Android v2.2 (API-8), which does not contain that method:

http://androidapi.xamarin.com/?link=M%3aAndroid.Bluetooth.BluetoothDevice.CreateInsecureRfcommSocketToServiceRecord

To change the TargetFrameworkVersion, within Visual Studio view your Project Properties, click on the Application tab, then set the Compile using Android version drop-down to API Level 10 (Android 2.3) or higher.

Within Xamarin Studio, view your Project Options. In the left-hand tree select Build > General; in the right-hand panel set the Target framework to Android 2.3 (Gingerbread) or later.