/android-emacs-toolkit

Automatically exported from code.google.com/p/android-emacs-toolkit

Primary LanguageEmacs LispOtherNOASSERTION

Readme for android-emacs-toolkit

WHATE IS ANDROID-EMACS-TOOLKIT FOR

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 STRUCTURE

Folder nameDescription
ndkscriptShell script for toolkit
–\ _adbt.shShell script for text executable program on emulator
–\ adr.shShell script to install and run executable program on emulator
–\ api.shShell script to install apk on emulator
–\ apu.shShell script to uninstall apk on emulator
–\ init.shShell script to set environment variables for current shell
–\ lgs.shShell script to clean and start log of emulator
–\ mhp.shShell script for help
–\ ndbr.shShell script to build or rebuild program with NDK
jni_templateTemplate folder for ndk project
–\ Android.mkMakefile for ndk project
–\ Application.mkSetting for ndk project
–\ hello-jni.cCode for lib
–\ helloworld.cppCode for executable
androidmk-mode.elEmacs script for toolkit
README.orgReadme
ChangeLogChange log
LICENSELicense
AUTHORSAuthors

USAGE

For Windows users

  1. Install emacs.
  2. Install android-sdk-windows.
  3. Install android-ndk-windows.
  4. Install ant.
  5. Add ant bin folder to PATH.
    (setenv "PATH" (concat "c:/apache-ant-1.8.2/bin/;" (getenv "PATH")))
        
  6. Install cygwin.
  7. 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))
        
  8. 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")
        
  9. 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)
                       )))
        
  10. RUNNING EXAMPLES

For Ubuntu users

  1. Install emacs (sudo apt-get install emacs).
  2. Install android-sdk-linux.
  3. Install android-ndk-linux.
  4. Install ant.
  5. 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")
        
  6. 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)
                       )))
        
  7. RUNNING EXAMPLES

RUNNING EXAMPLES

  1. Follow usage.
  2. Create new android avd.
    M-x android-create-avd
        

    Input avd name.

  3. Launch android avd.
    M-x android-launch-avd
        

    Input avd name.

  4. Output log.
    M-x android-start-log
        
  5. 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.

  6. Build project with ant and install.
    M-x androidsdk-build
        

    Hello world will print on emulator.

  7. Build ndk project with ndk-build and run.
    M-x androidndk-build
        

    Hello world will print on android-log buffer.

preview.gif

MORE INFORMATION

You can find more information at the project website

http://code.google.com/p/android-emacs-toolkit/

LICENSE

This toolkit is licensed under the GPL v3.

AUTHOR’S WORDS

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.