Thursday, May 26, 2011

Android 9 Patch Image Tutorial

This tutorial describes what Android 9 patch images are, how to make them, and how to use 9 Patch images in Android applications.

What is a 9 Patch Image?

A 9 patch image is an image that has stretchable areas defined.

These areas are defined in a special 1 pixel wide border around the area. Add black pixels to the top and left of this border to describe where the image can be stretched horizontally and vertically.

Why Use 9 Patch Images?

Nine patch images are especially useful when designing buttons. Custom drawn buttons can look distorted and pixelated when their borders are stretched in addition to the rest of the image.

Take a look at the Custom Drawn Button tutorial to see how using 9 Patch images can be used to create a button, and what happens if they aren't used.

Creating 9 Patch Images

Making a 9 Patch image is a fairly easy process. Included as part of the Android SDK is a Draw 9 Patch utility. Navigate to the folder where you installed the SDK. From there navigate to the tools folder. Inside this folder will be the draw 9 patch program. On Windows, double click on draw9patch.bat

The draw9patch.bat file

Wednesday, May 25, 2011

Creating a Custom Drawn Button for Android

Through this tutorial you will learn how to create a custom drawn button, and learn how to use that button in an application.

Why Create a Custom Drawn Button?

If you ask me, I feel like the default button drawing for Android makes the entire OS feel a bit like Windows 95. The button doesn't really look that different--it is basically the same plain boring gray.

Having a boring gray button can be an advantage. It instantly sticks out to most users and can be easily identified as an element that you can click. The other advantage is that it is the default button style and very easy to use and maintain.

Two buttons with the default drawing style


There are also many advantages to using custom drawn buttons. You can use colors that better fit with the palette of your app, make buttons more distinguishable from each other, and give your app a more unique feel that helps separate it from the rest of the crowd.

Wednesday, May 4, 2011

Introducing the Tic Tac Toe Tutorial

This blog post introduces the Tic Tac Toe tutorial and provides links to the other parts of the tutorial, as the tutorial itself is fairly long.

Screenshot of the finished Tic Tac Toe product

Why Build Tic Tac Toe?

I can think of a number of good reasons. Maybe building Tic Tac Toe isn't your ambitious Android app goal, but by following this tutorial you will be introduced to a number of concepts that you can reuse and apply. And hopefully playing it can be a little fun.

Also, Tic Tac Toe is a great game to build because its a medium sized project. Not too lengthy and complex but not exactly trivial either. For this reason, the Tic Tac Toe tutorial will be broken down into a couple of blog posts.

Defining the Game
Before we actually get to the programming of the Tic Tac Toe game, lets set up some ground rules.
  1. The game logic must be completely separate from the Android specific display logic
  2. The player will only play against the computer
  3. The player will always be X, the computer O
  4. There app will be limited to one activity, with one XML layout
  5. There will be two levels of difficulty

The Final Product
As you read this, the final product is already available for downloading and testing on your Android Device. Check it out on the Android market with the following link: https://market.android.com/details?id=com.dreamdom.tictactoe

Other Posts in the series
Android Tic Tac Toe Game Logic - Part 1 Interfaces

Sunday, May 1, 2011

Creating an Android Calculator Tutorial

Through this tutorial you will learn how to develop and code a simple calculator in Android. Topics covered will include using a webview, layouts, and button listeners.

Introduction

One of the cool things about having a smart phone is knowing that you will always have a calculator handy. If you need to total receipts, perform some supermarket comparisons, or calculate tips or percentages on the fly a calculator is definitely a handy tool.

Screenshot of the calculator tutorial
However, the basic calculator app that comes preloaded with the Android Operating system leaves a lot to be desired. Perhaps you want to build your own more advanced calculator. You can use this tutorial as a starting point.

Friday, April 22, 2011

Get More Downloads for your Android Apps

More Apps button
 
One of the most frustrating things about the Android Market is making sure that your app is visible. That is making sure that people can find it and download it.

If you have multiple apps in the Android market, you can use your apps to advertise for your other apps. Doing so is extremely simple.

You can use the following code snippet to open up the Android market to a page that displays all of your available apps.

Intent viewIntent = new Intent("android.intent.action.VIEW", Uri.parse("market://search?q=pub:\"PUBLISHING NAME\""));  
startActivity(viewIntent);


Make sure to replace "PUBLISHING NAME" with the name that you publish your apps under, otherwise the search will come up blank.

Although this feature is already built in to the Android Market with the "More Apps by this Publisher" button, adding the link in your App can be helpful. After a user downloads your application, they may never return the App Page in the Android market.

After using your app or game, the user may decide that they like it enough that they want to check out your other products. Adding a button to link them to the Android Market makes this easier for them.

Friday, April 8, 2011

Android Millionaires

Cha-ching!

How can you make a million dollars building and selling Android Apps? Just follow the examples of some people and companies that have already done so.

The article, Meet the Android App Millionaires at electricpig.co.uk breaks down eight successful groups and provides extra insight as to how you can learn from them.

The link to the Advanced Task Manager earnings wasn't working anymore, but androidandme sums up the basic information from it in their blog post Advanced Task Manager developer is making up to $10,000 a month. That story is particularly interesting because it seems like it is mostly the work of one individual.

Will you be on the list anytime soon?

Wednesday, April 6, 2011

Win $5000 making an Android App

This is pretty cool. Androidhomecoming.com is getting together with face.com to run a $5000 Android App challenge.

The challenge is going to be divided up into three rounds. The first round being just a short pitch of your app--250 words or less. From this, judges will narrow the field down to 30 entries.

So, start brainstorming some ideas for cool apps that somehow involve facial recognition. Doesn't matter if you can't quite program it yet--just come up with some great ideas.

I think that I will plan on entering the competition, but I will probably post some tutorials here regardless if I make it pass round one or not. Good look to everyone who enters!

Check out some example apps from face.com and head on over to androidhomecoming.com for all the details about how to enter.

For some inspiration, here is a video showing you how Nintendo has been using facial recognition in some games.