Thursday, October 30, 2008

Market Back-end update

We now have a new option for our market applications, "All Current and Future Locations". This makes live easier by only having to tick one box.

Publishing options
Locations





The UK launch doesn't appear to be as successful as the US, at least in regards to news available. All the early birds must already have their Android fix.

Tuesday, October 28, 2008

UK Launch

If you have an app up on the Market you will have received an email informing you of the upcoming UK launch. If you want your app available to UK customers you need to log into the market back end and select the new check box that has appeared. As more countries release Android phones I imagine you will have a seperate option for each country.

Publishing options
Locations




Here is a copy of the email for anyone who is interested.

"Hello Android Developer,

Congratulations on having your application on Android Market. We hope you
have been receiving many downloads of your app and some good feedback as
well. As announced by T-Mobile earlier this month, Android Market will
also launch in the UK on October 30th at 7am GMT. So beginning Wednesday
evening PDT, apps will be shown on the G1 devices in the UK. By default,
any application currently in Market will be shown in both the US and the
UK Markets.

Please be sure to do the following between 8am PDT and 5pm PDT on
Wednesday October 29th if you do not want your app in both the UK and the
US Markets.

Go to http://market.android.com/publish, edit your application(s) and
simply uncheck the box for the location you do not want your app to appear
in.

Please look at your EULA again and make sure that it will work for the UK.

And again if you want your app to be in both the US and the UK Markets you
do not need to do anything.


Thanks,

The Android Market team"

Android Clipping

Today is a good day, I finally solved my simple clipping issue. While the issue was simple I had been neglecting it for some unknown reason. Well this afternoon I decided today was the day to face it. Often for sprites you will have an animation strip containing multiple images, however you only want to display a single frame not the whole image. Clipping allows you to specify a particular region on the screen to draw too, anything outside the region will not be shown to the user.

I needed clipping to behave just like J2ME. In J2ME you can continually modify the clip as many times as you like. The code below will draw 2 rectangles on a white background.

public void paint (Graphics g) {
g.setClip(0, 0, canvasWidth, canvasHeight);
g.setColor(WHITE);
g.fillRect(0,0, canvasWidth, canvasHeight);

g.setClip(0, 0, 100, 100);
g.setColor(MAGENTA);
g.fillRect(0, 0, 100, 100);

g.setClip(100, 100, 50, 50);
g.setColor(GREEN);
g.fillRect(100, 100, 50, 50);
}


My first attempt in Android many moons ago (actually over a year ago) involved me being naive and not fully reading the docs. I was continually saving the current clip and restoring it everytime I wanted to modify the clip. Here is some sample code.

public void onDraw (Canvas canvas) {
//jmt: save our current clip
canvas.save(Canvas.CLIP_SAVE_FLAG);
//jmt: clear the screen
canvas.clipRect(0, 0, mCanvasWidth, mCanvasHeight);
mPaint.setColor(Color.WHITE);
mPaint.setStyle(Paint.Style.FILL);
canvas.drawRect(0, 0, mCanvasWidth, mCanvasHeight, mPaint);
//jmt restore clip to previous state
canvas.restore();

//jmt: save our current clip
canvas.save(Canvas.CLIP_SAVE_FLAG);
//jmt: draw our animation
canvas.clipRect(x, y, x + FRAME_WIDTH, y + FRAME_HEIGHT);
canvas.drawBitmap(mAnimation, x - (mCurretFrame * FRAME_WIDTH) , y, mPaint);
//jmt: restore clip to previous state
canvas.restore();
}

Needless to say on more complex games this would soon become an issue. Fast forward to today where I knew there had to be a better method. So I started reading the documentation and suprise suprise (well it wasn't really a surprise) I found a better way of handling clipping. Let me introduce you to Region.OP, this marvel allows me to modify the clip in the same manner as J2ME and thus save a lot of work. The previous code snippet now looks like this

public void onDraw (Canvas canvas) {
//jmt: clear the screen
canvas.clipRect(0, 0, mCanvasWidth, mCanvasHeight, Region.Op.REPLACE);
mPaint.setColor(Color.WHITE);
mPaint.setStyle(Paint.Style.FILL);
canvas.drawRect(0, 0, mCanvasWidth, mCanvasHeight, mPaint);

canvas.clipRect(x, y, x + FRAME_WIDTH, y + FRAME_HEIGHT, Region.Op.REPLACE);
canvas.drawBitmap(mAnimation, x - (mCurretFrame * FRAME_WIDTH) , y, mPaint);
}

Now all my animations are displayed correctly and I have less code.

Monday, October 27, 2008

Market Bug

I am sitting here in frustration. I have a new build of "Amazed" to upload however the Market backend gives the following warning "Upgrading this application will cause its ratings and comments in Android Market to disappear temporarily. We are working on this issue and previous comments and ratings should reappear soon." I really don't want all my comments and download numbers to disappear. Looks like I will just have to wait until the Market is fixed.

Changes from v2.0.1 -> v2.0.2
  • I fixed the level 2 crash bug, previously if you went straight down the screen the application would crash.
  • The screen now stays on, I had set my screen timeout to 10minutes so I never experienced the pain of the screen going off half way through a level, oops.
  • Another new feature is random vibrations, provides quite the challenge when you are navigating through small pathways.
  • I played around with the speed characteristics like people suggested but the game jut doesn't feel the same. Since the screen is so small it became very difficult to make the marble's acceleration and its current speed work well together. I will look into it again another time.

Run, Androidsss are coming........

Have you heard about the mini Android? Apparently these critters have been spotted running around various locations trying to steal G1's, be on the look out!















As if mini-android's weren't enough, check out this giant version standing guard outside a Google building. This green monster stands almost 2 stories tall watching over his faithful servants. The phantom guardian appeared one day last week without any warning.

Sunday, October 26, 2008

48hrs & 10,000 downloads later

wow, G1 users love to download. My first app has been up less than two days and it already hit 10k in downloads.

Average rating is not too bad at 3.5/5. Considering this is a simple demo to show off the accelerometer feature most people have been pretty understanding. I will be working on some updates today and plan to release v2.1.0 on Wednesday.

Saturday, October 25, 2008

Amazed: feedback

Firstly, thank you for all the feedback most of which has been positive. I know the graphics are simple and people like to look at "nice" things but I write code for a living. My graphical ability ends with drawing stick figures, I'm sure a 3yr old with a crayon could do a better job.

Don't forget you can use the "Send email to developer" link to provide feedback. I have read everything sent thus far and will be releasing an update next week.

I apologize to the people who found the crash bug on level 2. This was the first item I fixed, nice find!

First Day

Welcome to my first blog post, ever! Yes I'm sure that's hard to believe in today's computer age but its true. You have most likely been directed here through my open source game "Amazed", available on Android Market.

I initially started out writing a simple tester app for the Accelerometer. After realizing how much fun it was, Amazed was born later that afternoon. Since then I have cleaned up the code and open sourced the game via the apps-for-android project.

I hope to have plenty of interesting information (or random, you can decided for yourself) to post about but I would like to keep the first post short and sweet.......