Connect Mobile through Bluetooth Program
Connect Mobile through Bluetooth Program
Hello friends, I have searched through out the internet and I found that tutorials on Bluetooth is hardly available. There are tutorials on Bluetooth and that is very hard to understand. This tutorial will help to you to create an android app that can connect to any Mobile device through Bluetooth.
And here we go...
Follow below steps:
1) In the "MainActivity.cs" file write below code,
Include "Bluetooth" header file as "using Android.Bluetooth;"
If you see above code, I have created an abject of class "Receiver". This class is created in the next step.
2) To Listen the Bluetooth connection add "Receiver.cs" file as shown below,
3) Now here comes the exciting part of searching the nearby Bluetooth devices and connecting to it.
Create another file called "SearchDevice.cs" as shown below,
And here we go...
Follow below steps:
1) In the "MainActivity.cs" file write below code,
Include "Bluetooth" header file as "using Android.Bluetooth;"
MainActivity.cs file |
2) To Listen the Bluetooth connection add "Receiver.cs" file as shown below,
Receiver.cs file |
3) Now here comes the exciting part of searching the nearby Bluetooth devices and connecting to it.
Create another file called "SearchDevice.cs" as shown below,
SearchDevice.cs file |
Create a Button to discover nearby Bluetooth devices. Call DiscoverDevice() method on Button_Click.
Call the ConnectDecive() method by anyway such as Button_Click, OnStart(), Clicking on List of Bluetooth Device, etc...
Now you are done. Let's do some magic to search for device and connect to any nearby bluetooth device.
For Complete Tutorial on Bluetooth Device you can check my video on YouTube.
I will post the link for youtube video soon.
By the time crack your mind and work on this...
Hope you are now clear with Bluetooth programming.
Please Like and commecnt if you have any queries or suggestions.
Thank You.
Call the ConnectDecive() method by anyway such as Button_Click, OnStart(), Clicking on List of Bluetooth Device, etc...
Now you are done. Let's do some magic to search for device and connect to any nearby bluetooth device.
For Complete Tutorial on Bluetooth Device you can check my video on YouTube.
I will post the link for youtube video soon.
By the time crack your mind and work on this...
Hope you are now clear with Bluetooth programming.
Please Like and commecnt if you have any queries or suggestions.
Thank You.
Comments
Post a Comment