A Chrome extension that adds an 'ad' omnibox command and view source links for the Android SDK.
The extension can be downloaded on the Chrome Web Store.
A Chrome extension that adds an 'ad' omnibox command and view source links for the Android SDK.
License: Apache License 2.0
A Chrome extension that adds an 'ad' omnibox command and view source links for the Android SDK.
The extension can be downloaded on the Chrome Web Store.
Do you have instructions?
I love the plugin and kept using for quite some time but it seems it does not work with latest SDK page. I'm not able to get view source link on any page.
Also searching does not lead to any results - just opens up link with https://developer.android.com/?q=xx (but from what I see currently search should be done via https://developer.android.com/s/results/?q=xx).
Thanks to the resolution of Issue #9, source links for test classes are much improved. However, currently nothing in the android.support.test
package (Espresso, UI Automator, etc.) shows up in the ad <search term>
omnibox search index.
I'm not sure if it's best for this to be added to https://developer.android.com/reference/lists.js
, or to include another JS reference file in this project.
No display of view source
button for:
https://developer.android.com/reference/dalvik/system/DexFile.html
And there is the same issue with classes in dalvik/system package:
https://developer.android.com/reference/dalvik/system/DexClassLoader.html
I think it would be a neat feature, if there were the ability to view documentation for documented source files.
Just the other way round as the view source
option.
Attempting to use the view source link on the recyclerview page goes to the wrong URL and results in a 404. Found on DefaultItemAnimator too (perhaps all RecyclerView source?)
Steps to reproduce:
What should happen:
What does happen:
Item 1 is far more critical from my perspective than item 2. I pull up documentation all the time, but view the source only occasionally. So if item 1 is easy to add without adding the other, go ahead.
I see several broken links in the "View Source" button, and saw a number of improvements were committed in the last couple of months.
A new release to the Chrome Web Store would be much appreciated!
I was planning on looking into it. Not just being a nag but I wanted to raise some noise.
Just tried to use the extension but it was disabled in Chrome and has a warning on the extension panel. The Chrome store page responds with 404
. The extension itself works fine if re-enabled but the warning is concerning.
The BottomSheetBehavior
link returns a 404:
I believe this source code is not under the main Android Repository, but here:
Two types have moved to https://android.googlesource.com/platform/frameworks/opt/telephony/+/master
One of SDK reference JS files is no longer available, and endlessly retry:
Is this script required to run the plugin?
Also, it would be great to have exponential backoff on the error callback:
AndroidSDKSearchExtension/extension/background.js
Lines 54 to 57 in e933077
For instance:
var backoff = 5000;
function _error(script) {
backoff *= 2;
console.error('Failed to load ' + script + '. Retrying in ' + (backoff / 1000) + ' seconds.');
window.setTimeout(init, backoff);
}
It will be better to show the View Source
if and only if the source file exists, it can send a HEAD request to verify if the file exists. There are lots of file URLs that return the 404 error.
I don't know what they explicitly call this...
E.g., "VTO", "ViTrOb", and "VTreeObs" should all resolve to "ViewTreeObserver"
Absolutely love this extension! Tried this with Vivaldi (1.8.770.56) browser which is based on Chromium but I think it hijacks tab behaviour (boo!) Any idea how to solve it?
Thanks so much @romannurik!
Can be the shortcut (now "ad") adjustable ? In extension preferences f.e. ?
It would be great if this extension also supported Kotlin Reference docs. That way I can search the classes in both Android and Kotlin's reference docs.
e.g. android.support.v4.view
should be below android.view
.
The documentation for VectorDrawableCompat is here: https://developer.android.com/reference/android/support/graphics/drawable/VectorDrawableCompat.html
Clicking on "view source" results in a 404: https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/graphics/drawable/animated/src/main/java/android/support/graphics/drawable/VectorDrawableCompat.java
Changing the word "animated" to "static" in the link fixes the issue: https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/graphics/drawable/static/src/main/java/android/support/graphics/drawable/VectorDrawableCompat.java
Clicking "View Source" on ViewGroupCompat links to https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v4/java/android/support/v4/view/ViewGroupCompat.java which returns a 404 error.
On a page like:
https://developer.android.com/reference/android/support/test/espresso/assertion/ViewAssertions.html
The (View Source) link goes to the platform/frameworks/base repository, leading to a 404.
Instead, it should be looking in the platform/frameworks/testing repository. The source wasn't in the master branch, but I found it under the android-support-test branch.
Email from chromewebstore-dev-support:
We routinely review items in the Chrome Web Store for compliance with our Program policies to ensure a safe and trusted experience for our users. We recently found that your item "Android SDK Search", with ID: hgcbffeicehlpmgmnhnkjbjoldkfhoin did not comply with our policies. Your item was found to be suspicious and has requested/fetched one or more external scripts.
To have your item reinstated, please make any necessary changes to avoid requesting or executing remotely hosted code (including by referencing remote javascript files or executing code obtained by XHR requests). Your item is still published, but is at risk of being removed from the Web Store.
Please make the above changes within 15 days in order to avoid removal. Once you have made these changes you may submit and publish a new draft in the developer dashboard. Your draft will be reviewed for policy compliance which typically takes a few business days. If the outcome of the review is successful, your store listing will remain published. If we find additional issues with your item, we will send you another email with details. If you have any questions about this email, please respond and the Chrome Web Store developer support team will follow up with you.
Important Note:
Your item will still be subject to review and may be removed from the store within the warning period. Repeated or egregious policy violations in the Chrome Web Store may result in your developer account being suspended or could lead to a ban from using the Chrome Web Store platform. This may also result in the suspension of related Google services associated with your Google account. Thank you for your cooperation,
basically change /ref/heads/master to the right tag level found here . Its something I find myself doing a quite a bit. Also, I think professional android developers use it to compare implementations of a class at an older version of android os. This would only apply to class and resource paths if the user decides he wants to look at google source code instead of git. Adding git would be trivial.
Additions would be to...
[ ] make /refs/heads/master a placeholder and fill it in with the current api level.
[ ] register a onChange listener for that api selector dropdown
[ ] map that number to the latest tag and update the url if it changes.
Things to consider:
new tags are added to AOSP as new rcs are made. The Android Team doesn't have a consistent rule or algorithm to determine when the the api level shifts to a new version of android. This means someone will have to go in and update the map to point to the right tag in the url. Obviously keeping current behaviour in states of uncertainty is advised.
@romannurik , I'm curious if to see if you have ideas on this.
What if that class is not in that level?
Previously, this was never a problem. nothing ever gets deleted, and head tracks all things. Now it will certainly break if you attempt to view JobService in api 12 or . At the same time, there is a big warning when you attempt to toggle into a lower api level, so I say the user was warned. Otherwise, I could write a function to determine if this class is unsupported and default to master in that case.
I've completed the first two bullet points, and the second half of the last bullet point.
Does not work on Chromium 32.0.1700.77
Testing with androidx.app.Fragment and no "View Source" link provided
https://developer.android.com/reference/androidx/fragment/app/Fragment.html
Hi Roman,
Once again the DOM of developer.android.com has changed and broke the *View Source link.
I think now you should append the link to this element <h1 class="api-title"></h1>
.
It seems like the https://developer.android.com/reference/gcm_lists.js
doesn’t exist anymore.
$ http --verbose GET https://developer.android.com/reference/gcm_lists.js
GET /reference/gcm_lists.js HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: developer.android.com
User-Agent: HTTPie/0.9.2
HTTP/1.1 404 Not Found
Alternate-Protocol: 443:quic,p=1
Cache-Control: no-cache
Content-Length: 112
Content-Type: text/html; charset=utf-8
Date: Fri, 29 May 2015 08:17:29 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Server: Google Frontend
<html><head><title>404: Not Found</title></head><body><b><h2>Error 404</h2><br/>File not found</b></body></html>
Probably it was moved somewhere to https://developers.google.com/android/reference/packages
, but there are no reference JS files as far as I can see.
Unfortunately it breaks the extension itself and there is an infinite “Loading Android SDK search data…” sign at the omnibox.
Is it possible to link to grepcode.com too?
The advatage of grepcode are the links to the classes and methods in a source file.
Would be awesome if I could use this with firefox 👍
Since the release of the latest AppCompat package in the support library, the source code structure has changed and all View Source links that point to classes in support/v7 do not account for the fact these files are now split by project.
Example: ActionBarActivity.java
https://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html
...links to...
https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v7/java/android/support/v7/app/ActionBarActivity.java
..but is now at...
https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v7/appcompat/src/android/support/v7/app/ActionBarActivity.java
Thanks for all your hard work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.