1

I'd like to be able to transfer Boost programs from one device to another and to back them up. Is this possible?

Ideally I'd like some app-supported mechanism for this.

I have a Google Pixel, a Nexus 5X and a Windows 10 PC. I've poked around on the filesystem looking for saved files but haven't found anything. I'd like to be able to transfer programs from my Windows 10 PC to a phone and vice versa. I am especially thinking of using Boost for exhibits where it would be handy to have a variety of devices having exact copies of the same program. I'm also hoping to find a way to version-control the programs and maybe even reverse-engineer them so that we can generate files without all the touch-screen drag-and-drop silliness.

  • What device/OS are you using? Have you already tried a generic app backup tool? – jncraton Jul 30 '18 at 13:37
  • @jncraton I haven't tried an app backup/restore. Edited question with more details. – Mr. Shiny and New 安宇 Jul 30 '18 at 13:56
2

This should be possible. On my Android device, the Boost files are located at Android/data/com.lego.boost.boost/files. There are subdirectories there for each model (Cat, Guitar, Vernie, etc).

The CreativeCanvas directory stores the generic programs that you have created via the canvas. These are divided into themes and activities. A single activity would be stored at Android/data/com.lego.boost.boost/files/CreativeCanvas/Theme_nnnnnnnnnn/Activity_nnnnnnnnnn. That folder then contains numbered directories containing the following file structure:

  • Composite Blocks
    • {any composite blocks created}
  • RecordedAudio
    • {any audio files}
  • metadata.json
  • palette.json
  • program.json
  • Template.json
  • thumbnail.png

metadata.json gives you an easy way to see what project you are looking at as it shows the name:

{
  "creationDate": "2018-07-30T13:17:13",
  "modificationDate": "2018-07-30T15:55:54",
  "name": "Ragana",
  "thumbnail": "thumbnail.png",
  "paletteLevel": 2
}

It appears that the program itself is stored in program.json. That files looks like this:

{
  "mainCanvas": {
    "positionedSequences": [
      {
        "position": {
          "x": -3.49160075,
          "y": 2.56404877
        },
        "PositionedObject": {
          "instructions": [
            {
              "operation": "Start"
            }
          ]
        }
      },
      {
        "position": {
          "x": -0.637803435,
          "y": 3.23562384
        },
        "PositionedObject": {
          "instructions": [
            {
              "operation": "PlaySound",
              "literalParams": [
                2406
              ]
            },
            {
              "operation": "PlaySound",
              "literalParams": [
                1110
              ]
            },
            {
              "operation": "EncMotorSpeedDuration",
              "literalParams": [
                100.0,
                1.0
              ]
            },
            {
              "operation": "DrivebaseBothSpeedTankDuration",
              "literalParams": [
                50.0,
                50.0,
                1.0
              ]
            },
            {
              "operation": "DrivebaseBothSpeedTankDuration",
              "literalParams": [
                -49.0,
                -50.0,
                1.0
              ]
            },
            {
              "operation": "DrivebaseBothSpeedTankDuration",
              "literalParams": [
                -26.0,
                -50.0,
                1.0
              ]
            },
            {
              "operation": "/Generic/Wait/WaitForColor",
              "literalParams": [
                9.0
              ]
            }
          ]
        }
      },
      {
        "position": {
          "x": -2.94540381,
          "y": 0.827951133
        },
        "PositionedObject": {
          "instructions": [
            {
              "operation": "/Generic/Trigger/TriggerOnColor",
              "literalParams": [
                1
              ]
            },
            {
              "operation": "DrivebaseBothSpeedTankDuration",
              "literalParams": [
                50.0,
                50.0,
                1.0
              ]
            },
            {
              "operation": "DrivebaseBothSpeedTankDuration",
              "literalParams": [
                -48.0,
                -53.0,
                1.0
              ]
            }
          ]
        }
      },
      {
        "position": {
          "x": 3.88817477,
          "y": 1.29482651
        },
        "PositionedObject": {
          "instructions": [
            {
              "operation": "/Generic/Trigger/TriggerOnOrientation",
              "literalParams": [
                2
              ]
            },
            {
              "operation": "EncMotorSpeedDuration",
              "literalParams": [
                50.0,
                1.0
              ]
            }
          ]
        }
      },
      {
        "position": {
          "x": 3.715327,
          "y": -0.0692780837
        },
        "PositionedObject": {
          "instructions": [
            {
              "operation": "/Generic/Trigger/TriggerOnOrientation",
              "literalParams": [
                0.0
              ]
            }
          ]
        }
      }
    ],
    "positionedDataBlocks": [],
    "viewState": {
      "position": {
        "x": 2.3166585,
        "y": 1.16671765
      },
      "scale": 4.0
    }
  }
}

These are simply JSON files, so you can certainly commit them to version control.

I have confirmed that copying program.json from one activity to another effectively clones the activity program. This worked for me for a basic program, but I assume you'll want the entire project structure in version control to catch more complex programs with composite blocks or other things.

There is an analogous path on Windows with these files in it at C:\Users\username\AppData\Local\Packages\TheLEGOGroup.LEGOBOOST_m36angppq0g76\LocalState\CreativeCanvas\Theme_nnnnnn\Activity_nnn\nnn.

I'm also not familiar with any tools yet to automate this sort of thing, but it seems like they could be created fairly easily.

  • Thanks! I found this directory before but didn't get far enough into it to find the files that were the actual files for my program. I was able to find the analogous folder on Windows at C:\Users\username\AppData\Local\Packages\TheLEGOGroup.LEGOBOOST_m36angppq0g76\LocalState\CreativeCanvas\Theme_nnnnnn\Activity_nnn\nnn – Mr. Shiny and New 安宇 Jul 30 '18 at 18:31
  • Nice work! Hopefully you'll be able to figure out the details of getting this working the way you want. It sounds very useful! – jncraton Jul 30 '18 at 18:34
  • 1
    I may have to dust off Tasker to see if it can automatically grab changed files and send them to a remote Git server or something. But programming tasks in Tasker is even more annoying than programming in Boost :p – Mr. Shiny and New 安宇 Jul 30 '18 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.