Hi
The process for upgrading to a new SDK (Software Development Kit) is not difficult, but there ARE a lot of steps when you consider the code, and deploying both apps.
I thought I would list (in detail) the steps we went through to try out the new 1.6 Beta code.
This is definitely NOT the only way to do this, but it's our way, and it's very repeatable.
Specific example: ftc_app V 1.5 to ftc_app-beta V1.6
Phase 1: Backup existing project & download new SDK.
This is by far the MOST important step to get correct. I like to rename my current working folder so it CAN NOT get overwritten. Then I transfer down and test then new SDK before making any changes.
• Rename /users/phil/AndroidStudioProjects/ftc_app folder to ftc_app-2016-02-10
• Log into github: https://github.com/ftctechnh/ftc_app
• Change to the beta branch (click on “branch”, then pull-0down and select “beta”)
• Download copy of SDK by clicking on Download Zip button
• Make note of location where zip file is downloaded
• Once complete, unzip file as /users/phil/AndroidStudioProjects/ftc_app-beta . This now becomes my new project folder.
• Verify that the project is good, by running Android Studio and doing an “Import Project” on the new project folder (top most level) and then run “Build / Clean Build”
• Verify that no errors occur. Correct any problems BEFORE continuing.
• Exit out of Android Studios
Phase 2: Merge custom team code with new project
Next you must transfer any of your custom code into the new project folder. To do this I open up two Explorer windows side by side. Old (renamed) folder on the left, new (downloaded) folder on the right.
• Navigate both project folder trees down to the opmode folder: \FtcRobotController\src\main\java\com\qualcomm\ftc robotcontroller\opmodes
• Ctrl-Drag (COPY) all of the team’s custom opmodes (xxxxxx.java files) from the old to the new folder.
• Ctrl-Drag (COPY) the team’s FtcOpModeRegister.java file from the old to the new folder.
• Verify that the updated project is good, by running Android Studio and doing an “Import Project” (again) on the new project folder (top most level) and then run “Build / Clean Build”
• Verify that no errors occur. Correct any problems BEFORE continuing.
Phase 3: Building and deploying new project to the Robot Controller
This new revision will not simply “overwrite” the existing app on the Robot Controller phone. You need to allow Android Studio to delete it before deploying the new app. Then you need to reconnect any disconnected elements.
• Start Android Studios and open the new project. Give it time to fully run all gradle scripts (status at bottom).
• Open the Gradle Monitor tab at the bottom of the screen.
• Plug your RC phone into your development computer. Verify that the phone is seen as a connected device
• Deploy the app by pressing the green RUN arrow.
• You will be prompted that the new app is not compatible with the old app. Accept the option to continue anyway. The existing app will be deleted and the new one will replace it, and start running.
• The RC App will have “forgotten” the current robot configuration, so use the App “Settings” menu to “select” and “activate” the correct robot configuration.
• Close the app, and swipe it off (Press and hold lower menu button). Ignore any error messages.
• We like to have the RC app on the start screen, so we select the Apps Icon (9 squares), locate the RC app and then drag it to the start screen. This is just a convenience.
• With the Robot’s 12V power turned off, place the phone in the robot and connect the USB cable.
• Turn on the 12V. Observe that the Robot Controller App is launched.
• Since this is essentially a “New” app, it will create notifications that it wants to be associated with the USB hardware devices. It will pop up a black dialog box for EACH device. Check the “checkbox” and accept the dialog. To ensure that ALL the devices are associated, you will need to hit the Phone’s Back button (lower left) and then re-start the App several times until the dialog boxes stop appearing.
• Once the dialog box no longer appears, the app is fully installed and configured.
Phase 4: Install the new matching Driver station
Since the communications protocols may change form version to version, it’s REQUIRED that the corresponding Driver Station App is loaded on the Driver station phone. This can be done several ways. But the description below details how we “side load” the app using windows.
• Delete the current Driver Station App from the phone. Select: “Settings/Apps” and locate the FTC Driver Station Icon. Click it and select Uninstall. Agree to all options.
• Ensure that your phone will accept “side loaded” apps. Select: “Settings/Security” and make sure “unknown Sources” is checked.
• Place the Driver Station phone in media mode. Select: “Settings/Connect to PC” menu to check “Media device”. This means that when the phone is connected to a PC it will appear as an external drive. (note: put this back to “charge only” when install is complete)
• Plug the DS phone into your Development PC and wait for it to appear as a drive labeled: N9130 You can Open Drive to view files.
• Copy the App from the computer to the phone in order to install it. It is located in the ftc_app-beta folder in the /doc/apk sub-folder. It is named FtcDriverStation-release.apk Copy the file, and paste it into the N9130/Phone folder.
• Install the new Driver Station app. Click on the phone’s App Icon (9 squares) and locate the File Manager App. Select it. Scroll to the right to see the list of folders on the phone. Scroll down past the folders until you see the FTCDriverStation file. Select it and then press Install. Press open to run the installed app.
• You may be presented with a screen that says Configuring WiFi Direct. This screen has a bug and it may not seem to complete. Simply count to 10 and then hit the phone’s back button.
• All that remains is to re-pair with your robot controller. Select the App’s setting button and choose “Pair with Robot”. Your robot must be on and have the RC app running. It should also be given a correct FTC network name eg: 2818-RC.
Phase 5: Verify that all of your opmodes work correctly with the new SDK
Phil.
The process for upgrading to a new SDK (Software Development Kit) is not difficult, but there ARE a lot of steps when you consider the code, and deploying both apps.
I thought I would list (in detail) the steps we went through to try out the new 1.6 Beta code.
This is definitely NOT the only way to do this, but it's our way, and it's very repeatable.
Specific example: ftc_app V 1.5 to ftc_app-beta V1.6
Phase 1: Backup existing project & download new SDK.
This is by far the MOST important step to get correct. I like to rename my current working folder so it CAN NOT get overwritten. Then I transfer down and test then new SDK before making any changes.
• Rename /users/phil/AndroidStudioProjects/ftc_app folder to ftc_app-2016-02-10
• Log into github: https://github.com/ftctechnh/ftc_app
• Change to the beta branch (click on “branch”, then pull-0down and select “beta”)
• Download copy of SDK by clicking on Download Zip button
• Make note of location where zip file is downloaded
• Once complete, unzip file as /users/phil/AndroidStudioProjects/ftc_app-beta . This now becomes my new project folder.
• Verify that the project is good, by running Android Studio and doing an “Import Project” on the new project folder (top most level) and then run “Build / Clean Build”
• Verify that no errors occur. Correct any problems BEFORE continuing.
• Exit out of Android Studios
Phase 2: Merge custom team code with new project
Next you must transfer any of your custom code into the new project folder. To do this I open up two Explorer windows side by side. Old (renamed) folder on the left, new (downloaded) folder on the right.
• Navigate both project folder trees down to the opmode folder: \FtcRobotController\src\main\java\com\qualcomm\ftc robotcontroller\opmodes
• Ctrl-Drag (COPY) all of the team’s custom opmodes (xxxxxx.java files) from the old to the new folder.
• Ctrl-Drag (COPY) the team’s FtcOpModeRegister.java file from the old to the new folder.
• Verify that the updated project is good, by running Android Studio and doing an “Import Project” (again) on the new project folder (top most level) and then run “Build / Clean Build”
• Verify that no errors occur. Correct any problems BEFORE continuing.
Phase 3: Building and deploying new project to the Robot Controller
This new revision will not simply “overwrite” the existing app on the Robot Controller phone. You need to allow Android Studio to delete it before deploying the new app. Then you need to reconnect any disconnected elements.
• Start Android Studios and open the new project. Give it time to fully run all gradle scripts (status at bottom).
• Open the Gradle Monitor tab at the bottom of the screen.
• Plug your RC phone into your development computer. Verify that the phone is seen as a connected device
• Deploy the app by pressing the green RUN arrow.
• You will be prompted that the new app is not compatible with the old app. Accept the option to continue anyway. The existing app will be deleted and the new one will replace it, and start running.
• The RC App will have “forgotten” the current robot configuration, so use the App “Settings” menu to “select” and “activate” the correct robot configuration.
• Close the app, and swipe it off (Press and hold lower menu button). Ignore any error messages.
• We like to have the RC app on the start screen, so we select the Apps Icon (9 squares), locate the RC app and then drag it to the start screen. This is just a convenience.
• With the Robot’s 12V power turned off, place the phone in the robot and connect the USB cable.
• Turn on the 12V. Observe that the Robot Controller App is launched.
• Since this is essentially a “New” app, it will create notifications that it wants to be associated with the USB hardware devices. It will pop up a black dialog box for EACH device. Check the “checkbox” and accept the dialog. To ensure that ALL the devices are associated, you will need to hit the Phone’s Back button (lower left) and then re-start the App several times until the dialog boxes stop appearing.
• Once the dialog box no longer appears, the app is fully installed and configured.
Phase 4: Install the new matching Driver station
Since the communications protocols may change form version to version, it’s REQUIRED that the corresponding Driver Station App is loaded on the Driver station phone. This can be done several ways. But the description below details how we “side load” the app using windows.
• Delete the current Driver Station App from the phone. Select: “Settings/Apps” and locate the FTC Driver Station Icon. Click it and select Uninstall. Agree to all options.
• Ensure that your phone will accept “side loaded” apps. Select: “Settings/Security” and make sure “unknown Sources” is checked.
• Place the Driver Station phone in media mode. Select: “Settings/Connect to PC” menu to check “Media device”. This means that when the phone is connected to a PC it will appear as an external drive. (note: put this back to “charge only” when install is complete)
• Plug the DS phone into your Development PC and wait for it to appear as a drive labeled: N9130 You can Open Drive to view files.
• Copy the App from the computer to the phone in order to install it. It is located in the ftc_app-beta folder in the /doc/apk sub-folder. It is named FtcDriverStation-release.apk Copy the file, and paste it into the N9130/Phone folder.
• Install the new Driver Station app. Click on the phone’s App Icon (9 squares) and locate the File Manager App. Select it. Scroll to the right to see the list of folders on the phone. Scroll down past the folders until you see the FTCDriverStation file. Select it and then press Install. Press open to run the installed app.
• You may be presented with a screen that says Configuring WiFi Direct. This screen has a bug and it may not seem to complete. Simply count to 10 and then hit the phone’s back button.
• All that remains is to re-pair with your robot controller. Select the App’s setting button and choose “Pair with Robot”. Your robot must be on and have the RC app running. It should also be given a correct FTC network name eg: 2818-RC.
Phase 5: Verify that all of your opmodes work correctly with the new SDK
Phil.
Comment