How to find every version of android support libra

2019-02-11 21:36发布

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.0.1 and 20.0.0 in support.appcompat-v7 , and find out the difference between the two versions.

I found the https://github.com/android/platform_frameworks_base , but the release have named as android-x.x.x_rxx but not like 19.0.1 .

6条回答
家丑人穷心不美
2楼-- · 2019-02-11 21:45

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.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-02-11 21:48

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

查看更多
再贱就再见
4楼-- · 2019-02-11 21:48

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.

enter image description here

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

enter image description here

查看更多
The star\"
5楼-- · 2019-02-11 21:49

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 Android SDK Manager
  3. Select Sources for Android SDK or any packages you want to download Download sources
  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 wantSources of Android code
查看更多
爱情/是我丢掉的垃圾
6楼-- · 2019-02-11 21:53

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.

查看更多
该账号已被封号
7楼-- · 2019-02-11 21:58

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 .

查看更多
登录 后发表回答