Android-emacs-toolkit helps to build android development environment on emacs. It contains a emacs major mode which help to develop android sdk and ndk program.
It provides support for create new avd, launch avd, create new android project, build and rebuild Android sdk project, build and rebuild Android ndk project, install and uninstall apk, run executable ndk project, output emulator log on emacs.
This toolkit tested on WindowsXP/7, Ubuntu11 with android-sdk and android-ndk-r7.
Folder name | Description |
---|---|
ndkscript | Shell script for toolkit |
–\ _adbt.sh | Shell script for text executable program on emulator |
–\ adr.sh | Shell script to install and run executable program on emulator |
–\ api.sh | Shell script to install apk on emulator |
–\ apu.sh | Shell script to uninstall apk on emulator |
–\ init.sh | Shell script to set environment variables for current shell |
–\ lgs.sh | Shell script to clean and start log of emulator |
–\ mhp.sh | Shell script for help |
–\ ndbr.sh | Shell script to build or rebuild program with NDK |
jni_template | Template folder for ndk project |
–\ Android.mk | Makefile for ndk project |
–\ Application.mk | Setting for ndk project |
–\ hello-jni.c | Code for lib |
–\ helloworld.cpp | Code for executable |
androidmk-mode.el | Emacs script for toolkit |
README.org | Readme |
ChangeLog | Change log |
LICENSE | License |
AUTHORS | Authors |
- Install emacs.
- Install android-sdk-windows.
- Install android-ndk-windows.
- Install ant.
- Add ant bin folder to PATH.
(setenv "PATH" (concat "c:/apache-ant-1.8.2/bin/;" (getenv "PATH")))
- Install cygwin.
- Set up cygwin for emacs.
(when (eq system-type 'windows-nt) (require 'cygwin-mount) (cygwin-mount-activate) (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt nil t) (setq explicit-shell-file-name "bash.exe") ;; For subprocesses invoked via the shell ;; (e.g., "shell -c command") (setq shell-file-name explicit-shell-file-name))
- Set some defvar.
;; Do not use '\' instead '/' (if (eq system-type 'windows-nt) (progn (setq android-ndk-root-path "e:/zxy/home/program/android-ndk-r7-windows") (setq android-sdk-root-path "e:/zxy/home/program/android-sdk-windows")) ;; Ubuntu do not understanding '~' instead of 'home' (progn (setq android-ndk-root-path "/home/share/program/android-ndk-r7-linux") (setq android-sdk-root-path "/home/share/program/android-sdk-linux"))) (setq android-default-package "com.zxy")
- Add android-emacs-toolkit to emacs.
(add-to-list 'load-path "c:/android-emacs-toolkit") (require 'androidmk-mode) (add-hook 'androidmk-mode-hook (lambda () (progn (local-set-key [M-f5] 'androidndk-build) (local-set-key [M-S-f5] 'androidndk-rebuild) (local-set-key [C-f5] 'androidsdk-build) (local-set-key [C-S-f5] 'androidsdk-rebuild) )))
- RUNNING EXAMPLES
- Install emacs (sudo apt-get install emacs).
- Install android-sdk-linux.
- Install android-ndk-linux.
- Install ant.
- Set some defvar.
;; Do not use '\' instead '/' (if (eq system-type 'windows-nt) (progn (setq android-ndk-root-path "e:/zxy/home/program/android-ndk-r7-windows") (setq android-sdk-root-path "e:/zxy/home/program/android-sdk-windows")) ;; Ubuntu do not understanding '~' instead of 'home' (progn (setq android-ndk-root-path "/home/share/program/android-ndk-r7-linux") (setq android-sdk-root-path "/home/share/program/android-sdk-linux"))) (setq android-default-package "com.zxy")
- Add android-emacs-toolkit to emacs.
(add-to-list 'load-path "c:/android-emacs-toolkit") (require 'androidmk-mode) (add-hook 'androidmk-mode-hook (lambda () (progn (local-set-key [M-f5] 'androidndk-build) (local-set-key [M-S-f5] 'androidndk-rebuild) (local-set-key [C-f5] 'androidsdk-build) (local-set-key [C-S-f5] 'androidsdk-rebuild) )))
- RUNNING EXAMPLES
- Follow usage.
- Create new android avd.
M-x android-create-avd
Input avd name.
- Launch android avd.
M-x android-launch-avd
Input avd name.
- Output log.
M-x android-start-log
- Create new android project.
M-x android-new-project
Input project path, project name, project target, project pachage, project activity and whether create jni folder. Then java file is open.
- Build project with ant and install.
M-x androidsdk-build
Hello world will print on emulator.
- Build ndk project with ndk-build and run.
M-x androidndk-build
Hello world will print on android-log buffer.
You can find more information at the project website
http://code.google.com/p/android-emacs-toolkit/
This toolkit is licensed under the GPL v3.
If you find a bug, please post at Issues. If you have not find a bug and feel this project helpful, please star it. Every star can make me know what I do can help other people and drove me forward.