Kids Music Piano! A free, fun and educational app for children of all ages!

Your child will learn the different instrument sounds, letters, colors and musical notes! Choose from four different instruments including:

* Piano
* Guitar
* Xylophone
* Drums

Each key has a specific color and letter, so your kids can learn while they play! It is a 17 key piano including sharps and flats.


Reviewers

Make a Snowman Android App

January 5, 2012

Make a Snowman

Make a Snowman is my latest Android app that is on the market.  It allows you to draw your own snowman with your finger and save to your gallery or share it with your friends!

In October 2011, I began developing Android Apps as a side business to make some extra money, and learn Android development in the process.  I didn’t expect it to be easy to make money with Android, and it definitely hasn’t been.  It takes a great deal of effort and devotion.   Though I’ve only been doing this for a few months, I’ve picked up a few tips along the way that I’d like to share.

  1. It’s been said before, get your apps out early and test the market.  Don’t worry too much about having an amazing icon and feature graphics, although the icon should be decent enough.   If it does well, you can easily add a feature graphic later.
  2. Keep it simple, and don’t overdo it.  Trying to release your app with every feature imaginable is unrealistic.  You don’t even know if people are going to use your app yet!  Take one or two of the most important features, and make those work well.  Get those out on the market, and if you see enough interest, continue adding and refining features.   Remember that updating your app improves it’s ranking for a while, so use that to your advantage and plan out releases.
  3. If you’ve got an app that is doing well, try to find a similar idea with which you can re-purpose your code.   It’s really easy to make an app you’ve already made, and add a twist to it.  Sometimes that’s all you need.

If I’m lucky enough, I’ll get some good apps out in 2012 and maybe have some more tips.  Happy New Year!

I’m currently working on a game that will require multiple touch points to be tracked, and found that there wasn’t any good posts or documentation that explains how to do this. So, I’d thought I’d share my knowledge.

Android keeps track of touch points based on pointer ID’s. The MotionEvent gives you access to everything you need to capture any number of touch points. The most important thing to understand is:

Pointer index is NOT the pointer ID. Pointer ID and pointer index mean two different things.

The index is used only when the event contains information for more than one touch point, which is typically only when the action is ACTION_MOVE. ACTION_DOWN, ACTION_POINTER_DOWN, ACTION_UP and ACTION_POINTER_UP only ever contain information for ONE touch point. When capturing ACTION_MOVE, you need to call motionEvent.getPointerId(index); to find the pointer ID. You should use the pointer ID to keep track of touch events over a period of time.

Another very important thing to note is that event.getActionMasked() == ACTION_DOWN is only true for the FIRST touch point. You must use ACTION_POINTER_DOWN to capture additional touch points. The same goes for ACTION_UP and ACTION_POINTER_UP.

Below is a sample application I built for tracking multiple touch points. It uses a HashMap to keep track of the pointer ID’s.

Screenshot

Android Multi Touch Example Application

Android Multi Touch Example Application

Code

public class MultiTouchView extends View implements View.OnTouchListener {

	private Drawable shape;

	HashMap<Integer, PointF> touchPoints = new HashMap<Integer, PointF>();

	protected Drawable getShape() {
		if (shape == null) {
			shape = getContext().getResources().getDrawable(
					R.drawable.finger_indicator);
		}
		return shape;
	}

	public MultiTouchView(Context context) {
		super(context);
		setOnTouchListener(this);

	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		int action = event.getActionMasked();

		switch (action) {
		case MotionEvent.ACTION_DOWN:
		case MotionEvent.ACTION_POINTER_DOWN:
			captureDown(event);
			break;
		case MotionEvent.ACTION_UP:
		case MotionEvent.ACTION_POINTER_UP:
			captureUp(event);
			break;
		case MotionEvent.ACTION_MOVE:
			capturePointerMoves(event);
			break;
		}
		invalidate();
		return true;
	}

	private void captureDown(MotionEvent event) {
		int index = event.getActionIndex();
		int id = event.getPointerId(index);
		touchPoints.put(id, new PointF(event.getX(index), event.getY(index)));
	}

	private void captureUp(MotionEvent event) {
		int index = event.getActionIndex();
		int id = event.getPointerId(index);
		touchPoints.remove(id);
	}

	private void capturePointerMoves(MotionEvent event) {
		int length = event.getPointerCount();
		int id;
		for (int i = 0; i < length; i++) {
			id = event.getPointerId(i);
			try {
				touchPoints.get(id).set(event.getX(i), event.getY(i));
			} catch (IndexOutOfBoundsException e) {
			}
		}
	}

	@Override
	protected void onDraw(Canvas canvas) {

		if (touchPoints.size() > 0) {
			int radius = 80; // Size of finger indicator
			
			Iterator<Integer> iterator = touchPoints.keySet().iterator();
			while (iterator.hasNext()) {
				int key = iterator.next();
				
				PointF point = touchPoints.get(key);
				int x = (int) point.x;
				int y = (int) point.y;
				
				Rect bounds = new Rect();
				bounds.set(x - radius, y - radius, x + radius, y + radius);
				
				getShape().setBounds(bounds);
				getShape().draw(canvas);

				Paint paint = new Paint();
				paint.setColor(Color.WHITE);
				paint.setTextSize(48);
				canvas.drawText(String.valueOf(key), x - 12, y + 12, paint);
			}
			
		}
		

		super.onDraw(canvas);
	}

}

This example application will draw a red circle with the pointer ID in the middle for every touch point it captures. It will follow the touch points as they move and remove them when a finger is lifted off the screen.

I hope this well help people out trying to do multi touch on Android!
Comments are welcome!

Halloween Pumpkin CarverBeing that it’s almost Halloween, I decided to make a pumpkin carving app and see how it works out.  So far, I’ve gotten very good reviews and children seem to love it!

Get it here!

 
 
 
 
 
You can also scan the QR code.