How to Use third-party jar packages on Android platforms

Source: Internet
Author: User

The online search results show that they are added by adding the build path or using the user library. I don't know whether these complicated pasting persons have been tested or not, but I have never been able to perform the test for a long time, it is estimated that my RP will not work, so that it will pass the compilation after being added, but an error such as class cannot be found will be prompted during running.

I added it like this. After testing, compilation and running are all correct;

Right-click the project,
Build path,
Java build path, select Libraries
Click "add library" in the button on the right"
Select "User library" and click "Next"
Click "User librarys ".
On the displayed page, click "new ...".
In the pop-up interface, enter a name and click "OK"
Click "add jars" to select a third-party jar package and click "OK.

The subsequent steps are very important if you do not perform subsequent operations. There will be no errors when compilation is passed in eclipse, but errors such as Java. Lang. noclassdeffounderror may occur when running on a simulator or a real machine:

1. Create a libs folder under the root directory of the android project;

2. Copy the required third-party jar package to this directory;

3. Right-click the libs directory and choose bulid path-> use as source folder.

This is done. Very simple.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.