Danceionette using Unity Free

Danceionette – Yuletide Edition

My iPhone/iPad app has launched just in time for Christmas.
https://itunes.apple.com/gb/app/danceionette-yuletide-edition/id585033621?ls=1&mt=8

It’s also available for Android! https://play.google.com/store/apps/details?id=uk.co.everytale.danceionette_ye

I’m excited because this means I’m now officially famous! It was either that, or putting the game up in the post office window. I’m sure I’ll get about as many hits!

===

My dad came up with the idea of dancing marionettes after looking at the ragdoll physics with me in Unity. Then I tied it to a rhythm matching game with a Christmas theme. The whole thing is written using C# scripts in the Free version of Unity 3.5. Last March, Unity had an offer to get a free license for the mobile (iPad/Android) versions and I also had that.

Why a snowman, rather than Santa Claus? Well, I didn’t have time to create a lovely character in a 3D modelling package and a snowman is basically made of spheres.

SantaNav uploaded.

Just uploaded my first Android app. My neighbour’s daughter couldn’t put it down.

 

https://market.android.com/details?id=com.everytale.santanav

 

 

Designed by me, suggested features by my sons.  Free artwork and music from the web and programming in Java by me.

How to set a transparent GLSurfaceView

If you want to set a GLSurfaceView to be transparent, the solution is quite simple but takes quite a bit of trial and error
to get there. Here is my trial and error to save you doing it too.

In the android documentation it states that it is possible to make a GLSurfaceView transparent by a call to

getHolder().setFormat(PixelFormat.TRANSLUCENT);

This might have been true once but on my device (HTC Desire, with API 8) this can cause the rendering to just look corrupted. It basically appears to be two badly coloured images of what I’m drawing.

Most of the material I found on the web states that you need to use setEGLConfigChooser to select the correct surface format that includes transparency. I guess calling setFormat(PixelFormat.TRANSLUCENT) isn’t doing anything to the OpenGL surface.

Common consent appears to say that the desired format is as follows:default
glSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);

This gives 32 bits, 8 bits per channel including alpha although the default is 16 bits without alpha (RGB656)

However just calling this will cause my phone to crash. This is because the format is now out of sync with whatever getHolder().setFormat(PixelFormat.TRANSLUCENT) gave us. So instead I needed to call

glSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);

Finally, the last and least documented requirement is to call

glSurfaceView.setZOrderOnTop(true);

You can easily check this works for you by modifying the SurfaceViewOverlay example in the APIDemos that are supplied with the SDK.

Before it calls

glSurfaceView.setRenderer(new CubeRenderer(false));

Add the lines

 glSurfaceView.setZOrderOnTop(true);
 glSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
 glSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);

So, the cubes will appear on top of the hideme buttons when you make them visible.

I hope this helps anyone struggling with a transparent GLSurfaceView.

Android Widgets

I’ve spent the last few days (actually started over the Christmas break) to create a widget for my android app. It is easy to get it started but I want mine to update every second or so; depending on user configuration. My last effort resulted in a binding error while I tried to push a bitmap down to widget. !!!FAILED BINDER TRANSACTION!!! I’m still looking for a solution so if you know of one; please leave a comment!

Here is my latest reading list!:
* http://developer.android.com/guide/topics/intents/intents-filters.html
* http://stackoverflow.com/questions/2181588/whats-the-proper-way-to-implement-an-android-widget-with-dynamically-drawn-conte

* http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html

Android Development

I’ve been using the Android SDK for a few months now to develop some silly little applications.  However, just yesterday, after updating to Android 2.2, I discovered the process had become a little hit and miss.  The phone would crash more than usual.  I even lost the SD card and it request I reformat it.  I took it out, rebooted the phone, turned it off again, put the SD card back, rebooted the phone and all seems to be well again.

Well tonight, the Eclipse IDE I’ve been using wouldn’t attach to the phone for debugging any more.  It would download the ‘apk’ to the phone and I could execute it manually but it wouldn’t connect the debugger.   In an attempt to figure out what was going on I updated Eclipse (HELP->Check for Updates), and my Android Plug-ins (SDK & AVD Manager).  This didn’t fix the problem but I now have lots of new Docs and the 2.2 SDK installed.  One problem I did have was that Eclipse locked the folder containing the Android SDK that was being used by my projects.  This meant it couldn’t update it.  So I closed Eclipse and deleted the folder by hand so that Eclipse could update it.  I guess unloaded the projects would have unlocked the folder too.

So why couldn’t I debug?  I discoved the DDMS which I hadn’t seen before.  This is pretty good for looking at the heap in realtime and taking snapshots and viewing the raw file structure of my phone’s OS!  But this only showed that I couldn’t connect to the phone to find any processes.  However, the phone was listed as a device.

Still none the wiser, I started to trundle around my user folders.  I saw the “.android” folder and took a peek inside.  Nothing made much sense so I thought; close Eclipse, delete (or rename) the files in this folder and start Eclipse again.  SUCCESS – Eclipse can now connect to my phone and I can see the processes on DDMS and I can debug my programs again.

I don’t know what happened but the the files I removed were ‘debug.keystore’, ‘ddms.cfg’, ‘androidtool.cfg’, ‘adb_usb.ini’.   The only one which was recreated by running Eclipse again was ‘ddms.cfg’.

HTC Desire on T-Mobile

I’ve been very excited recently about buying a new mobile phone. An android smartphone, no less! The best phone available (almost) today is the HTC Desire from T-Mobile.

But which plan should I go for.  Obviously the plan that offers you a FREE phone isn’t going to be cheap but the phone is FREE!  Their website suggests £35 a month tied in for 24 months is the one I want.  It gives me 500 texts and 1200 minutes of talk time each month.  That’s 20 hours a month and more texts than I think I’ve ever sent!

As you can see I don’t use my phone that much and if I get free internet, then I could probably cope with £10 a month tied in for 24 months.  The phone isn’t FREE but now costs £164.  This gives me 100 minutes and 100 texts.  I might keep within that limit.

So over 24 months I’d pay either £840 or £404.  The phone (from Amazon) costs about £440 SIM-free so the £10 plan looks great for me. I don’t make that many calls anyway.

%d bloggers like this: