简体   繁体   中英

How to add a library through Android Studio

For my project, I would like to use the USB Serial For Android Library, from mik3y.

I tried to follow these step to link the library to my project, from Eclipse. But it won't work.

So I would like to know how to add this library through Android Studio.

Can you guide me please ?

you can follow this way, to add library to android studio

  • Open your project in Android Studio.

  • Download the library (using Git, or a zip archive to unzip)

  • Go to File > Import Module and import the library as a module.
  • Go to File > Project Structure > Modules.
  • Locate your main project module, click on it. ...
  • Click on the more on the left green "+" button > Module dependency.

please visit this for more details.

You can download the code source from Github and import the library as a module in Android studio.

  1. Download and extract the source code in a folder
  2. In android studio: File -> New -> Import module
  3. browse to the location when you extracted the library and select usbSerialForAndroid, then OK
  4. Let Android studio sync, you may need to do some changes in the buil.gradle file of the new module if you use different Android API
  5. Now, File -> Project Structure -> app -> dependencies -> add module dependencies and select your module

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