What are the Intents broadcast by the ConnectivityManager

by Dianne Hackborn » Thu, 05 Mar 2009 04:00:10 GMT


Sponsored Links
 Hi, please don't post the same message on multiple lists.  I answered this
on one of the other lists you posted it to.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How can i copy the contains of data/ to sdcard/

Hi is there a way to move/copy some file on device to sdcard , once im
in shell using sudo ./adb shell

need to copy/move the contains of data/tombstones to sdcard/tombstones

im using below command

mv data/tombstones /sdcard/tombstones

"failed on 'tombstones' - Cross-device link"

but im getting above error.

Thanks.

-- 

2. glDeleteTextures produces strange error (5572216)

Hi folks,

I'm trying to get my head around how the vram is used in opengl,
specifically when and how to clean it up.

The Story So Far...

I have a GLSurfaceView into which I set a Renderer implementation
(called OpenGLRenderThread).

This view is created (manually, by calling "new") in the main Activity
of the app.

When the onSurfaceCreated method of the OpenGLRenderThread is called,
I load a bunch of textures in a fairly standard way:

...
gl.glGenTextures(mTextureHash.size(), mTextureNameWorkspace, 0); //
mTextureHash is just a pseudo hashmap of texture structs,
mTextureNameWorkspace is an int array
...
// Then...
int textureName = mTextureNameWorkspace[textureIndex]; // textureIndex
is just an index into the mTextureNameWorkspace array
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureName);

The app runs fine, however when I try to clean up these textures at
the end of the "level" (the app is a game).. I do the following:

mTextureNameWorkspace[0] = texture.openGLName; // openGLName is the
int reference (textureName) obtained from the previous call to
glGenTextures
gl.glDeleteTextures(1, mTextureNameWorkspace, 0);

On the emulator it works fine, but on the device (HTC Desire, 2.1) I
get a GL Error 5572216

I have no idea what this error code is as I can't seem to find any
reference to it.

Now.. I understand that the VRAM references are bound to the thread
that created them.  Hence they can only be destroyed by the same
thread.  In my case, this thread is the OpenGLRenderThread  (Renderer)
during the onSurfaceCreated call.  Unfortunately the Renderer
interface does not expose an "onSurfaceLost" method, so I created my
own.

When the Level is complete, my main activity queues a request on the
OpenGLRenderThread using the following call to the GLSurfaceView:


queueEvent(new Runnable() {
                public void run() {
                        // Reset the texture library
                        onSurfaceLost();
                }
        });

According to javadoc for queueEvent:

"Queue a runnable to be run on the GL rendering thread"

Ok fine, so this should mean that the OpenGLRenderThread  is
performing the call to onSurfaceLost.  This method is the one that
then calls glDeleteTextures, and produces the error.

So.. what am I doing wrong here?  I am not destroying the
OpenGLRenderThread or the GLSurfaceView at any point (other than game
exit) so I'm worried that if I don't explicitly delete the textures my
vram will eventually fill up, or worse get into a corrupt state.

The only other thing that may be relevant is the use of a
ViewFlipper.  Because I want to load each level asynchronously I am
using a ViewFlipper in the main activity to flip to a loading screen
while all the level resources are rebuilt.  Hence when the call to
glDeleteTextures is made, the GLSurfaceView is not actually visible...
not sure if this is meaningful or not.

Anyone got any bright ideas here?

Thanks!





-- 

3. creating Hierarchical menu.

4. startLayoutAnimation in reverse order

5. Application Screenshots

6. Incoming call diverted indicator

7. Virtual KeyPad for Android on OMAP Processor