Why create a Javadoc viewer for Android?
I like to hang out in online programming communities like StackOverflow or programming Discord servers. There, I often like to answer questions from other people. Since I also do that using my mobile phone, I had a problem: I don’t know everything by heart and viewing Javadocs on mobile devices can be painful. With painful, I mean that one needs to look the documentation up first and javadocs are not optimized for mobile devices.
The app
This is why I have created JDoc4droid, an Android app that allows to download and view Javadocs from Oracle, Maven repositories and even use Javadocs from a local Javadoc JAR or ZIP file.
Download
JDoc4droid is available in the Play Store and the sources can be found on GitHub.
How does it work?
Artifacts deployed to maven repositories (normally) include a javadoc JAR. JDoc4droid downloads this file and saves it locally.
For viewing classes, JDoc4droid looks for a file named allclasses-index.html
or allclasses-noframe.html
in the root of the Javadoc. This HTML file is parsed using JSoup and the classes (including a link to the HTML Javadoc of the classes) are extracted to be shown.
On the other hand, viewing classes works in a similar manner. When opening a class, the HTML Javadoc of the class is parsed utilising JSoup once more and the contents are extracted to be displayed on screen.
Screenshots
GitHub
danthe1st / JDoc4droid
Javadoc viewer for android
JDoc4droid
A Javadoc Viewer for Android
Installation
JDoc4droid can be installed from Google Play here or from Huawai AppGallery here but and it is also possible to download an APK of any commit from GitHub Actions.
Setup with AndroidStudio
- Install AndroidStudio
- Clone the project
- Open the project in AndroidStudio
- Connect an android device (emulator or real device) via adb
- Run it
Setup without IDE
- Clone the project
- If you are using Windows, run
gradlew build
in the project directory - If you are using a UNIX-like operating system, run
./gradlew build
in the project directory - After the command finishes, you should find a file named
app-debug.apk
in the directoryapp/build/outputs/apk/debug
and a file namedapp-release-unsigned.apk
in the directoryapp/build/outputs/apk/release
- You can install the apk file on an android device (emulator or real device) and use it
暂无评论内容