Fincher's Follies

Yeah… just let someone else host it

Repurposing an old Android phone as a portable gaming device – Part 1

Recently, I have been interested in a platform for mobile gaming.  I kinda lost interest in my old DS, and my Droid 4’s battery life goes from shoddy to downright abysmal with just a little bit of gaming. I heavily considered a PS Vita, but it is still a bit more of an investment than I’m willing to make at the moment. Then I found this guide on Lifehacker for turning an android device into a media/gaming center.  I didn’t necessarily need everything described in the guide, but I figured it was a good place to start using my old Droid 3.

First I decided to focus on setting up the NES emulator first. I have played around with a few in the past that worked pretty well, but both the software controls and using keys on the hardware keyboard were lacking. I rarely use both my PS3 controllers, so I decided to see if I could use the one that is starting to wear down with my phone. So I decided to try out Sixaxis Controller by Dancing Pixel Studios. It is handy that is has a free app that tests your device then the actual app is only $1.99, which is pretty reasonable.

To pair the controller with my phone, I had to install libusb then use sixpair to tell the controller the ID of my phone.  It was pretty simple and painless.

Then I started playing with a few emulators. Initially, I wasn’t having any luck with using the controller in the emulator, but it turned out that I just didn’t really read the Lifehacker guide that closely, haha. Basically you have to go into the sixaxis setting and map the controller buttons to actual keys.  Once I figured that out, I tried out NESoid (my fav of the ones I tried) and everything worked perfectly! I only have a handful of ROMs (the format the games come in) at the moment, but if this becomes my consistent mobile gaming platform I’m sure that collection will soon grow. 😉

Next I figured I would play around with putting it on a larger screen. That probably won’t be part of its main function, but why not!? A little while back I ordered a mini-HDMI to HDMI cable so I was able to plug my phone directly into my second monitor (or any TV that has HDMI) and voila! It was just like having an NES but with snazzier controllers!

Booting up some Mega Man 2!

I played a few games, and the controller was pretty responsive and a great step up from playing on my phone. My phone was fine for games like Dragon Warrior where it is never necessary to act quickly. One game of Tecmo Super Bowl and I realized how subpar trying to use the keyboard actually was. So with pretty minimal setup and $1.99 I had a nice little emulator that I could hook to any TV with HDMI and play with a wireless controller. Nice!

Phase two of making this into a DS/PS Vita alternative will be fashioning a mount like the Gameklip. While it really isn’t too expensive ($15 + a likely shipping charge), I believe I could put together something fairly easily that would cost me a lot less.  My first thought is to just refashion my car mount to connect to the controller.  It may be a little bulky, but I’ll sacrifice a little space for it being practically free! (or pre-paid I guess, haha)

Additionally, I imagine I should be able to get at least a SNES emulator running, maybe Genesis too. There’s also the standard Android game library (Angry Birds, etc.) that I can use. If I think I’ll be using those much I may want to put a little more thought into make the mount for the PS3 controller fairly easy to remove. The only real thing that is lacking, which is pretty minor, is that the PS Vita ties in with your PSN account for trophies and such. While I admit it is kinda silly, I can’t say I would be disappointed if some kind of trophy system was released for Android. Or even better, Sony released a tie-in so Android developers could actually earn PSN trophies!

New snazzy Android adapter thanks to @jsell08!


Getting back into Android Programming: Dart Scorer

The other day I played a few rounds of darts at Corner Pocket and found myself really wishing that I had a dartboard of my own.  I recalled that we used to have one in the basement in Bristol, and I didn’t think it was being used so I asked Mom and she said it was all mine. I get to pick it up next weekend, and I am pumped! Knowing that I will soon have access to throw a round of darts whenever I like, I thought it would be cool to go a little above and beyond the normal chalk or whiteboard scoreboard. I searched the Android Market (or Play store or whatever it is called now) and downloaded and tested no less than 5 apps made for dart scoring.

Now I am not sure what is most popular in the dart throwing world, but apparently everyone plays 301 or some variant thereof.  Of the apps I tried, only 1 even claimed to score cricket (the game my friends and I always play) and it turned out to be pretty much non-functional.  I decided that the situation presented completely embodied one of the primary advantages of Android that I laud to those around me: at a cost of $0 I can write the app I need myself!

Most of the time, apps I am looking for are either too complicated to really tackle or the apps available are close enough but not perfect. This time, there was a complete lack of any app providing the function that I needed AND it seemed like it would be a pretty simple app to put together. So I downloaded all the necessary development software (as I will point out again, at no cost) and tried to revive the Java programming portion of my brain. After programming almost solely in Python for the past couple of years, I was definitely a little rusty. Also, because I hacked it out starting yesterday, there are definitely some conventions I used that I am sure could be done way more efficiently and elegantly. Mayhaps I will continue to revise and improve, but first iteration was all about functioning! I got it to a place that I am pretty happy with and that seems to be functional and error free enough to serve my purpose.

Let's get the game started!

MC is looking good

MC is looking good

And she takes the win!

So the first picture is basically the opening screen (no fanfare here). After you choose the number of players, you see a scoreboard similar to the one in picture 2. The names start out with default names, but when you tap on a name it brings up a dialog to change it. Then you just tap on the space where you would typically make your mark and it marks it! To keep it simple, I just used text so first mark is a slash, two is an X and the empty set symbol means that number is closed out. Tapping on a closed out number gives points to all other players who have not closed out that number. It has a one play history so a rogue finger poke can easily be undone, and it automatically checks to see if the last score marked resulted in someone winning the game (Picture 3). New game resets all the scores, but keeps the names. The only real issue that I am having so far is that the way I set things up in a TableLayout seems to give a little play in the row sizes.  So it will start out with a spacing that I like, then, for example, if player 1 and player 2 each mark a 20, the 20 row will tighten up and get a little shorter pulling everything below up with it.  I’ve tried giving more absolute dimensions for the rows, but that messes with the display and response to touch so I decided not to worry about it right now.

I will call this my Beta Version 0.1 and hopefully it is something I can improve whenever I have some free moments (not that I see many of those in my near future). To do list for the future:

  • Fix formatting issue to keep scoreboard static
  • See if I can simplify some of the functions I put together
  • Increase history so that more than one play can be undone
  • Store and display statistics based on player name
  • Store previous users and have a dropdown to choose name when a name is clicked or have the option of creating new or temporary names
  • Allow for other dart games