Using Javascript to create apps - update - code links/sources/discussion

This is a follow up to my demo a couple of weeks ago of using Javascript to create apps for MIT app inventor. That discussion linked to this video demo. - YouTube

This post lists information so you can try this yourself. There will be bugs, issues, problems and probable frustrations.

Documentation: There is some sample documentation on components (properties, methods and features) available at (because I had to call the project something).

NPM packages: This solution required node-pre-gyp to run on node. I have only used node 16.13.XX so no idea if there are issues on other versions of node. Install this first, then the telephonejs package.

  1. npm install @mapbox/node-pre-gyp
  2. npm install telephonejs

Source code is available on github with Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.

I will respond to issues/bugs/breaking failures (I am sure they are there) when time allows.

Status of working on different devices is:

  1. Default App Inventor Emulator - flakey - tends to lose sync and drop out
  2. Android over USB - no known issues - works really well
  3. Android over wifi - no known issues - works really well
  4. Apple over wifi - connects, loads files - asset loading not tested - may/will be issues

Not many samples of code to distribute at the moment.

Check the sampleCode folder in the github repository for 1.

That's about it I think. Have a nice day and thanks for your interest in my little project that has grown way beyond what I intended to do at the start.


Well done.

two question:
1 how to import extensions?
2 is it possible to change aia file to javascript/xml file?

Two answers

  1. Extension are not implemented. Theoretically they probably could be. My understanding (may be wrong because I haven't looked too closely) is that extensions are generally just uploaded like any other file. This should be possible at the moment (there is an 'assetlist') tag in XML. To make them usable would require extra work on the system as it stands, namely:
    • creating a file (which i will call the extension definition file) like the elements.js file for each extension that defines the name of the extension, it's properties, methods and any events. There would probably need to be a folder for these extra files that is scanned when the program loads or user saves a file so that the extension if correctly added.
    • altering the attributes.js file so that it, if dealing with a component that is an extension, it opens the extension definition file to transcode the controlling javascript to valid scheme code.

I have no plans yet to include extensions. There are still other things that are higher priority. I am more likely to attempt the compilation problem first.

  1. Potentially, maybe you could, but I suspect that it would take a LOT of work. Essentially you would need a program that can unpack the aia file and transpile from the blocks/ui layout code to js/xml. This is also not on my development pathway (at least for forseeable future).
1 Like