Reputation: 3121
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?
Upvotes: 16
Views: 8964
Reputation: 141
To use Google Play Services: In the build.gradle file:
dependencies {
compile 'com.google.android.gms:play-services:4.2.42'
}
In the AndroidManifest.xml file:
<application >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
I actually had the android:value="4242000" but AndroidStudio auto-corrected it to the above, which compiles, so I left it, since it is less fragile.
Upvotes: 0
Reputation: 1475
This worked for me.
In the build.gradle file:
dependencies {
compile files('libs/android-support-v4.jar')
compile project(':MyLibrary')
}
And, in the IntelliJ Module file, HelloWorld.iml:
<orderEntry type="library" name="android-support-v4" level="application" />
<orderEntry type="library" name="MyLibrary.aar" level="project" />
In the library project, there’s not much to do: tell Gradle and Android Studio that this is an Android library, with apply plugin: ‘android-library’ and option name=”LIBRARY_PROJECT” value=”true” , respectively.
Upvotes: 2
Reputation: 17140
Upvotes: 5