CloudServices/NativeSync
Native Sync
Setup
Setting up an Android dev environment
- note: installing *all* the platform tools (all Android from 1 to 3.3) takes a while, if you only need a specific SDK version, just install from the GUI tool:
$SDK/tools/android
Emulators
- create emulator with $SDK/tools/android, menubar>Tools>Manage AVDs...
- Target (probably) needs to match build specified in .mozconfig (see Building Fennec Native below)
- to launch:
$SDK/tools/emulator -wipe-data -avd <AVD> -partition-size 2047
(so you don't run into insufficient storage error)
After installation, fennec would crash on installation (unable to locate mozutils library, although it's in the apk). Possibly related to emulator failing to run NDK applications?
Running Fennec
- Android device: (WFM)
- enable USB debugging: Settings > Applications > Development > USB debugging
$SDK/platform-tools/adb install -r <path-to-apk>
- Emulator:
$SDK/tools/emulator (as another process:) $SDK/platform-tools/adb install -r <path-to-apk>
You may need to run adb kill-server, adb start-server if adb doesn't recognize the emulator.
N.B., NativeUI Fennec won't run in the emulator.
- Logcat debug statements
adb logcat
Setting up Eclipse
If you want to use Eclipse:
- Install it and the SDK plugin, as described in the Android SDK page.
- Run these in your repo:
mvn -Declipse.workspace=<eclipse-workspace> eclipse:add-maven-repo mvn -DdownloadJavadocs=true -DdownloadSources=true eclipse:eclipse
- Open Eclipse, choose File > Import… Existing Project, pick your repo dir.
- Correct formatting: Preferences > Java:Code style:Formatter, Edit…, change name to "Mozilla", change both indentation values to 2, tab policy = Spaces only, check "Align fields in columns".
Development
Let's stick to some fairly sane Java conventions: 2-space indenting (Java is wide enough as it is), Maven2 for dependencies and build, TestNG (or JUnit4, if we so decide) for unit tests. We can wire in Hudson later if we have time or feel it's a benefit up-front.
Let's figure out bleeding edge stuff ("how do I get a SyncAdapter to work?") in throwaway projects. There will be a lot of these :)