Archive

Archive for June, 2012

Javadoc Notes

Javadoc allows not only to comment the code as it is written, but also provides documentation for the project, with cross references and even allows for usage samples.

There are no significant differences using javadoc to comment android apps versus any other java code, with one significant exception.

Oracle offers the API overview for java as a javadoc online. You can use this on-line reference to link your code to references when producing javadoc that you publish on-line, as opposed to a local source. However, you can’t use Google’s android reference that way, for their site does not have a package-list nor an index.html file. If you plan to display your javadoc in the Internet, you need a public reference source. To go around this limitation, we must use a different source for the android references. One of the available sources is: http://www.androidjavadoc.com/2.3/. See the Javadoc Generation Configuration (On Eclipse click: Project->Generate Javadoc…) screen shot below.

Read more…

Categories: Java Tags: ,

Using android.net.NetworkInfo Class

The NetworkInfo MindMap.

Part 2 of 2

Working on the NetworkInfo class (see NetworkInfo MindMap post part 1 of 2 ), several issues became very relevant when writing an Android App that uses the Internet.

It is not only good coding practice to check if there is a connection before attempting to connect to some external site to avoid ugly error messages from your application of from the browser; but it also saves battery power to check the connection instead of launching an application and them waiting for a timeout.

Not only is reasonable to check if the there is a connection, but it also can be very useful to be able to inform the user that the large network process about to start will run on his G3 or G4, expensive connection. Using the information available on the NetworkInfo class, a setting could be created to restrict extensive processes on the Internet only when connected via WIFI.

Read more…

Categories: Android, Java Tags: