zakkak / android-emacs-toolkit

Automatically exported from code.google.com/p/android-emacs-toolkit
Other
6 stars 1 forks source link

+STARTUP: indent

+OPTIONS: H:4

+AUTHOR: Zxy

+EMAIL: gcoordinate@gmail.com

+TITLE: Readme for android-emacs-toolkit

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 |

** For Windows users

  1. Install [[http://www.gnu.org/software/emacs/][emacs]].

  2. Install [[http://developer.android.com/sdk/index.html][android-sdk-windows]].

  3. Install [[http://developer.android.com/sdk/ndk/index.html][android-ndk-windows]].

  4. Install [[http://ant.apache.org/bindownload.cgi][ant]].

  5. Add ant bin folder to PATH.

    +begin_src emacs-lisp

    (setenv "PATH" (concat "c:/apache-ant-1.8.2/bin/;" (getenv "PATH")))

    +end_src

  6. Install [[http://cygwin.com/install.html][cygwin]].

  7. Set up cygwin for emacs.

    +begin_src emacs-lisp

    (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))

    +end_src

  8. Set some defvar.

    +begin_src emacs-lisp

    ;; 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")

    +end_src

  9. Add android-emacs-toolkit to emacs.

    +begin_src emacs-lisp

    (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) )))

    +end_src

  10. [[*RUNNING%20EXAMPLES][RUNNING EXAMPLES]]

** For Ubuntu users

  1. Install [[http://www.gnu.org/software/emacs/][emacs]] (sudo apt-get install emacs).

  2. Install [[http://developer.android.com/sdk/index.html][android-sdk-linux]].

  3. Install [[http://developer.android.com/sdk/ndk/index.html][android-ndk-linux]].

  4. Install [[http://ant.apache.org/bindownload.cgi][ant]].

  5. Set some defvar.

    +begin_src emacs-lisp

    ;; 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")

    +end_src

  6. Add android-emacs-toolkit to emacs.

    +begin_src emacs-lisp

    (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) )))

    +end_src

  7. [[*RUNNING%20EXAMPLES][RUNNING EXAMPLES]]

  1. Create new android avd.

    +begin_src emacs-lisp

    M-x android-create-avd

    +end_src

    Input avd name.

  2. Launch android avd.

    +begin_src emacs-lisp

    M-x android-launch-avd

    +end_src

    Input avd name.

  3. Output log.

    +BEGIN_SRC emacs-lisp

    M-x android-start-log

    +END_SRC

  4. Create new android project.

    +BEGIN_SRC emacs-lisp

    M-x android-new-project

    +END_SRC

    Input project path, project name, project target, project pachage, project activity and whether create jni folder. Then java file is open.

  5. Build project with ant and install.

    +BEGIN_SRC emacs-lisp

    M-x androidsdk-build

    +END_SRC

    Hello world will print on emulator.

  6. Build ndk project with ndk-build and run.

    +BEGIN_SRC emacs-lisp

    M-x androidndk-build

    +END_SRC

    Hello world will print on android-log buffer.

[[file:preview.gif][preview.gif]]

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.