Closed TheBrokenRail closed 5 years ago
At this point, functions are not supported on either the master
or develop
branch of Blockly-Android.
If you're attempting to use functions, I strongly suggest using the functions
branch, or my functions-remove
branch. Both have significant problems when is comes to maintaining valid state through variables/procedure renames and removals. However, they are improvements upon the state of found in the develop
branch.
That said, I just rebased the functions
branch off the latest develop
, and see the same problem. It looks like it is a relatively easy fix that requires pulling in some addition JavaScript from the web code. I believe that code is all found in blocks/procedures.js
.
Mutators and extensions, are the pieces of block definitions that require each platform to reimplement, and since we are leaning on the web/JavaScript implementation for code generation, we need to have those extensions. I don't think the Android code has a clean way of pairing that extra JavaScript code with each block definition.
Since you are going beyond the currently implemented features of the Android implementation, I strongly recommend investigating using the web implementation in a Android WebView
. Expect some demo code to pop up shortly.
Current State
I added the procedure cateory to the toolbox and it seems to be mostly working, minus the code generation.
Code Generation
On the Blockly demo
Simple Activity
when trying to generate code with procedures in it it throws the error in logcat: