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. [CSP-S模拟测试73]题解

    A.小P的2048 作为一个看B哥玩了一个寒假的人这种题闭眼切好吧 模拟即可.程序模块化后直接复制粘贴. 说什么模拟不能复制粘贴的都没水平 #include<cstdio> #includ ...

  2. python中常用得字符串,列表函数汇总

    字符串函数: 1,replace函数,替换函数.s = s.replace(old,new),老得元素被新的元素替换.注意不能直接写s.replace(old,new).要写s=s.replace(o ...

  3. shell 截取变量的字符串

    假设有变量 var=http://www.linuxidc.com/test.htm一 # 号截取,删除左边字符,保留右边字符.echo ${var#*//}其中 var 是变量名,# 号是运算符,* ...

  4. 读取 appsettings.json

    Appsettings.json 配置: 个配置文件就是一个json文件,并且是严格的json文件,所有的属性都需要添加“”引号.下图是一个常规的代码示例: {"UrlString" ...

  5. PHP DOMDocument操作 XML类 属性、方法

    属性: Attributes 存储节点的属性列表(只读) childNodes 存储节点的子节点列表(只读) dataType 返回此节点的数据类型 Definition 以DTD或XML模式给出的节 ...

  6. appium常见问题03_appium脚本报错selenium.common.exceptions.WebDriverException

    运行appium脚本时报错selenium.common.exceptions.WebDriverException...,如下截图: 该报错说明appium和app的内置chrome版本不一致 [解 ...

  7. python 装饰器 第五步(1):带有参数的装饰器

    #第五步:带有参数的装饰器 #用于扩展基本函数的函数 def kuozhan(func): #内部函数(扩展之后的eat函数) #5由于调用的时候传了两个参数,未来的eat函数没有参数接收 #5报错的 ...

  8. for语句基础求和练习

    结构 for(初始化表达式;条件表达式;循环后的操作表达式) { 循环体; } 1.求出1-10之间数据之和: class Hello2 { public static void main(Strin ...

  9. 阿里巴巴高级Java面试题(首发,70道)

    整理的70道阿里的Java面试题,都来挑战一下,看看自己有多厉害.下面题目都带超详细的解答,详情见底部. 1.java事件机制包括哪三个部分?分别介绍. 2.为什么要使用线程池? 3.线程池有什么作用 ...

  10. 2019年RTC大会记录

    小编近期在研究webRTC点对点通信技术,怀着学习的心态参加了2019年RTC大会,对所见所闻做下记录,不对的地方还请批评指正! 这次热门的话题是5G.WebRTC.AI对图像.音视频的相关处理,思科 ...