Help with stuff I don't know.

Put your problem here if it does not fit any of the other categories.

Help with stuff I don't know.

Postby seed » Thu Jun 03, 2010 6:35 pm

I'm doing OK so far on the OpenGL stuff, but I realize now that I barely know any Android at all. I am a total newbee when it comes to application lifecycle, manifest stuff, and creating menus/overloading buttons etc.. Any pointers would be very helpful.

1) When I tilt my phone (Mot Droid), I see the backlight for the menu buttons go on an off like the phone is trying to change orientation. It doesn't actually change orientation but... this sometimes goes along with some catlog stuff about not being able to create the keyboard. I get some reduction in my fps when this is going on. Any idea here? Here is my manifest.

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""

    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
        <activity android:name=".LavaBall"
                android:label="@string/app_name" android:windowSoftInputMode="stateAlwaysHidden">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
    <uses-sdk android:minSdkVersion="3" />

2) I want to overload the back and main buttons (not sure their real names) so that when they are pressed, I pop up a dialog asking if the user really wants to quit. How do I do this?

3) When the app is stopped by a user pressing back (eventually via the exit dialog from (2) above) the app doesn't seem to go away. It stays in the background. Is this expected? How do I kill it if this is even what I want to do? For a game, it doesn't seem like the normal Android lifecycle makes much sense. I think I should just get rid of everything when the app is exited. Thoughts?

4) midi files. I am trying to load one via SoundPool (I guess eventually AudioManager) and I am getting heap overflows when I do this. Why? Doesn't android convert the tiny midi format to an intermediate format. I guess expanding a midi to some kind of real audio format will make it potentially quite large. Does this sound like the issue?

5) For a game, can or should I try to run at a higher priority? It seems like some background services are getting in while my game is running and creating some glitches/garbage collection. Is this normal? Can I mitigate this in any way?

Thanks in advance for any help you can provide.

Visit Exit 4 Gaming -
Home of LavaBall -
Home of Rebound -
Home of Tap Crazy -
Download "Caveman Pool" From the Market Today!
Senior Developer
Senior Developer
Posts: 103
Joined: Mon Mar 15, 2010 3:22 pm


Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 5 guests