10

Here is my situation, I have a Custom Programming Language that compile down into Java Byte Code. I have the jar and I am looking to use some of the classes in an Android Application. I need some advice on how to approach this. I can import some of these classes from the jar but im not sure how I can compile/run this on Android. Any advice is appreciated Thanks

user2701224
  • 119
  • 2
  • 5
    Why the down and close votes? This looks to me to be exactly on topic and of interest to Android developers. I can see no valid reason to downvote or to close. I do wonder if people closing as off-topic have actually read the [FAQ](http://stackoverflow.com/help/on-topic) Welcome to Stackoverflow @user2701224. A good opening question, so +1 from me. I hope you get a useful answer. – Simon Aug 20 '13 at 20:01
  • 3
    Also +1 from me. My 2 cents about your question: the compiled classes must be compliant with Java compiler version 1.6, otherwise they cannot be processed and converted by the Android tool chain to Dalvik's executable format. You should be able to just put your (compliant) JAR into your app project's "libs" folder from where it should be automatically be picked up and bundled with your APK. If you work with Eclipse add the Jar to the build path so you get code completion. Reference your JAR's classes from your Android app's Java code. – tiguchi Aug 20 '13 at 20:12
  • You need to actually phrase more of a 'question' your asking advice, which is more a quora style thing. Tangible question will get a tangible answer. – Chris.Jenkins Aug 21 '13 at 23:08
  • @Simon The `off-topic` term is being interpreted differently here, although [not everyone agrees with that](http://meta.stackexchange.com/q/192086/172431). – madth3 Sep 12 '13 at 18:48

2 Answers2

1

if you want to use your jar in Android on Eclipse, as i remember, you can copy your jar file, paste it in the "lib" folder in your android project, then right click your project in your eclipse IDE

Right click on project >

Build path >

Configure Build path >

(from the left list) choose Java Build Path >

(from the right side) click on Add Jars button >

(a window popup will show) click on your project >

click on it's libs folder >

click on your jar file >

click on OK button

then you are done

Ahmed Adel Ismail
  • 2,168
  • 16
  • 23
0

If I understand your situation correctly, you should just include the jar in your build path and import/use whatever classes you may need.. hope it helps.. you might need to explain yourself a bit better if not..

mestrebisli
  • 83
  • 1
  • 8