-
Notifications
You must be signed in to change notification settings - Fork 0
android_tooling
It seems like the best platform to build object-functional programs on Android is Scaloid. Here are some reference materials about Scaloid:
-
docs
-
example projects
-
guides & tutorials
- scaloid-specific
- scala & android in general (good tooling walk-through):
- cake solutions tutorial
- NOTE: not specifically about scaloid: about scala on android in general
- needs target
- run
android list targets
first - choose an id (one corresponding to API v 21) -- for me it's 1
- run
android update project -p . -t 1
(or replace 1 with id likeandroid-21
- to do it manually:
- select
Run/Edit Configuration
from Menu - select
Android Application
from lefthand pane - look for tab that says
before Launch
- delete
run Make
- click plus button
- select
SBT
from dropdown - paste
android:package-debug
into text field
- delete
- select
- on Project Import, following dependency warnings were triggered:
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn] * net.sf.proguard:proguard-base:4.11 -> 5.0
[warn] Run 'evicted' to see detailed eviction warnings
- compiling fails with errors:
- first:
Error:scalac: error while loading Object, Missing dependency 'object scala in compiler mirror', required by /Users/aguestuser/Library/Android/sdk/platforms/android-21/android.jar(java/lang/Object.class)
- second:
Error:scalac: Error: object scala in compiler mirror not found. scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found. at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
At the moment, it's sort of a toss-up between:
- Android Studio as the IDE with Gradle as the build tool
-
pros:
- this is by far the most common platform for Android developers. Googling our problems will be easier.
- it just got revamped and is extremely well documented by Google
- Android Studio is built on top of InteliJ, so we can still get most of the cool features we would have gotten from it, plus possibly more cool features (ie: tightly integrate running and testing on emulators or devices) that might not be available on vanilla InteliJ
-
cons:
- it enforces use of gradle as the build tool, but sbt seems to be the most common build tool used on Scala projects
- it seems intended for use with Java, not Scala
- InteliJ as the IDE with sbt as the build tool
-
pros:
- allows use of sbt, which seems like the more common build tool for Scala developers
- might have more robust features for supporting Scala development
-
cons:
- is (perhaps?)not as widely in use by Android developers
- is not officially supported or documented by Google (unlike Android Studio)
- using sbt might put us at odds with other Googlable examples of what we're trying to do
-
pros:
Some resources to help make the decision:
- Android Studio homepage
- Gradle homepage
- InteliJ homepage
- SBT homepage
- FAQ on InteliJ's Android Studio plugin
- InteliJ's Android Studio Plugin
This can be a pain, and I have still not succeeded at getting an emulator up and running. Below are the steps I took to get the design environment set up. Your mileage may vary.
A couple decent walkthroughs of setting up the design environment:
- make sure you have JDK 7
- download from ___ and follow instructions
- will automatically install Android SDK and launch Android SDK Manager
-
can be installed as stand-alone (i didn't do this)
- brew version is out-of-date?
-
from Android Suite install:
- default install location:
~/Library/Android/skd
- default install location:
-
after install, set path files in
~/.bashrc
as follows:export ANDROID_HOME="/Users/aguest/Library/Android/sdk" export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
-
launch Android SDK Manager
- launched automatically after install?
- from welcome dialogue, click "Configure"
- or from CL:
android sdk
(after setting path)
-
config:
- choose device, target OS, chipset, memory allocation
- be sure to allocate enough memory in HAXM to run it!
-
launch
- from CL:
android avd
- from Android Suite: ??
- from CL:
-
necessary to make yr emulator not run at snail's pace
-
default install doesn't seem to work
-
Default Install (doesn't work!):
- is an option in Android SDK Manager
- dmg located at:
~/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/
- default RAM allocation is 1024, often not enough for emulators
- to re-install nav to dmg, run package installer, reset memory
-
Manual Install
-
Checks:
- that it exists:
kextstat | grep intel
-> look for status message showing thatcom.intel.kext.intelhaxm
is loaded - to stop (doesn't work):
sudo kextunload –b com.intel.kext.intelhaxm
- to start (doesn't work):
sudo kextload –b com.intel.kext.intelhaxm
- to uninstall:
sudo /System/Library/Extensions/intelhaxm.kext/Contents/Resources/uninstall.sh
- that it exists:
-
launch
- from AVD: click 'Start' in appropriate row
- from CL:
emulator @<avd_name_here>
(include--verbose
flag for debugging)
-
lauch emulator
- no dice!
- w/ HAXM: empty white screen
- w/o HAXM: stuck on floaty android logo screen
-
clues:
- "HAXM driver does not support emulating a 64 bit system image on Intel systems based on Core microarchitecture (Core, Core2 Duo etc.)."