[Home smart lighting control and indoor environment monitoring system]--6. Bluetooth BLE host computer development 2
[Copy link]
This post was last edited by a media student on 2021-6-27 21:21
After working hard for more than half a month, I found that it is still quite difficult to build an app from scratch.
Share some of your learning experiences.
0. Basic knowledge of BLE
There are a lot of information on the Internet, but the most fundamental thing is: to be familiar with the concept of Client/Central and the basic content of protocols such as GATT;
GATT (Generic Attribute Profile) describes a service framework that uses ATT. The framework defines the procedures and formats of services (Server) and service attributes (characteristic).
The procedures define the discovery, reading, writing, notification, indication, and configuration of characteristic broadcasts.
1. Android development experience
Required knowledge 1: Java or Kotlin
Google has fully supported Kotlin for Java development. Although Kotlin and Java can be converted to each other, you still have to choose a language for development.
BLE is not a new technology after all. I guess the github libraries are basically developed in Java. Besides, I have heard of Java, but Kotlin is completely unfamiliar to me.
Therefore, choose Java for development;
Essential knowledge 2: object-oriented
Java is object-oriented, so for Android development, you need to temporarily stop thinking about some features of C; you need to understand Java callback functions and inheritance relationships, otherwise you will not know where the main program is and how the button is executed;
Essential knowledge 3: gradle/ android sdk
Gradle is really annoying. I have no idea what's going on. I have to download a bunch of packages to download examples from the Internet, and I have to update the Android SDK to the corresponding ones. In short, it's very annoying. I don't know how Google and the industry view this issue. I guess the experts usually write their own programs.
After nearly 20 days of struggle, I decided to put Android development on hold and embrace Swift (Apple) first.
2. APPLE
With the help of @justd0 , I successfully found an open source Bluetooth debugging software for Apple IOS: https://github.com/Pluto-Y/Swift-LightBlue
You can download LightBlue directly from the Apple store for debugging; the software is quite easy to use.
This software seems to be able to go to the cloud, which is quite interesting. I hope it can help everyone.
|