Stuff that Happens

Main Menu

  • Home
  • About
  • Contact Us

logo

  • Home
  • About
  • Contact Us

Login

Welcome! Login in to your account
Lost your password?

Lost Password

Back to login
Android
Home›Android›Android Popping Bubbles Example

Android Popping Bubbles Example

By stufftha_user
March 31, 2009
159
0
Share:

This example is a bit simpler than the bouncing ball demo I posted ten days ago. When you tap the screen, a bubble appears. This bubble grows until it pops. Tapping several times makes several bubbles.

Android Bubbles Example from Eric Burke on Vimeo.

Goals:

  • Animate many different objects. In this case, growing circles. There is only one background thread running the “game loop”. It keeps a list of circle positions and sizes. You could easily apply this same concept to any kind of animation.
  • Play a popping sound when each bubble pops.

The pop sounds like crap on the phone, even worse in the video. You can find the original popping sound on freesound.org. I clipped the sound (using Audacity) to make it play faster, I suspect it can be improved with some work.

You can find the source code for BubblesModel.java and BubblesActivity.java on GitHub.

This app still has a serious bug, described in this Android Developer’s Post. Let me know if you know how to fix this!

Aside from that bug, this is not production-ready code. It is pretty sloppy with memory, copying a List of Bubble objects on each iteration of the game loop. I opted for brute force synchronization just to make it work. For a real game, I’d spend more time on fine-tuned locking and sharing objects to minimize garbage collection.

Posted on Tuesday, March 31st, 2009 at 8:40 pm in Android.

Previous Article

State Capitals is Now Free

Next Article

Victory!

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

stufftha_user

Related articles More from author

  • Android

    Not a Memory Leak

    April 12, 2009
    By stufftha_user
  • Android

    IDEA 9 Android Support

    September 7, 2009
    By stufftha_user
  • Android

    2009 Android Wish List

    January 1, 2009
    By stufftha_user
  • Android

    Eclipse Leopard Glitches

    November 2, 2008
    By stufftha_user
  • Android

    Android 1.6 on G1

    October 4, 2009
    By stufftha_user
  • Android

    Apple is not Worried

    April 30, 2009
    By stufftha_user

Leave a reply Cancel reply

You may interested

  • Opinion

    Interfaces and Implementations

  • Opinion

    No More Word

  • Opinion

    U.S. Music Royalty Fee

Newsletter

Follow us

Dui viverra Faucibus aliquet quis phasellus accumsan. Donec et facilisis sociosqu sed tortor elit eu aliquid turpis ridiculus.

Fly, shall, have greater fifth spirit midst under from stars thing is, had creepeth multiply kind. Man may they’re meat years have third bring replenish air two light deep fill.

About us

Stuffthathappens is a blog about Android features, new gadgets, new apps, phone reviews, tech support and the nitty-gritty of modern day communication.
  • Recent

  • Popular

  • Comments

  • android

    Android Color Banding

    By Kenneth
    October 25, 2018
  • HTC EVO Review

    By Kenneth
    October 20, 2018
  • Interfaces and Implementations

    By Kenneth
    October 15, 2018
  • Android Robot

    By Kenneth
    October 11, 2018
  • android

    Android Color Banding

    By Kenneth
    October 25, 2018
  • ZDNet: The Computer Experts

    By stufftha_user
    March 3, 2008
  • Ouch…Malaysian Post

    By stufftha_user
    March 4, 2008
  • Chet: I’m Sorry

    By stufftha_user
    March 4, 2008
  • A WordPress Commenter
    on
    April 22, 2018

    Hi, this is a ...

Instagram

  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image
  • Instagram Image

Follow us

  • Contact
  • Contact
  • About Us
  • About Us
  • Home
  • Home
© Copyright 2018. Stuff That Happens. kenneth@stuffthathappens.com
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy