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.

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中也有,具体可参看源码

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值