Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - how to use libraries (from eclipse projects)

Yes. Everybody are testing Android Studio. I'm using Eclipse in my projects and I want to migrate to Android Studio. I'm having problems with my projects.

I read this page: http://developer.android.com/sdk/installing/migrate.html

Not a great how to in my opinion.

I'm using in my project libraries that are not in .jar formats but they're eclipse projects (with checked "is library" in properties).

Could you tell me how to move my projects to Android Studio? I'm having problems and tons of errors. I'm also using Google Play Services and Android Studio showed me old versions of the same API's.

How to add for example ActionBarSherlock or Android-ViewPagerIndicator?

Shoud I import just like in eclipse all of these projects. But in Android Studio I can't mark project as library or not?

like image 329
adek Avatar asked May 16 '13 21:05

adek


People also ask

How do I add a library project to Android Studio?

Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.

Can I use Java libraries in Android?

To use a Java library (JAR file) inside your Android project, you can simple copy the JAR file into the folder called libs in your application. *. jar files in this folder are included into the compile classpath via the default build.

Can I use Eclipse with Android Studio?

Import as a project: Start Android Studio and close any open Android Studio projects. From the Android Studio menu click File > New > Import Project. Alternatively, from the Welcome screen, click Import project (Eclipse ADT, Gradle, etc.).


1 Answers

  1. Open the Project Structure (cmd-; on osx or just File > Project Structure)
  2. Go to facets
  3. Select the module (the project you imported)
  4. there will be a "library module " checkbox at the top
like image 107
petey Avatar answered Sep 17 '22 21:09

petey