Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4078012
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:37:19+00:00 2026-05-20T17:37:19+00:00

Im currently trying to implement the simple bouncing ball (in 2d) on my android

  • 0

Im currently trying to implement the simple bouncing ball (in 2d) on my android device (physics based on device rotation and multiple balls coming in at a later point).

I have created a CustomDrawView class that extends View with a onDraw function that draws a circle in the centre of the screen. The math to get it moving correctly around is irrelevent, as my question is where i should call invalidate on the CustomDrawView.

  • Should i make a new thread to handle this based on time? as in Thread.sleep(1000/30); view.invalidate (for 30fps)
  • Should i make it run in the same thread based on some other method?

Ofcourse battery is a important factor aswell, which method is best for saving battery?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:37:20+00:00Added an answer on May 20, 2026 at 5:37 pm

    From what I have seen with Android views they aren’t the best if you are planning on making anything with framerate is very important. They snowball very quickly and the message passing pipeline used draw them is often the slowest thing your program will do that frame. I would just move the rendering now into OpenGL. Using the SurfaceView you can still get setup very quickly (ok SurfaceView also isn’t great but much better than all Views).

    If I were to use views, I would use your first method and setup a timing thread, use it sort of a like a standard Game loop that executes an update then triggers a draw then waits to ensure a full 1/30th of a second has passed and loops.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All I am currently trying implement something along the lines of dim l_stuff as
I'm currently trying to implement a class to handle secure communications between instances of
I've been trying to implement unit testing and currently have some code that does
I am currently trying to implement the wonderful jQuery plugin 'week calendar' ( here
I'm trying to implement a simple horizontal navigation menu that just shows a single
I'm currently trying to understand how to implement a 2-dimensional array of struct in
Trying to implement what I thought was a simple concept. I have a user
I'm trying to implement a little function in my app. I am currently playing
I'm currently researching the 2nd edition of C# in Depth, and trying to implement
I'm trying to implement something like this: <div> <table> <thead> <tr> <td>Port name</td> <td>Current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.