0

It would be better if detailed commands provided. Thanks!

I can use the method adopted by android am/pm program:

1. create Android.mk and java file
2. compile using mmm
3. put the generated jar to target /data/
4. run it:
# export CLASS_PATH=/data/MyTest.jar
# app_process /data com.android.test.MyTest

It work, but somewhat difficult. I think there must be an easier way using dx/dvz/dalvikvm.

2 Answers 2

1

It would be much easier if you used eclipse to wrap all those commands. ADT plugin for eclipse is just great and productive.

Sign up to request clarification or add additional context in comments.

3 Comments

I don't wanna influence you. But I have been an emacs advocate and contributor for a few years. It was so productive to my mind... but 3 years back, I switched to eclipse and I can't imagine a more productive environment. I hope you have a good alternative like netbeans or IdeaJ, but you shouldn't disregard those IDEs, they really dramatically improve coding speed, ease refactoring and help you benefit from cutting edge technologies.
Sorry. I meant I prefer vim to eclipse. eclipse is good too, except that it's a little slow.
Yeah the vim plugin for eclipse just isn't up to par with normal vim, at all. Maybe you can use eclipse to compile and run, and vim to edit.
1

Assuming you do mean a Java hello world, and not an Android hello world:

javac Hello.java
dx --dex --no-strict --output=Hello.jar Hello.class
java -jar Hello.jar Hello

Terminal IDE, an app on the market, allows you to do this on the device, or to telnet into the device and then make use of them.

2 Comments

Dear Julian, this still don't work. The android device doesn't have JAVA program. I have tried run the jar with dalvikvm, but it failed.
@soul2003, Terminal IDE provides it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.