john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

ide on android javac dex terminalide

Terminal IDE is a complete java / android development environment that runs on the android device.

javac, java, dx, aapt, apkbuilder, signer, ssh, sshd, telnetd, bash 4.2, busybox 1.19.2, vim 7.3 and a nice terminal emulator are all available.

  • http://www.spartacusrex.com/terminalide.htm
  • http://code.google.com/p/terminal-ide/

simplest java android app source code

public class hi
{
    public static void main( String[] args )
    {
        System.out.println( "hi" );
    }
}

automate the build

vi johnbuild.sh
if [ $# -ne 1 ]; then echo "Error: usage is $0 appname"
  exit 1
fi

SOURCE="$1.java"
CLASS="$1.class"
JAR="$1.jar"
if [ -f $CLASS ]; then
    rm $CLASS
fi
if [ -f $JAR ]; then
    rm $JAR
fi
javac $SOURCE
dx --dex --verbose --output=$JAR ./$CLASS

automate all that typing

java -jar $1.jar $1

SUCCESS! that's right, wrote the code, then compiled and ran it from the command line all in Android!


ybuild.sh

rm -rf ./build/*
rm -rf ./dist/*
mkdir -m 770 -p build/classes
rm src/org/me/mydemo/R.java

aapt p -f -v -M AndroidManifest.xml -F ./build/resources.res -I ~/system/classes/android.jar -S res/ -J src/org/me/mydemo
cd src
javac -d ../build/classes org/me/mydemo/MainActivity.java 
cd ..
cd build/classes/
dx --dex --verbose --no-strict --output=../mydemo.dex org
cd ../..
apkbuilder ./dist/mydemo.apk -v -u -z ./build/resources.res -f ./build/mydemo.dex 
cd dist
signer mydemo.apk mydemo_signed.apk
cd ..

more automation to avoid typing

zinstall.sh

cd ~/system/src/myandroid/
if [ -f /sdcard/mydemo_signed.apk ];then
  rm /sdcard/mydemo_signed.apk
fi

cp ./dist/mydemo_signed.apk /sdcard/

am start -a android.intent.action.VIEW -t application/vnd.android.package-archive -d file:///sdcard/mydemo_signed.apk

automation of the package signing


  • « Ubuntu base image hardening
  • Android ontouchevent read file »

Published

May 7, 2012

Category

android

~214 words

Tags

  • android 9
  • dex 1
  • ide 4
  • java 252
  • javac 1
  • terminalide 1