What is the most primitive possible toolchain for android programming?

为君一笑 提交于 2019-12-05 14:21:06

Primitive? So, not Eclipse, and also not ant. You can use aapt, javac, dx, apkbuilder, and signer directly. Or more-or-less directly; you're still a programmer, you have ways of dealing with repetition.

I do some on-device app development with Terminal IDE. This is one my build scripts (named 'make'):

P=me/rapacity/stitch

rm src/$P/R.java
mkdir -m 770 -p dist || exit
mkdir -m 770 -p build/classes || exit
mkdir -m 770 -p tmp || exit

./index.perl

aapt p -f -M AndroidManifest.xml -F build/resources.res \
     -I ~/sdk/3.2/android.jar -S res/ -J src/$P || exit

cd src
for F in \
    SelectActivity.java Tilesets.java \
        StitchActivity.java \
        TilesetView.java \
; do
  if test $P/$F -nt ../build/classes/$P/$(dirname $F)/$(basename $F .java).class; then
    echo Building $P/$F
    REBUILD=1
    javac -d ../build/classes $P/$F 2> ../tmp/javac.out
    ../redcat ../tmp/javac.out
    grep error ../tmp/javac.out && exit
  fi
done
cd ..

if [ ! -z $REBUILD ]; then
  set -x
  ( cd src; javac -d ../build/classes $P/R.java )
  ( cd build/classes; dx --dex --verbose --no-strict --output=../core.dex me ) ||  # 'me' as in me.rapacity.

  apkbuilder dist/core.apk -u -z build/resources.res -f build/core.dex || exit
  signer dist/core.apk core-debug.apk
else
  echo +++ No need to rebuild .apk
fi

in which some lengths are gone to to avoid recompilation and to promptly exit after an error. Very little of that needs to be edited per-project.

  1. Java SE 6 (NOT Java7!)
  2. Recommended IDE is Eclipse (recommended as there are guides for it on the official documentation)
  3. Android SDK (you need to download the API you want to develop for) and ADT - the android development tools - Guide

Optional:

  1. Device and a connection for it, recommended, not necessary as an Emulator is bundled in the Android SDK

Give AIDE a try for Android on-device App development. It is very easy to get started and the project format is fully compatible with Eclipse, so if you want to continue development on your PC you can.

Getting started video: http://www.youtube.com/watch?feature=player_embedded&v=NGT9MqT3W2w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!