Monday, January 17, 2011

Conversion of my VB6 apps to Android

(Update: This is more of a "what am I up to" post. It has gotten a lot of traffic from people wanting to actually know how to do a conversion, though, so I have started a new series walking you through converting a VB6 app to android.  Click here for the first in the series.)

Continuing the series on my various projects, today I write about  my efforts to convert my VB6 apps to Android.

Since I first started programming 20+ years ago, I have always used Microsoft languages and products.  I've never liked their business practices, but I was kinda stuck.  Recently, I decided to get un-stuck.

My windows XP desktop finally succumbed to one of the fake virus scanner malware apps.  My wife's computer gets hit all the time, because she refuses to listen to me about her computer security, but I had managed to keep mine clean.  Since I had to reformat anyway (I had cleaned it off, but there were niggling little hints that something may still be around), I decided to dual-boot into Ubuntu Linux and try it out.

Well, the first thing that means to me is that all of the hundreds of apps I've created over the years in VB6 will no longer work.  Sure, I can install wine, or I can use the dual-boot to boot into windows when I need to use them, but I don't want to.  If I'm going to kick the microsoft habit, I need to do it as completely as possible.  So I wanted to learn a new language or something so that maybe one day I could actually get a job not programming in microsoft.  So the next decision was what language to convert them into.  One coworker suggested python, but a quick google search didn't reveal any commercial quality apps written in python.  Sure, several of them are using python as a scripting engine, but they themselves are written in something else.  Then I thought about android.  I was originally thinking java or c++ anyway, but anything I write for linux isn't going to get a very good market penetration.  Android, however, is kinda separate from the computer environment, so a user who swears by microsoft on his PC may still have an android phone.  And mobile apps are fairly hot.

So, I've decided to go that route.  Luckilly, most of them are just cheese apps, because I don't actually have an android phone, so everything I do is in the emulator.  If I ever need to run these apps for anything useful, I'll have to load the emulator to do it.  Also, it's not really a conversion.  There's no converter from VB6 to java that I know of, much less VB6 to android.  So I'm really completely rewriting the apps, making all new useability decisions and such for the android version.  So far, I've done one and gotten stuck on the second.

The first one I did was an old Magic 8-Ball app I wrote.  Definitely cheezy, and I don't even remember why I wrote it in the first place.  But, it was also fairly easy to convert.  You can download it here if you want.  (It's called "Mystical Pool Ball" because I didn't know if "Magic 8-Ball" was trademarked or anything.)

The second app is called Ambiance.  It uses various wave files (converted to ogg for the mobile version) to create a soundscape.  For instance, in the windows version, I have a "Day by the River" ambiance set up.  You have a babbling brook and various birds and insects.  I also have an "Approaching Night Storm" one.  You have all of the standard night sounds, plus the occasional crack of thunder.  I used to have one that was called "Rainy Night", but then I realized one time while listening to it that you don't hear that many insects and such during a downpour.  It still sounded pretty cool, though.

My problem is that I haven't figured out how to package the sounds yet.  I can put them in the resources in the package, but then they can't be changed.  So I'm looking at putting them on a web page somewhere and allowing download.  But that means that the first install won't have any sounds at all.  So I'll have to figure out some way to make it download the apps when it installs the first time.  Of course, the app itself isn't all that large.  So maybe I'll just make a completely new package for each soundscape and go with that route.

When I get something working, I'll stick the app here on google docs.  I'll probably put all of the apps I make out there until I run out of the 1gig space.  Eventually, they'll probably go out on the android marketplace.  I don't really expect to make a profit, so I don't feel like shelling out the $25.00 for registration yet.  But at least it's better than the $99.00 that apple and microsoft want for their app stores.

1 comment:

  1. Did you try any of these converters????

    I, too, have VB6 applications I would like to convert (to Java) to run on Android.