Thursday, January 22, 2009

Where is my sd card?

Today I was testing how to detect if the sd card was present or not. The most obvious way to do this would be to create a File and point it to /sdcard.

File mFile = new File(/sdcard/mydir);


Next you would check if the file exists(), isDirectory(), canWrite() etc... to see if you actually have permission to create and store your data. However these methods will return true even if the sd card is not present. It's not until you actually try to write some data that you will see errors.

The trick to detecting the sd card correctly is to use android.os.Environment method getExternalStorageState(). This will return the current state of external storage, i.e. mounted, unmounted plus many other states.

So to test if external storage is present we can use the following snippet (sorry I have no idea how to format code on this blog)

boolean canSaveExternal = false;

String storageState = Environment.getExternalStorageState();

if (
Environment.MEDIA_MOUNTED.equals(storageState))
canSaveExternal = true;
else
canSaveExternal = false;

I imagine in the future Android will have various external storage devices so getExternalStorageDirectory() will be useful to know where to save data.


Monday, January 12, 2009

Amazed 2 BETA released

Today I released Amazed 2 BETA to a select group of people. All of them were kind enough to contact me after playing Amazed saying how much they enjoyed the game. It is only fitting that these people get to try out Amazed 2 first.

The most positive new feature received thus far has been the option to resume your game from any level. The graphics weren't hard to improve on so that has been another bonus.

Looking forward to more positive and negative feedback. A full demo of Amazed 2 will be hitting the market soon. Meanwhile the original Amazed in all its glory is still being downloaded, roughly 125,000 people. Not bad for something that was designed as a technical demo to show off the Accelerometer feature of the G1.

Friday, January 9, 2009

Designing levels is NOT easy.

Over the past few days I have been discovering how difficult it is to design levels. Maybe I should rephrase that, designing GOOD levels is difficult. I think I have spent more time trying to come up with unique fun levels than I have on coding. It has been an experience to say the least. If anyone has some tips or good reading on the subject please let me know.

Hopefully I will have a demo version ready for next Monday. It won't be feature complete as I still have a couple of items left on my list to finish off before releasing the full version. Not to mention I need to finish designing all the levels and then order them via difficulty. While Amazed was designed as a tech demo that got popular overnight, Amazed 2 has been designed to be a real game from the beginning. I am looking forward to people's feedback once the demo is ready.

Thursday, January 1, 2009

Back to work


After a month long holiday back home in Australia it is finally time to get back to work. Being on holiday was great but it meant I could not spend as much time working on Android as I would have liked. Glad to report the G1 had no issues operating in Australia.

Yes its been awhile since the last update but with the Market taking off I'm sure you had plenty of other app's to keep you busy.