How to find every version of android support libraries source code

后端 未结 6 842
死守一世寂寞
死守一世寂寞 2021-01-04 00:53

I meets some problems so I want to find the source code of the Android support libraries . For example , I want to read the ActionBarActivity.java source code in version 19.

相关标签:
6条回答
  • 2021-01-04 01:07

    If you don't want to use any IDE, you can download command line tools only from https://developer.android.com/studio/index.html#downloads

    This example is for OSX:

    1. After download command line tools, you can run SDK Manager using this command: "sh android", maybe you need to add "sudo" before the command.
    2. SDK Manager will show up
    3. Select Sources for Android SDK or any packages you want to download
    4. Click button Install, and accept licences.
    5. After download succeed, you can navigate to the folder where you put the SDK, and then go to sources and navigate to ActionBarActivity or any sources you want
    0 讨论(0)
  • 2021-01-04 01:09

    If you have downloaded the sources, you should be able to find them versioned at one of these three places (using OSX, but should be familiar enough to deduce the OS locations)

    Android Sources

    ~/Library/Android/sdk/sources/

    Maven Local Repo

    ~/.m2/repository

    Gradle Cache (location could probably be a different name)

    ~/.gradle/caches/modules-2/files-2.1

    Using either of these, it shouldn't be too hard to do a diff of the source code that you need.

    0 讨论(0)
  • 2021-01-04 01:12

    You can use grepcode to see Android source code

    For example you want want to see ActionBarActivity.java source code in version 19.0.1 and 20.0.0 in support.appcompat-v7 .

    Well API 19.0.1 will be Android version 4.4 as seen from Wiki

    Now you can pick desired android version from grepcode. For example you can see Android 4.4 (Api 19) source code on grepcode here

    Next you can see source code for ActionBarActivity inside support package

    Similarly you can see Android source code for different build versions without IDE.

    0 讨论(0)
  • 2021-01-04 01:20

    So simple Just create a project with version 19.0.1 and crate other project with version 20.0.0 , then extend your activity from actionbaractivity or else , Hold on ctrl key and click on actionbaractivity .

    0 讨论(0)
  • 2021-01-04 01:22

    You can browse to your sdk directory and support directory and you can find the aar files there- on mac its i located on

    /Users/username/Library/Android/sdk/extras/android/m2repository/com/android/support/
    

    Ensure you are having the the version you want to see. And Then change the version in your gradle.build to the one you need. Then sync the project, Now Change the explorer mode of android studio to the project mode.

    Now you can browse to the external libraries to see the sources.

    0 讨论(0)
  • 2021-01-04 01:31

    You can download prebuilt source jars by version from here https://android.googlesource.com/platform/prebuilts/maven_repo/android/+/master/com/android/support/appcompat-v7

    Although it seems they have removed sources for anything older than 22.1.0 there.

    Alternatively you can get all changes for a specific file here https://android.googlesource.com/platform/frameworks/support/+log/master/v7/appcompat/src/android/support/v7/app/ActionBarActivity.java

    0 讨论(0)
提交回复
热议问题