0

So I've just noticed that my app is skipping quite a few frames when running in the emulator. This is my first app and I did some reading on the topic and found that I might not be starting the activities correctly. However, my activities are loaded through the settings menu and I don't know where this is in my code. If this is a big issue it would be appreciated if someone could point me in the right direction in relation to my specific code? https://github.com/addrum/Calculate

I can post code here in preference if needed.

Edit: It appears to skip frames on the splash activity:

package com.main.androidcalculator;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class SplashActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);
    Thread timer = new Thread() {
        public void run() {
            try{
                sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            } finally {
                Intent openMain = new Intent("com.main.androidcalculator.MAINACTIVITY");
                startActivity(openMain);
            }
        }
    };
    timer.start();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    finish();
}

}
Adam Short
  • 498
  • 7
  • 28
  • i think you should write piece of code which is relevant about your problem because SO people are lazy. – yilmazburk Oct 22 '13 at 20:47
  • On what activity does it skip some frames? – hichris123 Oct 22 '13 at 20:47
  • All of your activities look fine. – dymmeh Oct 22 '13 at 20:47
  • What do you mean by "skipping frames"? Frames of a video? There is nothing in your splash activity about a video, so I'm assuming that's not it ... – Eric Simonton Oct 22 '13 at 21:29
  • In my LogCat in Eclipse I get the message: 10-22 21:27:57.495: I/Choreographer(2243): Skipped 74 frames! The application may be doing too much work on its main thread. I also noticed I get it when switching back and forth between main and the settings/about/help activities. – Adam Short Oct 22 '13 at 21:39

1 Answers1

2

I think the emulator is just too slow. Your code works fine on a real device. I've tested on GS3. Maybe ProgressBar is just too heavy for the emulator. The view has animation and a lot of stuffs. (Remove the ProgressBar and the issue's gone!)

See also: Choreographer(639): Skipped 50 frames

Community
  • 1
  • 1
pt2121
  • 11,720
  • 8
  • 52
  • 69
  • Or image resources are way to big: simply showing six 300kB PNG files can introduce a 20 second delay on Android. All you see is a white screen and the skipped frames warning. – Barry Staes May 08 '19 at 09:50