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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:38:58+00:00 2026-06-03T01:38:58+00:00

I created android live wallpaper application using AndEngine library. The wallpaper has a swing

  • 0

I created android live wallpaper application using AndEngine library. The wallpaper has a swing animation with sound.

The problem is everytime the swinging sound plays, the swing animation become lagged for few milliseconds.

I want to know is there a solution for this? I had tried by creating a thread for playing the sound, but the result was still lagged too.

The code is like this…

public class TreeSwingSprite extends AnimatedSprite 
    implements IAnimationListener, IEntityModifierListener {

    ...
    private Sound swingSound;

    // this event happened when user touch the Sprite on screen
    public boolean onAreaTouched(TouchEvent pSceneTouchEvent, float pTouchAreaLocalX, float pTouchAreaLocalY) {
        if (pSceneTouchEvent.isActionDown()) {
            ...

            long[] frameDuration = new long[] {                                            
                50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
                ...
            };

            final int[] frame = {                             
                10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 
                ...
            };

            animate(frameDuration, frame, 0, this); // this code execute the animation of the Sprite

            // play the sound
            new Thread(new Runnable() {

                @Override
                public void run() {
                    if (swingSound != null) swingSound.play();
                }
            }).start();

    }
}

If you don’t know AndEngine, pure openGL ES solution is okay too.

  • 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-03T01:39:00+00:00Added an answer on June 3, 2026 at 1:39 am

    Nevermind, the cause of lag is the particular device doesn’t have strong hardware support, probably the processor. I know that because when I tried with other device, it run fine.

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

Sidebar

Related Questions

I recently created my first android live wallpaper and it would not work on
I've created an Android live wallpaper and i'm trying to let a user choose
I have created an android application using eclipse, but when i run it, i
I've created an android application that produces an image as output. This image has
I'm using AndEngine to create a live wallpaper and SharedPreferences for the settings. Here
I've created Android application using Maps API V3 on WebView and local HTML files(contained
I have created a MazeSolver android app for a school project. I am using
I have created android application now I want to launch the .Apk of that
I create a sample Live wallpaper application, My requirement is, the Live-wallpaper have a
I am trying to create a live wallpaper using opengl (<2.0). I imported 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.