Install Android Studio and other steps to Android Things
Overview
Here is a tutorial on how to develop an Android apk file on a Mac.
- Install XCode (via the App Store)
-
XCode command line tools, for a prompt for a dialog:
xcode-select --install
- Homebrew
- brew doctor
-
Use Homebrew to install Java:
brew install --cask caskroom/versions/java8
-
Use Homebrew to install tools used for Android dev :
brew install ant brew install maven brew install gradle
-
To avoid “.android/repositories.cfg could not be loaded” error, create a blank file:
touch ~/.android/repositories.cfg
The equivalent of this for Powershell on Windows 10:
New-Item C:\Users$username.android\repositories.cfg -type file
-
Use Homebrew to install the Android Software Development Kit (sdk):
brew install --cask android-sdk
This takes several minutes. Just wait while “Installing Cask android-sdk”.
-
Use Homebrew to install the Android Native Development Kit (ndk):
brew install --cask android-ndk
-
Install all the Android SDK components:
NOTE: The
android update sdk --no-ui
command is deprecated. -
Install HAXM for blazing fast emulators. Check out the “Configuring VM Acceleration on Mac” section at:
http://developer.android.com/tools/devices/emulator.html
-
Edit your
~/.bash_profile
to update environment variables:export ANDROID_SDK_ROOT="/usr/local/share/android-sdk" export ANT_HOME=/usr/local/opt/ant export MAVEN_HOME=/usr/local/opt/maven export GRADLE_HOME=/usr/local/opt/gradle export ANDROID_HOME=/usr/local/opt/android-sdk export ANDROID_NDK_HOME=/usr/local/opt/android-ndk
-
Update your paths (bonus points to a better solution to the hardcoded build tools version):
export PATH=$ANT_HOME/bin:$PATH export PATH=$MAVEN_HOME/bin:$PATH export PATH=$GRADLE_HOME/bin:$PATH export PATH=$ANDROID_HOME/tools:$PATH export PATH=$ANDROID_HOME/platform-tools:$PATH export PATH=$ANDROID_HOME/build-tools/19.1.0:$PATH
-
Periodically run these commands again to ensure you’re staying up to date:
brew update android update sdk --no-ui
There might be an issue with brew update and the android-sdk formula.
Android Studio
Alternately, you can install and use Eclipse, IntelliJ, or your other favorite IDE.
Alternately, download the dmg from https://developer.android.com/studio/install.html
But the easiest way is:
-
Install Android Studio:
brew install --cask android-studio
Alternately, see http://macappstore.org/android-studio/ for manual download. https://classroom.udacity.com/courses/ud808/lessons/4216368924/concepts/43072785890923# is a video mini-course done April 2015 about that approach.
- https://github.com/caskroom/homebrew-cask/blob/master/Casks/android-studio.rb
-
Pinch 4 fingers together over the touchpad and type “An” to select “Android Studio”.
- Select “Do not import settings.”
- Custom.
- Choose the Default or darker Dracular theme (which uses less battery, I’m told).
- Check “Android Virtual Device”, then Next for /Users/wilsonmar/Library/Android/sdk
- 2 GiB on a 16 GiB machine.
- Finish. It takes several minutes for Downloading and install.
- Provide password to HAXM installation changes.
- When “Silent install Pass!” appears, press Finish.
-
See
Training
-
Get training
https://www.udacity.com/course/developing-android-apps–ud853 free video course with https://discussions.udacity.com at Android level “Lollipop”.
- https://github.com/udacity/ud851-Sunshine
- https://github.com/udacity/ud851-Exercises
https://developer.android.com/training/basics/firstapp/index.html text-only instructions
More on IoT
This is one of a series on IoT:
-
IoT Acronymns and Abbreviations on Quizlet
- IoT Apprentice school curriculum
- IoT use cases
- IoT reminders prevent dead mobile battery
- IoT text to speech synthesis
- IoT AWS button
- Intel IoT
- IoT Raspberry hardware
- IoT Clouds
- Samsung IoT Cloud
NOTE: Pages about GE’s Predix have been removed.