tags:

views:

421

answers:

2

Hi,

I want to make my android application as executable file that can install in any other android emulator like JAR in java programming.If anyone know please help me.

+2  A: 

They are called APK files. You can create them via Eclipse or Ant.

CommonsWare
A: 

Helloworld.java:

view plaincopy to clipboardprint?

  1. class Helloworld {
  2. public static void main(String[] args) {
  3. System.out.println("Hello World!");
  4. }
  5. }

class Helloworld { public static void main(String[] args) { System.out.println("Hello World!"); } }

Makefile:

view plaincopy to clipboardprint?

  1. android_dir_dx = $(ANDROID_SRC_DIR)/out/host/linux-x86/bin/dx
    1. all:
  2. javac Helloworld.java
  3. $(android_dir_dx) --dex --output=Helloworld.jar Helloworld.class
  4. clean:
  5. @rm *.jar *.class

android_dir_dx = $(ANDROID_SRC_DIR)/out/host/linux-x86/bin/dx all: javac Helloworld.java $(android_dir_dx) --dex --output=Helloworld.jar Helloworld.class clean: @rm *.jar *.class

run:

dalvikvm -cp /Helloworld.jar Helloworld

zhanghaoran