简体   繁体   中英

How to add a non-Android Java package to the Android development environment?

So far I have been using in tutorials, examples and sample code only packages that came pre-installed with the Android SDK.

Now, I want to add a non-Android package (eg Jsoup).

What's the proper way of doing that (so that it becomes available to all projects)?

You can add it to a project by right clicking on your project in Eclipse and choose Build Path and Add External Archive. Select the jar to add it to your build path and it will be included in any apk you create.

One caveat is that if the jar may use part of the JDK that doesn't exist in Android.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM