Tuesday, November 11, 2008

Exchange android app

I got a Tmobile G1 last weekend, and the only thing that I thought it was missing was an app to get my work email through exchange.  Sure, you can use the web browser to do it, but it kind of sucks.

So, I started looking into OWA and what is available from an API/protocol level and it supports WebDAV.  After a long weekend of playing with it, I had a working (although quite simple) little android app to pull down email from my exchange inbox.

There are lots of things is doesn't support yet, that would be nice:

* folders other than the inbox
* dealing with a large number of messages in a folder
* background syncing
* calendar/contacts, etc
* sending mail
....

But, it's a good start and will likely get me by until someone writes a real exchange app.  I might work on folder support, but I tend to use a single folder just to archive email on exchange, and I'm not sure how well my code is going to work if I try to pull up a several thousand email folder.  That might be a lot of work for something that I'm not likely to use much.

I did open source the code, and give it a home over on google code hosting, if anyone would like to join in and make it better, that'd be great!  I just paid my registration on the android Market, and I'll probably publish it tonight after I make sure it's all packaged up and signed.

PeopleSoft Hash Function

This cost me several hours last night, so I want to get it down somewhere that perhaps might save someone else some time in the future.  If you are integrating to PeopleSoft (like say, from Java) and need to use it as an authentication store, it uses SHA-1 to hash it's passwords (the ones in PSOPRDEFN), but the trick is you have to use the "UTF-16LE" charset when converting your clear text password to a byte array for passing to the MessageDigest.update() method.

After that it works just like you would expect it to.  I couldn't find that answer anywhere, although I did find several references to it using SHA-1, my hash using UTF-8 or US_ASCII came up wrong.  Finally I just decided to try all the available charsets, and voila! it worked.