By: Jason
Snell
 | Posted in: MobilePerformance
Tech Tips
Top
Post
, Jun. 7th, 2013

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:

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’:

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.gradle file:

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!

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:

buildscript
{
  repositories
{
    mavenCentral()
  }
  dependencies
{
    classpath
'com.newrelic.agent.android:agent-gradle-plugin:+'
  }
}
 
repositories
{
  mavenCentral()
}
 
apply
plugin:
'android'
apply
plugin:
'newrelic'
 
dependencies
{
  compile
'com.newrelic.agent.android:android-agent:+'
}

Then add an import to your default Activity class:

import

com.newrelic.agent.android.NewRelic;

And in the onCreate() method, add this call to initialize New Relic:

NewRelic.withApplicationToken("<your
mobile app token>"
).start(this.getApplication());

That’s it! We’d love to hear about your migration stories. Let us know your experiences in the comments below.

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的更多相关文章

  1. 第四篇:Eclipse Android app 工程迁移到 Android Studio

    前言:这种问题当然在所难免,所幸android studio的project 工程目录远比 Eclipse 要了然. 目录对比 我们在Eclipse中创建一个EclipseDemo的Android项目 ...

  2. Android开发环境--eclipse和Android Studio

    一.eclipse下载.安装.配置 因为eclipse是之前就下载过的,现在只能大概说一下eclipse的下载安装过程. 1.下载jdk,配置java环境变量  (1)在官网(http://www.o ...

  3. Android开发由eclipse转Android Studio中一些常见出错问题解决方法

    1.给一个Activity添加了一个Dialog主题,结果出现了下面的问题,在eclipse却没有出错 <activity android:name=".DialogActivity& ...

  4. Android开发之Eclipse与Android Studio的java类 作者版权模板

    /** * 作者:${USER} on ${DATE} ${HOUR}:${MINUTE} * * 联系QQ:986945193 * * 微博:http://weibo.com/mcxiaobing ...

  5. Eclipse与Android源码中ProGuard工具的使用

    由于工作需要,这两天和同事在研究android下面的ProGuard工具的使用,通过查看android官网对该工具的介绍以及网络上其它相关资料,再加上自己的亲手实践,算是有了一个基本了解.下面将自己的 ...

  6. 用 Eclipse 开发 Android 应用程序

    转自:http://www.apkbus.com/android-13828-1-1.html 开始之前 本教程介绍如何在 Eclipse 环境中进行 Android 应用程序开发,包括两个示例应用程 ...

  7. Eclipse与Android源码中ProGuard工具的使用(代码混淆)

    由于工作需要,这两天和同事在研究android下面的ProGuard工具的使用,通过查看android官网对该工具的介绍以及网络上其它相关资料,再加上自己的亲手实践,算是有了一个基本了解.下面将自己的 ...

  8. 根坤 eclipse配置android开发环境并搭建第一个helloWord工程

    一.搭建Android在eclipse下环境    一.JDK(不用安装  下载地址: http://www.xp510.com/xiazai/Application/program/23625.ht ...

  9. How To Use Proguard in Android APP

    在Android开发完成即将发布给用户使用时,还有最后重要的一步:代码混淆,这时候,Proguard就派上用场了,大家谁也不想辛辛苦苦写的代码太容易被别人反编译过来,而Proguard就是帮我们实现这 ...

随机推荐

  1. CodeForces - 849B 几何

    题意:给n个点,问是否能两条平行线覆盖所有的点 思路:因为要求全部覆盖,所以我们第一个点肯定是会入其中一条直线,其实只用判前三个点的所有情况即可 #include<stdio.h> #in ...

  2. MongoDB(7):集群部署实践,包含复制集,分片

    注: 刚开始学习MongoDB,写的有点麻烦了,网上教程都是很少的代码就完成了集群的部署, 纯属个人实践,错误之处望指正!有好的建议和资料请联系我QQ:1176479642 集群架构: 2mongos ...

  3. arcgis api for javascipt 加载天地图、百度地图

    写在前面的话: 1.百度地图是自己定义的坐标系统,wkid=102100.百度地图数据是加密的产物.下文将附上百度坐标与WGS84,谷歌等坐标系统转换方法(地理-地理),此方法并未亲测,据说准 2.百 ...

  4. nginx配置-location

    以 =开头表示精确匹配如 A 中只匹配根目录结尾的请求,后面不能带任何字符串. ^~ 开头表示uri以某个常规字符串开头,不是正则匹配 ~ 开头表示区分大小写的正则匹配; ~* 开头表示不区分大小写的 ...

  5. MVC 入门

    MVC是什么? MVC是一个框架模式,它用于把应用程序的输入.处理和输出进行强制性的分开.使用MVC应用程序被分成三个核心部件:模型.视图.控制器.它们各自处理自己的任务.最典型的MVC就是JSP+S ...

  6. java继承方法覆盖

    public class TestB { private void f() { System.out.println("TestB"); } public static void ...

  7. smartGit的使用

    合理管理自己的代码,对程序员来说是一件很重要的事,今天我也走上了github托管之路 要在Git上托管代码,首先你要要github官网创建一个代码仓库,用来放你的代码. 一,要托管到github,那你 ...

  8. Get column value of Flex Datagrid by QTP

    ' get the number of rows in the tablerowCount=Browser("Browser").FlexApplication("App ...

  9. web自动化,selenium 无法清空输入框默认值继续输入

    有的页面输入框自带默认值,想要修改里面的内容时,先使用clear()再send_keys(),这种方式无法清除只会在默认值后面追加内容,不是我想要的结果 解决方法: 方法一: 先双击,后直接send_ ...

  10. tp5 之 "No input file specified

    tp5 之 "No input file specified" 问题 通过"域名/模块/控制器/方法"这样的方式访问的时候,浏览器输出如下: 直接通过" ...