Тёмный

Xamarin BLE App for latest Android releases (12 and higher) 

MoThunderz
Подписаться 8 тыс.
Просмотров 10 тыс.
50% 1

This video explains a simple BLE Explorer written in Xamarin (using plugin.BLE). In essence the app is a simple version of the nRF app: It allows the user to select a BLE device, then shows all available services. Upon selection of a service it will show the available Characteristics. One can then read/write strings or register to Characteristics with "notify" enabled.
Code is available here:
github.com/mo-thunderz/Xamari...
Code was originally based on Jenx Bluetooth example, but then updated and changed to be compatible with modern Android phones (release 12 and higher): www.jenx.si/2020/08/13/blueto...
Code is written for Android Release 12 or newer. All logic is placed in Code Behind in this example.
Plugin.BLE repository (with information on adaption for Iphones):
github.com/dotnet-bluetooth-l...
Chapters
0:00 Introduction
3:14 Installation of programming environment
6:19 Enable USB Debugging on your phone
8:00 Download code from Github
8:44 Enabling Bluetooth on Android 12 or newer
11:11 App description: App.xaml
11:42 App description: Bluetooth Devices Page
18:45 App description: Bluetooth Services Page
25:38 App description: Bluetooth Characteristics Page
31:22 Notify callback function
36:50 Send and Receive functions

Опубликовано:

 

