Dec 1, 2009

Newsflash! Microlog for Android - microlog4android

As you might know, Microlog has support for logging on the Android platform. However it has been living a rather discrete life in the shadow of the rest of Microlog. The other day I chatted with one of the other Microlog developers (Jarle) and we decided that it was suitable to create a new project for Microlog support on Android. We aim to re-use the Microlog core, but to optimize and such for the Android platform.

But why should I care? Android already has built in logging support that works rather well. I think that there are a couple of reasons for using Microlog on Android:
  • Log4j API
  • Resource effective
  • Remote logging

Many people are used to the Log4j API when it comes to logging and prefer it over the Java logging API (which is used on Android). I have spoken to several users of Microlog and they have praised that it uses the Log4j API.

The Microlog has been built from scratch. It has been designed to be used on devices with a small amount of memory and with reduced processor capacity. Log4j on the other hand contains a lot of legacy code and has been used on computer with many times the capacity of an embedded device. For example Log4j contains a lot of classes that are there for being backward compatible with older releases.

The Microlog library has support for logging to remote servers and devices. This is not something that is built into the logging API found on Android. Remote logging is something that is very appreciated in Microlog. My guess is that it would be nice for Android developers as well.

As mentioned before, the project was registered a couple of days ago. Notice that we are in the startup phase and no release is available yet. We decided to use Kenai.com, since SourceForge does not meet our expectations. The project is called microlog4android. As always; any contributions are very welcome. Please contact me if you are interested in the project.

It would be interesting to know what you think of this idea. Is this something that is missing on the Android platform? Or is the built in logging enough for you?

6 comments:

Admin said...

I'm surprised to hear that it is going to be a separate project.

I think that most mobile developers have to support multiple platforms. For Blackberry and J2ME I am able to share most of my code - everything but the GUI is common. Now I am hoping that a good chunk of that common code can also be used on Android.

That common code uses microlog and I'm concerned that splitting microlog into multiple projects will make it more difficult to share common code between the different platforms.

My Open Source Software Development Blog said...

I am sorry if you are disappointed.

To start with I agree that most mobile developers must support multiple platform. In fact I am involved in a project where we develop a mobile application that should work in Java ME as well as on Android.

My plan/vision is to share the core of Microlog. In other words the Logger, Formatter and Appender interfaces shall always be the same. The public interface has proved to be rather stable. In fact it has always been backward compatible. But the interface has been extended, which is perfectly ok with regards to compability.

Thus from a user perspective, the code should be the same. For example, you could use Microlog for both Android and Java ME, but still share code.

Just out of curiosity, have you used Microlog in both Java ME and Android?

Jarle Hansen said...

Hi Tom,

There is a really simple reason why we do this, Android is not Java ME. Android has a much richer development environment and we want to take advantage of this in the new environment.

I am a bit curious to why someone would like to simply port their application across these platforms when they are so different. I can see the executives in companies see this as a golden opportunity to cut development cost, but in my opinion you arein risk of simply cutting corners. As Johan and I discussed, we see no problems in branching the existing code. But we will adapt it to the Android platform, maybe we even can create a smaller and simpler library because of the new languages features in Android.

Admin said...

Let me try to answer a couple of the questions you asked.

No, I have not yet used microlog (or anything) on Android. I am currently supporting Blackberry and J2ME, as described, and will have to add Android next.

As you point out, having the same interface on all platforms is the most important thing, and I agree with the rationale that you give for getting microlog working on Android even though Android already has logging.


Why would we want to port our application rather then creating a solution that takes advantage of Android?

We would port our J2ME solution because it works and there is nothing wrong with it. To the degree that it is possible, why not reuse it on Android? We could probably make it a little more efficient by rewriting it for Android, but that's not worth it the extra effort of having two code bases.

My Open Source Software Development Blog said...

Hi Tom,

I think we will proceed with the microlog4android project. If it gets to complicated we could always merge it back to the Microlog project. As I said it is vital that the API stays the same. This way it is possible for people with needs like you to use Microlog for both Android and Java ME without no changes. I hope that this will be enough.

My Open Source Software Development Blog said...

One more thing; thanks for your answers Tom. It is important that ideas get challenged which keeps us making better software.