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 7842871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:25:17+00:00 2026-06-02T16:25:17+00:00

I’ve just developed an app for Android, it is a game but i’m not

  • 0

I’ve just developed an app for Android, it is a game but i’m not using 3D graphics. It’s a board game where i move ImageViews around on the screen. Since now I haven’t yet tested it on a mobile device, just on the emulator. The problem is that when i run my app on a Samsung Galaxy S2 phone (dual ore 🙁 ), the CPU Usage goes up to 85% and the damn phone heats up 😀 when i kill the process (close the app entirely, so it doesn’t run in the background) it goes down to 0 🙂

I don’t even know where to start fixing the problem. Could you guys give me an idea?

I can only think of two reasons for which this might happen, but they might be stupid reasons:

  • With the exception of the UI thread, I have 2 more threads, each having an infinite while loop which cycles indefinite and looks if there are any messages in the message queue of each thread. Could this be the case? Should i put a delay in these loops of a couple of milliseconds, so they don’t run so fast?
  • I’m also using around 20-25 imageViews on the screen which i’m moving around with via touch. Could those have anything to do with this?

Is there a way to check for memory leaks or SOMETHING … from the emulator?

If anyone can offer some advice on how i should approach this issue, i’d be grateful.

  • 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-06-02T16:25:18+00:00Added an answer on June 2, 2026 at 4:25 pm

    “I have 2 more threads, each having an infinite while loop which
    cycles indefinite and looks if there are any messages in the message
    queue of each thread”

    The above thing sounds suspicious to me. Instead of using infinite loop in your own thread, you should really make use of Handler which is designed exactly for this purpose.

    As from developer’s site:

    A Handler allows you to send and process Message and Runnable objects
    associated with a thread’s MessageQueue. Each Handler instance is
    associated with a single thread and that thread’s message queue.

    There are two main uses for a Handler:

    1. to schedule messages and runnables to be executed as some point in
      the future
    2. to enqueue an action to be performed on a different thread than your
      own

    Besides, DDMS tab in Eclipse would give you all the required tools to investigate the excess use of CPU.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.