AS-->Android Studio直接打开/导入/编译Eclipse项目

请参考文献: http://blog.csdn.net/angcyo/article/details/45741673 有更简单的方法,直接打开Eclipse项目;

Eclipse项目结构: 
这里写图片描述

只需要在项目中添加,红色圈圈内的3个文件,即可: 
这里写图片描述


需要注意的是: 
build.gradle文件内容需要修改如下:

buildscript {
    repositories {
        jcenter()
    }
    //这一段一定要
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
    }
    //end
}
apply plugin: 'com.android.application'
android {
    compileSdkVersion 19
    buildToolsVersion "23.0.0 rc3"

    //这一段一定要
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDirs = ['libs']
        }
    }
    //end
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
}

 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34

其他2个文件,可以从其他的AS项目复制过来;


配置完之后,就可以直接使用AS 打开这个Eclipse项目了: 
这里写图片描述 
选择,打开一个存在的AS项目,这个提示框,表示选择在线下载gradle还是使用本地的Grandle,

在线下载,,,可能需要很长时间, 
如果之前写过AS项目,这里可以点击 Cancel,向导会引导你使用本地的Gradle;

这里写图片描述


点击OK.之后,你就可以见证奇迹的一刻了;

上述3个文件下载路径;http://download.csdn.net/detail/angcyo/9006461


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值