Android Part 4

So last night ended in a bit of a disappointment with the blowing up the heap nonesense. So first thing this morning is to try and find a way around that: simple enough I won’t call that function in java.net, find a way around it. That took all of 3 minutes and I have a working work-around.

Then I realize that the android AIDL functionality only allows the activity to talk to the service and not the other way around. So I ask on IRC which lets me know I need to go the other way around using intents. GR! They like being difficult.

Alright fine, all thats sorted out: now to sign on to aim via android. …. IOException! Yay. So something that works outside android doesn’t work inside, alright lets find out why. Turns out somethingy is going a bit wacky with a .skip() on a filterInputStream. Alright, so after messing with protocol level code (not my specialty, who wants to mess with that stuff?) for 45 minutes or so I work around the bug. Only problem is now the client spams error 983 at me. I’m thinking gyah what the heck is wrong now, error 983… error 983.

So I google it. Error 983: You’ve made too many attempts to signing on … Yay! So in my debugging I pissed off the aim servers, oh well. I guess thats one way to determine when a good time to take a break is! Mostly success this morning, good.

Android Part 3

So, for the past couple hours i’ve been working on making the actual aim client in a seperate “Service” from the activity itself. Thats pretty much complete however we’ve run into a bit of a snag.

When actually starting the AimClient within android we get a “Impossibly Huge Allocation – out of memory error” from within the AimClient code (not mine). The offender:


loginIPs = InetAddress.getAllByName(loginServer);

I mean granted, a function called “getAll” might be big but… I’m not sure. Somethings fishy. Its almost 3 AM. I’m going to sleep. Overall happiness with today’s progress: 60%.

Android Part 2

So, JAIM was a failure because even though the code was neat (very, neat) it ultimatly failed to do what it needed to do: act as a stable functonal aim library.

JOscar may work, but i’ll never know because its horribly coded, and getting it to work is horrendously ugly and non-neat. So thats out the window.

Now, I’m trying AIMBot which is… perfect. The code is perfect (the requesting class implements AIMListener which is a function which handles lots of events like.. OnMessageRecieved etc.) which is extremly neat, and to boot: it worked first try! I’m sending aim messages to my java program from Pidgin. Sweet! Although I have to run out for now (visiting my brother) so moving this into Android will wait for tonight/tomorrow. Good news though!

Update: incase anybodys interested, heres a link to a read-only svn version of what I’m doing:

svn co svn://bluesata.com/AndroidMessenger

Android Part 1

I’ve decided to build an AIM Client. I’m going to use this blog (as opposed to creating a sub-blog, which I could) for my preliminary blog posts on the subject. If it gets hairy i’ll split it into a project blog (similar to the-warforge.com).

So, i’ve done a lot of reading, played with the demo and exercise labs google provided and I understand a bunch of how android works now. So, first things first: the hard part. Building a nice UI is trivial and will just take time. Actually managing the network threads and sockets and protocols will be the tough part.

I’ve decided to use Jaimlib for now as my AIM library. At the moment within the emulator I get timeouts when attempting to login. So I added a main method and im trying to run it as just a normal console app. Guess what, more timeouts! Time to break out the packet sniffer and see whats actually getting sent/recieved.

K seems that somethings screwy with the packets (compared to pidgin) and even when using the bundled test app it hangs and gets a time-out error. So, on to the next library (theres a lot more than one). Going to Joscar this time, will again try testing in its own small app before throwing into android. *fingers crossed*

Putting code where my mouth is

So, I decided to try some mobile development during this break, while I have some free time. So, since I own an S60 device why not give that a try first? Well, I have my worries. Firstly, unless Nokia really goes to the whole 9 yards, revamps all of the S60 interface, and makes web browsing feel more real (mostly with a higher resolution screen) I don’t know if I’ll be buying another S60 device. With android on its way, and people beginning to copy the iPhone’s slick-ness S60 in its current state will be out of date in a hurry.

Also, while I do need to brush up on my C/C++ carbide is just telling me “go away, don’t try me”. The very first thing I have to do is look up my forum Nokia password. That’s annoying, why do I have to log in to download the SDK? Next a giant image is thrown in my face telling me that unless I pay an enormous amount I have to stick with a gimped version of the SDK.

OK, fine. I download the gimped SDK. It installs (windows only? Yuck) and then brings up a horrendously ugly website telling me I need perl 5.6.112 or something. Some version of perl thats 4 years old and would break half of my other perl projects on the machine. Anything newer than what they want won’t work. Lame.

I boot up carbide (which is really just eclipse with some plugins) anyway. Create a new project, following the screencast (which is nice). Holy woah. Maybe I’m just too new with C++ but I don’t feel like learning all 30 different functions and includes in my hello world app. I don’t like taking things for granted, and I would not begin developing until I understood all of the things going on in the sample app. Major turn off. At this point im using a gimped SDK thats windows only, I could try the others but i’de have to pay, i’de have to downgrade my version of perl and it’d be for a platform that I don’t believe will make it in the long run at its current pace. I’m done.

Don’t get me wrong, I believe nokia will find a way to come out of this and make S60 competitive in the new post-iPhone market, but I doubt the apps written right now will port over so easily.

So, now I decide to play with android. First impressions: this is what it should be like. Here is a plugin for your eclipse that you already have, here is a small (50MB) SDK that you can install on any OS, and your demo app? Its 10 lines. I’m still exploring but this just feels more “right”.

Behind the Ballot Launch

A new project of mine, Behind The Ballot.com has launched. In high school I was a part of a team called “We the People” which got myself and some friends pretty interested in the world of government politics and law. I unfortunatly have not had much time to continue to pursue the interest beyond a casual glance at the papers. Some of my friends however have continued the interest enough to put the effort forward to put up a website dedicated to promoting voter education for the next election and they turned to me for implementation. It’s now live, Check it out!

Bad Ram

I do apologize beforehand if this blog post is a bit less exciting and less intellectual than my previous ones, but everynow and then a guy needs to publically rant.

As you may or may not know, BlueSata is a machine I built myself. I love this computer, I love how its configured and how everything works how I like. Theres almost nothing I would change even if I were to build a new PC now. Its quiet, fast, has tons of storage (and fast storage) etc. Theres one GIANT problem though.

My memory keeps dieing. Not just once or twice mind you. FOUR TIMES.

No, its not being zapped or friend as to indicate its getting bad power. Its one or two bits everytime. And as those of you familiar with how computers work will know, if 1 bit is off in a Stack pointer things go bad quickly.

I’ve gone through the usual culprits, Motherboard has been replaced once (that was an outright failure, props to asus for a quick/clean RMA). CPUs don’t really go bad; Power supply seems fine (nothing else is glitchy, and I doubt a bad PSU would cause a single capacitor in 1 of billions in DRAM to go haywire). The only conclusion, by occam’s razor, is that I’ve just got horrible luck. Two pairs of CORSAIR XMS2 Dominator blah. DDR2-1066 both problems, both RMA’d smoothly (props corsair). Now I’ve got a pair of no good supertalents, which will be RMAd as well. A friend of mine swears by A-Data so I’ve got a pair of those on the way now. *Sigh. If bluesata is down in the next couple days: you know why.