Android Change Log – Home

Navigation

Overview

example screenshot
changelog example

Using Android Change Log you can easily create, show and maintain an Android changelog dialog to display the recent changes / release notes of your Android App on the user’s Android device (tablet / smartphone / whatever).

Features are:

  • It’s open source, no license attached, and free of charge!
  • display only what’s new or show the whole change log
  • display on first start of newly installed app or on new app version
  • write the change log in a simplified language but also use HTML and CSS if needed
  • just one .java file to add to your project
  • Android SDK 1.5 and higher

Test it! Download the Test App here! – it’s free and it’s open source!


There are several projects using this code:

And there even is a spin-off (Apache-License).

Setting up your Change Log

Get Code

Copy the class ChangeLog.java into your project (raw file here).

ChangeLog.java is distributed with a simple license. This basically allows you to do whatever you want with it in open, closed, noncommercial and commercial projects as long as you leave the copyright and permission notice intact in your source code.

Maintain versionName in AndroidManifest.xml

  • versionName: This is the current version name of your app. This does not have to be a number but normally it is. Examples: “2.0.7”, “0.1-beta”, “1.1.0.14”, “Jean-Luc Version”

Add strings

Add these string constants to your res/values/strings.xml:

Write log

Add a file res/raw/changelog.txt to your project and fill it with your change log.

To get a result like this …

shot2

… do something like this:


Abstract explanation:

  • First input HTML as if writing a web page until the body-Tag. Here you can enter CSS for div.title, div.subtitle, div.freetext and div.list (see below) and any other elements you may be using, e.g. links.
  • To begin a section for any version start the line with a $ sign followed by the version. This line will not be displayed in the dialog but it is important for Android Change Log for knowing what to display and what not. It corresponds to the versionName in the AndroidManifest.xml.
  • % starts a line of a version section title.
  • _ starts a line of a version section subtitle.
  • ! starts a line of free text.
  • # starts a line within a numbered list.
  • * starts a line within a bullet list.
  • Lines starting without any of these signs (for example the HTML at the beginning of changelog.txt) will be used as they are.
  • You can use HTML anywhere you want.
  • Insert a line containing “$ END_OF_CHANGE_LOG” after the last version section.
  • After that you should enter HTML again, at least the end-body-tag and the end-html-tag.
  • You can indent lines, but you don’t have to.
  • You don’t need to use these special symbols, you can write your log completely in HTML. Only the lines beginning with $-signs are mandatory if you want to be able to only display what’s new instead of a full change log.

It would be nice if you included a line like this in your change log:

Integrate

Put this in your Activity to display what’s new since the last installed version of your app on that particular device:

After the OK-Button in the change log dialog is pressed, the new version number is written to the SharedPrefences. This means that the next instantiation of this class will return false when calling firstRun() and getLogDialog() would show an empty change log dialog.

Use this to display the full change log, e.g. when a menu entry named “change log” was chosen:

If you want to build your own dialog, you can retrieve the HTML by calling getLog() or getFullLog().

Localization

You can provide change logs in different languages. For example use res/raw-de/changelog.txt and res/values-de/strings.xml to provide German logs and labels.

Stay up-to-date

Register for code changes or other page updates here.

Troubleshooting

  • When you want to display a percentage sign in the change log, please use %25 instead of only %. This is due to limitations in the use of a WebView in the dialog.
  • Check issue 6 when having problems with special or language specific characters. Basically it is a Windows vs Android problem. You can try to change the file encoding in Eclipse to UTF-8 or use the windows notepad and use “save as …” to change the encoding.
  • To test the “What’s new” Dialog you can use the method dontuseSetLastVersion() to set the Version by hand. Don’t forget to kick this call out of your code before you build a release!!
  • Feel free to use the Issues site to report any defects.

to do – what’s next to come

  • Check the Issues for accepted enhancements & changes
  • If you made enhancements yourself, please provide any information – to share with other users.

 

Leave a Reply

Your email address will not be published. Required fields are marked *