Hacking by Walkingice: 2010/03

2010/03/30

Javadoc at Android

* This article also post to 0xlab planet *
I have a tiny, useless brain with slow frequency, 128 bytes L1 cache and 256K Ram. Therefore, I cannot remember everything while I am doing Java programming.

Although you are not a nut like me, you might still need Java API documentation. Well, we could read the [online version], thats cool.

But what if you are a poor guy cannot pay for network. You still have to work on the Bus, at Starbucks coffee, at toilet or on the bed.

Luckily, you could generate offline documentation by command

$make docs

But I do not like droiddoc. I cannot explain why I dislike it.

I like the original javadoc style, it is like although I had PS but I still love FF3 on FC. (bad example I know)

I read article of [androidjavadoc] and prepared this [patch], you could generate your own old style offline java documentation.

From bfe51b44ee6f6c1a989d34c96f9b0ea457731d80 Mon Sep 17 00:00:00 2001
From: Julian Chu

Date: Wed, 26 Aug 2009 12:19:36 +0800
Subject: [PATCH] Create original javadoc

Apply this patch and type in
$make docs
---
core/droiddoc.mk | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/core/droiddoc.mk b/core/droiddoc.mk
index 30bd918..af4121e 100644
--- a/core/droiddoc.mk
+++ b/core/droiddoc.mk
@@ -159,17 +159,13 @@ $(full_target): $(full_src_files) $(droiddoc_templates) $(droiddoc) $(html_dir_f
-J-Xmx768m \
-J-Djava.library.path=$(HOST_OUT_SHARED_LIBRARIES) \
$(PRIVATE_PROFILING_OPTIONS) \
- -quiet \
- -doclet DroidDoc \
- -docletpath $(PRIVATE_DOCLETPATH) \
- -templatedir $(PRIVATE_CUSTOM_TEMPLATE_DIR) \
- -templatedir $(PRIVATE_TEMPLATE_DIR) \
- $(PRIVATE_DROIDDOC_HTML_DIR) \
+ -overview $(TOP)/frameworks/base/core/java/overview.html \
+ -splitindex \
+ -use \
+ -package \
$(addprefix -classpath ,$(PRIVATE_CLASSPATH)) \
-sourcepath $(PRIVATE_SOURCE_PATH)$(addprefix :,$(PRIVATE_CLASSPATH)) \
-d $(PRIVATE_OUT_DIR) \
- $(PRIVATE_CURRENT_BUILD) $(PRIVATE_CURRENT_TIME) \
- $(PRIVATE_DROIDDOC_OPTIONS) \
&& rm -rf $(PRIVATE_OUT_ASSET_DIR) \
&& rm -rf $(PRIVATE_OUT_CUSTOM_ASSET_DIR) \
&& mkdir -p $(PRIVATE_OUT_ASSET_DIR) \
--
1.6.3.3
The generating documentation will be put under out/common/host/….Once you finish it, you could revert the previous patch and pretend nothing happened
$ cd /WHERE/TO/ANDROID/build/
$ git reset –-hard HEAD^
ps. I tried it on Eclair, it works.


Update: you can tweak the stylesheet.css to make it looks better
-body { background-color: #FFFFFF; color:#000000 }
+body { background-color: #FFFFFF; color:#000000; margin : auto; max-width: 1024px; margin-top: 30px;}