25 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 52   
@motiveaquarian1111
@motiveaquarian1111 3 месяца назад
you are a great streamlined teacher. Great work!
@mothunderz
@mothunderz 3 месяца назад
Thank you! 😃
@Jzrz369
@Jzrz369 8 месяцев назад
Wtf❤amigo estás loco jsjsj gran video...y gracias,que prospere este canal✨😎👍
@mothunderz
@mothunderz 8 месяцев назад
Thank you very much! Glad the video is useful for you!
@johnheitz7517
@johnheitz7517 Год назад
Another Great Video, Thanks
@mothunderz
@mothunderz Год назад
Thank you for your feedback!
@wasouthpnt
@wasouthpnt 7 месяцев назад
I came for the guitar on the wall, I stayed for the 5 tutorials due to your very understandable walk throughs. 🙂 May I suggest (part 6) to show how to send a command from the Xamarin BLE App to the ESP32 and what code is needed on the ESP32 to receive a command and reply. Thanks for this series. Please let me know on part 6 suggestion.
@mothunderz
@mothunderz 6 месяцев назад
Thank you for your feedback! Youre the first one to state you found my vid because of the guitar on the wall :-) Great idea for a next video. Unfortunately I am really swamped with work (thus also my late reply) and I dont get to make videos at all at the moment. So my apologies, but in the near-term I wont be able to upload anything. Hope you understand...
@brayanrodriguezn.3430
@brayanrodriguezn.3430 3 месяца назад
This was possibly one of the best programming tutorials I've ever seen, well explained and simple, really helped me a lot. How could we plot the data that the ESP32 sends to the app? And can we make this app to run in the background to receive data all the time?
@akshaygaikwad530
@akshaygaikwad530 Год назад
great video.
@mothunderz
@mothunderz 11 месяцев назад
Glad you enjoyed it
@ericgarcia7429
@ericgarcia7429 Год назад
Thanks i'm serching a lot for do connection with xamarin
@mothunderz
@mothunderz Год назад
You're welcome 😊
@RickardApps
@RickardApps 4 месяца назад
Hi! Thank you for this walkthrough and sample code! I learned a lot more about viewmodels too! I have a couple of questions if you don't mind. If I want to build an APK from this project, could I use the PowerShell to do that? In newer versions I could just publish with clicks but it won't let me do that for Android. Is Xamarin.Essentials still used for this in newer versions? I have looked at Shiny for the ble plugin tools but I don't understand any part of his guides. I really need to build a BLE project that scans, connects and send messages to the BLE device Thank you
@josefredo9514
@josefredo9514 Год назад
Great video! I need to make an application in Xamarin using bluetooth, when a specific string is received from the ESP32 board, show a message in Xamarin, could this work with what is shown in the video?
@mothunderz
@mothunderz Год назад
Yes, this is the right code for that -> just use "Notify" and you can send any string at any point in time from the ESP32 to Xamarin.
@deonbowers6706
@deonbowers6706 Год назад
Before I go down this route, I was wondering if this would allow me to send a signal to my ESP32 that starts a function that tells a dc motor controller to start, stop, reverse the motor?
@mothunderz
@mothunderz Год назад
Yes, you can send a string from the mobile app to the ESP32 and thereby give the ESP instructions.
@MrChechoPVP
@MrChechoPVP 10 месяцев назад
For 11 and older versions of android is the same thing just with different permissions?
@mothunderz
@mothunderz 8 месяцев назад
My apologies, but I dont have a phone to test older versions with.
@user-fh4ub2gi8c
@user-fh4ub2gi8c 6 месяцев назад
Thank you for the fantastic video. I tried running the downloaded code on my physical Android 12 device, but despite having Bluetooth enabled on both my headphones and Android phone, I couldn't detect any available Bluetooth devices. Can you assist me in figuring out what might be missing or needed in this situation?
@mothunderz
@mothunderz 6 месяцев назад
Have you tried with the nRF app with an additional phone? See as well this video for use of the nRF app: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-0Yvd_k0hbVs.html
@jokerjuha7515
@jokerjuha7515 11 месяцев назад
Great Video. But how do I stay connected, if i leave the page?
@mothunderz
@mothunderz 10 месяцев назад
There are few options around that problem. The by far easiest solution is to stay on the page and create different view by using the arrangements that are available under "layout". You can then switch these arrangements on and off with the "visible" parameter of the arrangement. Pls give that a try.
@sisi-bz5sh
@sisi-bz5sh Месяц назад
Hello, Thank you for your video. It is very informative. My phone's (Samsung Galaxy S8) Android Version is 9. I tried to build your code by using ms 2017 (with Android SDK 9.0). But build was not successfully. Could you please provide any suggestion to build your code for this phone ? Sincerely, SI
@Ashutosh_Jangir
@Ashutosh_Jangir 5 месяцев назад
Hii bro i love your content but i am not able to find ble mesh networking can you suggest me
@mothunderz
@mothunderz 3 месяца назад
What do you mean with "ble mesh networking"?
@Mr767267
@Mr767267 5 месяцев назад
Now that Xamarin is coming to End Of Life this year, does MAUI support the same library?
@mothunderz
@mothunderz 3 месяца назад
Yes, its definitely time to go to MAUI. It is all quite similar, but I have not had the time yet to look into this in detail :-/
@user-ok8bu4ft8b
@user-ok8bu4ft8b 10 месяцев назад
Great video, but I want to know how to change the code so that my phone can connect to an HC-05?
@mothunderz
@mothunderz 10 месяцев назад
The HC-05 uses the old Bluetooth 2.0 standard and is not suitable for BLE. I highly recommend you upgrade to the HC-09. If you insist on using the HC-05 you will need to use serial Bluetooth. I have a video online on serial Bluetooth with MIT App Inventor, but have not looked into Xamarin with serial Bluetooth yet.
@user-ok8bu4ft8b
@user-ok8bu4ft8b 10 месяцев назад
@@mothunderz ok,thanks,already updated to HC-08👍
@mothunderz
@mothunderz 10 месяцев назад
Excellent!
@lucasianii8178
@lucasianii8178 7 месяцев назад
Hi Sir, thanks for the video, is it possible that you create another video where we create this app in android studio KOTLIN with jetpack compose please?
@mothunderz
@mothunderz 6 месяцев назад
thank you for your feedback. At the moment I am overloaded with work and unfortunately dont have time to make videos. When I have time again I can look into it.
@lucasianii8178
@lucasianii8178 6 месяцев назад
@@mothunderz Alright, thank you. I hope you do some in the future.
@ericgarcia7429
@ericgarcia7429 Год назад
I using de APP for serch diferents divices bad somtims don't see for exple i use antenna BLE HC-05 with pico and can't connect i don't see the divce. Do know how up program for see this divice.
@mothunderz
@mothunderz Год назад
Working with BLE is not very straightforward. There can be many reasons why you dont see a device at some point in time. What I suspect though is that you are trying your code and dont realize the pico is still connected. Resetting the pico should solve that problem. However, it could be tons of other problems. For me to figure out what is wrong from here is virtually impossible. Good luck with you project!
@ericgarcia7429
@ericgarcia7429 Год назад
Thank you for all
@JiaJiaVlog
@JiaJiaVlog Год назад
I have something very confused about bluetooth searching, which is that I can only get the device paired before and can not find the new unpaired device on my app. And I can not figure out why. Is there anyone that can answer my question. I would be appreciated
@mothunderz
@mothunderz Год назад
Thank you for your comment. If you connect to lets say a Bluetooth speaker: do you do that in the app, or do you do that by pairing it in the general settings? In most cases you pair in the general settings and the app automatically sees that the right device is paired. For this video I show the list of available Bluetooth devices in the app as demo, however, in the "real app" you would not do that. Instead you should just scan through all available Bluetooth devices automatically and check if the UUID matches. If it does, you can automatically connect to that device. So in practice the user pairs the device in the general settings and the app automatically connects. Good luck with your code!
@JiaJiaVlog
@JiaJiaVlog Год назад
@@mothunderz The available devices you mentioned means devices have already paired in the general setting or not. I am very confused with that. And thanks for answering my question
@mothunderz
@mothunderz 10 месяцев назад
Sorry for my late reply: I missed that you answered. Yes, I meant the devices available in the general settings.
@chrisstjohn2234
@chrisstjohn2234 10 месяцев назад
You have the Central/Peripheral roles the wrong way around.... Peripherals advertise, generally contain a Server. Centrals scan, connect and generally contain a Client.
@mothunderz
@mothunderz 8 месяцев назад
Yes correct, my apologies for that
@akshaygaikwad530
@akshaygaikwad530 Год назад
hindi link for available sir plzzzzzz
@mothunderz
@mothunderz 11 месяцев назад
My apologies, but I am not sure what the request is
@phamngocquapham5472
@phamngocquapham5472 6 месяцев назад
Thanks for your video. But one problem is that I can't find the code for "BLEPermission". Can you help me please.
@phamngocquapham5472
@phamngocquapham5472 6 месяцев назад
@phamngocquapham5472
@phamngocquapham5472 6 месяцев назад
oh i'm really sorry. I found it
Далее
BLE with ESP32 tutorial part 1: the Server
25:23
Просмотров 81 тыс.
Maybe i need to add instructions @popflexactive
00:14
This Stop Motion is Insane
00:39
Просмотров 6 млн
Mac Fanboy Tries ARM Windows Laptops
31:40
Просмотров 96 тыс.
Java Is Better Than Rust
42:14
Просмотров 19 тыс.
Discovering Bluetooth Devices BLE in C# and .Net Core
1:11:24
Xamarin Debug App On A Physical Device
8:35
Просмотров 23 тыс.