Setup Environment - Motorola Developer Portal
Setup Environment - Motorola Developer Portal
com/documentation/setup-environment
Overview
Software
Firmware
Setup Environment
Developer Tools
Developer Tools
Overview (/documentation Preparing For Application Development
/developer-tools-overview)
Follow these instructions to add Moto Mod specific support to your applications:
Setup Environment
(/documentation/setup-
environment)
Build from Source
(/documentation/build-
source)
Step 1) Download and Install Android Studio
Starting a New Project To develop a Moto Z application that interacts with Moto Mods, you must be
(/documentation/starting- familiar with Android Studio 2.0 and it must be installed on your development
new-project)
environment. If you don’t already have it, download Android Studio 2.0 here
Flashing Firmware
(/documentation/flashing-
(https://developer.android.com/studio/index.html). Unlike firmware development
firmware) which requires Linux currently, APK development may be done on the platform of
Debug and Log your choice.
(/documentation/debug-and-
log) Note: You’ll also need to make sure that Android Studio has the Android SDK API
23 or later installed.
MDK
Examples
Step 3) Place the Moto Mods SDK Library For Use In Your
App
Once ModLib-01.00.000.zip is downloaded and unzipped, place the modlib-
01.00.000.jar file in your Android Studio project libs/ folder, and the
the version.xml in your res/values folder. By including this library in your
Android application project, you will be able to include Moto Mod specific
functionality in your app.
Run these commands from a terminal to copy modlib.jar and version.xml files to
the appropriate location:
cp modlib-01.00.000.jar $APP_TOP/app/libs
cp res/version.xml $APP_TOP/app/src/main/res/values
If using a VM, configure with at least 2GB of RAM and 10GB of hard disk space
for optimal performance.
Build Dependencies
All of the tools needed to build Moto Mods firmware are provided in the Ubuntu
package management system. To download these to your system use the
following commands from a terminal:
OpenOCD
OpenOCD is used for flashing and debugging. You will need to download and
build the OpenOCD code as follows:
Note: If you are using Ubuntu 16.10 or later, you will need to install gcc-5 (sudo
apt install gcc-5) and add "CC=gcc-5" to the above ./configure statement. This
is only required for OpenOCD.
OpenOCD talks to the chip through USB, so you need grant your account access
to the FTDI.
$ id -u -n
Replace <user name> below with the results of the previous command.
$ sudo -s
# echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", MODE="0666", OWNER="<u
ser name>"' >> /etc/udev/rules.d/20-ftdi.rules
# udevadm control --reload
# exit
The new permissions will take effect the next time you plug in your USB cable.
GDB
GDB is required for low-level debugging. The MDK provides some utility functions
that make working with the debugger easier. If you wish to use these utilities you
have to download and build the debugger with Python scripting enabled as
follows:
Further information
Additional information about each tool referenced can be found at the originators
site: