Migrating Your Android App from Eclipse to Android Studio
2014-03-10 17:29
211 查看
Snell | Posted in: Mobile, Performance
Tech Tips, Top
Post, Jun. 7th, 2013
12
inShare
![](http://www.linksalpha.com/images/social_share_button.png)
One of the more exciting announcements from Google
IO this year was the Android Team’s decision to release Android
Studio. Android Studio isJetBrains’
IntelliJ IDEA with a brand new, extremely rich, Android-focused plugin. (It’s similar to Eclipse with the ADT
package.) If you’re feeling adventurous, give it a spin by migrating one of your Eclipse apps.
Getting Started
First, you’ll need to update your SDK installation to the latest version. (Versions 22.0.0 and up will migrate your app to Android Studio.) After a few SDK Manager updates and restarts, you should see something like this:
![](http://blog-assets.newrelic.com/wp-content/uploads/Android_Studio_packages.png)
Now you’re ready to export your application from Eclipse. Google choseGradle as
the new Android build system, so we’ll generate the necessary build files first. From the Eclipse menu, choose ‘File’ and then click ‘Export’. Under the Android folder, you’ll find ‘Generate Gradle build files’:
![](http://blog-assets.newrelic.com/wp-content/uploads/AndroidStudio_Gradle.png)
Choose the project you want to migrate and click ‘Finish’. Next, exit Eclipse and fire up Android Studio. You’ll want to import an existing project. You can do it from the File menu or the wizard if you don’t have a project opened. Navigate to
the directory containing your app and double click the
build.gradlefile:
![](http://blog-assets.newrelic.com/wp-content/uploads/AndroidStudio_SelectFile1.png)
Now you’re almost there! Check ‘Use auto-import’ and select the Gradle wrapper. Or you can choose a Gradle distribution location if you have Gradle 1.6 installed. (This will skip the step of adding a few files to your project directory.) When you
click ‘Finish’, Android Studio will perform a few housekeeping tasks and open your shiny new Gradle project. Hurray!
![](http://blog-assets.newrelic.com/wp-content/uploads/AndroidStudio_ImportProject.png)
Bonus Round
Now that you’re working happily in Android Studio, isn’t it time to add a little New Relic action to the mix? Don’t have a New Relic account? (Sign
up for one today and get a free 30-day trial!)
First, merge the following into your build.gradle file:
from:http://blog.newrelic.com/2013/06/07/migrating-your-android-app-from-eclipse-to-android-studio/
相关文章推荐
- Migrating Your Android App from Eclipse to Android Studio
- Migrating Your Android App from Eclipse to Android Studio
- android studio导入eclipse的library/ import libraries from eclipse to android studio
- How to distribute your own Android library through jCenter and Maven Central from Android Studio
- How to distribute your own Android library through jCenter and Maven Central from Android Studio
- Where is the best place to store a password in your Android app
- 拿什么拯救:Android Studio 时代 继续使用Eclipse开发Android app时遇到的几个问题以及解决办法
- Android Studio vs. Eclipse: What You Need To Know
- Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. Looked here: C:\Users\Administrator\AppData\Local\Android\sdk\tools\templates\gradle\wrapper
- HowTo: Live streaming video/audio from VLC to your Android device (self.Android)
- Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: C:\android-ndk/jni /Android.mk
- you are attempting to install the android sdk inside your android studio installation
- How to sign app by android studio
- Update your app to take advantage of the larger aspect ratio on new Android flagship devices
- IDEA / Android studio 使用gradle 编译 Failed to resolve: com.android.support:appcompat-v7:27.+
- 【android,eclipse解决】eclipse insert "}" to complete ClassBodyR.java/appcompat_v7/gen/android/suppor
- 兔子-you are attempting to install the android sdk inside your android studio installation
- 混淆apk:Android中使用eclipse混淆apk和studio混淆app的不同
- Android *** android studio Error:Failed to resolve: com.android.support:appcompat-v7:23.+
- Android Tutorial: How To Post Data From An Android App To a Website