【问题标题】:How do you include Android N source code inside Android Studio?如何在 Android Studio 中包含 Android N 源代码?
【发布时间】:2016-08-20 21:24:47
【问题描述】:

在 Android Studio 中开发时如何包含/下载 Android N 源代码?

文档/源代码目前在 Android SDK 管理器中不可用。

@Passer by 感谢您的通知,我设法下载了:

【问题讨论】:

    标签: android android-studio android-studio-2.2 android-7.0-nougat


    【解决方案1】:

    现在可以从 SDK 获得 Android N 的源代码。

    【讨论】:

    • 谢谢,更新可用,我正在下载它:24.08.2016 22:23 UTC
    【解决方案2】:

    目前,没有可从 SDK Manager 下载的可用文档和 SDK 源代码,只有编译好的 SDK 和示例(请参阅GitHub)。但是您可以使用 updated for N API ReferenceAndroid API Differences Report 来找出代码。

    更新:Google 将 Android 7.0 推送到 AOSP,因此您现在可以从 SDK Manager 下载 API 24 的源代码

    要在项目中使用 N 预览版 SDK,请更新您的 build.gradle,如下所示:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 'android-N'
        buildToolsVersion "24.0.1"
    
        defaultConfig {
            applicationId "com.alvenir.myapplication"
            minSdkVersion 'N'
            targetSdkVersion 'N'
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    }
    

    【讨论】:

    • 感谢您的详细说明,我已经在 Android Studio 中使用了 Android N,我只是想问是否可以在不必上网获取 API 参考/文档的情况下获取源代码。我希望既然文档可以在线获得,那么它也可以以某种方式在本地下载。
    猜你喜欢
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    • 2015-06-12
    • 2015-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-25
    相关资源
    最近更新 更多