Android 基于Android blockly和蓝牙通信的机器人编程APP

Blockly

Blockly is a library for building drag-and-drop visual editors for
JavaScript and other programming languages. Blockly for Android is
a developer preview of Blockly's editor built with standard Android
views and fragments, offering more responsive touch performance and
easier integration in Android apps.

Blockly Turtle demo running on an Android tablet.
Blockly Turtle demo running on an Android tablet.

Get started building your own Android app using Blockly.

Google is proud to offer Blockly for Android for free and open source
under the Apache License, version 2.0.

Blockly has an active developer forum. Please drop by and say hello. Show
us your prototypes early; collectively we have a lot of experience and can
offer hints which will save you time.

Help us focus our development efforts by telling us what you are doing with
Blockly
. The questionnaire only takes a few minutes and will help us better
support the Blockly community.

Want to contribute? Great! First, read our guidelines for contributors.

基于Android blockly和蓝牙通信的机器人编程

github源码

智能小车实践
主要功能:

1、在Android blockly的基础上改造,可以实现编程构建

2、蓝牙连接机器人(自主研发的),通过蓝牙与机器人交互

3、自定义blockly模块,UI自定义

截图
蓝牙连接
控制界面
循迹指令
实现原理

1、蓝牙连接,ble蓝牙连接及其通信,主要在bleutils包下面,其他界面相关实现在robot包下

2、Blockly 自定义模块,创建生成模块,构建完毕生成js和json,json为模块解析构建的样式和类型依据,
js为执行相关语句的构建,例如 if else的构建。

3、Blockly编程实现,生成js代码,然后放入webview中加载js,特定的蓝牙通信的指令代码实现其js和Android交互,Android进行蓝牙通讯。

4、js与Android通信为JavaBridge线程,可阻塞。(如果在需要同步阻塞等待设备传回消息,可以参考ShowInterface的sleep方法,循环等待)

5、对于ui的改造,在blocklylib-core中也有,具体可参看源码

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,738评论 25 709
  • 1、 《秘 密》 只有被出卖一次 才知道一个人 对另一个的信任 到底有几斤几两 2、 《知 音》 就像一只蚂蚁 在...
    左语三千阅读 555评论 0 2
  • 作为一个女子,生活当中多多少少会有一些不堪的落魄和无奈的际遇,与其认命,与其祈求上天带来好运,还不如撸起袖...
    吾日三欣阅读 1,045评论 0 6
  • 我真的有点难过 我已经三个晚上没有熬夜了 每天直播一关差不多就睡着了 虽然每个晚上都会醒来很多次 把手机从头到尾翻...
    我叫什么不重要阅读 612评论 0 0