[android-developers] Re: HTC and LG haven't implemented Android in the right way
That's odd. Anyway I've just resent you email. The point sprites project works OK on HTC G1 (Android 1.6). On 24 окт, 11:25, MobileVisuals eyv...@astralvisuals.com wrote: No, I didn't get the sample project, but it would be interested to see it, so could you send it again? Have you tested it on HTC devices? I don't get any black squares around the particles with my Quad approach either. On Oct 22, 12:59 pm, Nightwolf mikh...@gmail.com wrote: Did you get a sample project I sent you earlier? It uses point sprites and has no black squares around particles. On 21 ÏËÔ, 15:20, MobileVisuals eyv...@astralvisuals.com wrote: I solved this problem now for the morphed animation. I used a TreSet for the sorting. I made a Quad class and and added the quads to the treeset for each draw. The TreeSet šthen sorts them in an automatic way. It's not as fast as with real Point sprites and size attenuation, but the speed is OK. This really took a long time to fix. I am still going to write to the HTC support, just to let them know that they haven't implemented Android in the right way. On Oct 14, 10:39šam, MobileVisuals eyv...@astralvisuals.com wrote: The morphed positions for the stars are calculated from some precalculated 3d arrays, one 3d array for each single galaxy shape, like below. positionsM1 and positionsM2 are the two 3d arrays, which get morphed for this frame. The result is the new morphedPositions array, which is drawn later. I can't find any frame-to-frame coherency here. I am considering to start with another 3d animation instead, which doesn't use morphing, because I don't have a clue how to make an effective and fast sorting algorithm for this: for (int i = 0; i morphedPositions.length; i++) { š š š š š š š š š š š š morphedPositions[i] = (morphcount * positionsM1[i]) * mlInv š š š š š š š š š š š š š š š š š š š š + ((morphLength - morphcount) * positionsM2[i]) * mlInv; š š š š š š š š } On Oct 14, 10:17šam, Latimerius l4t1m3r...@googlemail.com wrote: On Wed, Oct 12, 2011 at 7:09 PM, MobileVisuals eyv...@astralvisuals.com wrote: Thanks a lot for the info! The problem is that the positions for the stars change for each new frame. This happens because the positions are morphed.Wouldn't it be very slow to sort all the positions according to their z-value for every frame? I'd take a close look at my positions morphing algorithm. šHow does the z-order change frame-to-frame? šI doubt it can change randomly, there will be some kind of frame-to-frame coherency - perhaps just a bunch of fix-ups are needed from the previous frame? šI'd try to take advantage of that, it should reduce your problem from a general full sorting one to something possibly way smaller. Wouldn't I have to make one drawElements call for each quad if I sorted them? Not necessarily. šTry keeping vertex positions data in system memory (i.e. in normal Java objects). šBefore rendering each frame you recompute positions, reshuffle the data to restore back-to-front order and make a single VBO out of that. šYou could check glBufferSubData() and similar to avoid transferring all of the data over the bus into VRAM each frame. šYou can then issue a single glDrawElements() to render the whole thing. How exactly to do that depends on your particular algorithm but it should be possible. I assume that would be a lot slower than one drawElements call for all of the quads, as it is now. I understand your worries, they are well grounded. šTrying to do a more complex thing will usually mean your performance takes a hit. However, I found out in a surprising amount of cases that a thing I would have expected to be prohibitively slow performed very well. GPUs are complex beasts, they can parallelise, hide latencies and all kinds of stuff. šYou never know until you try. And, above all, remember that you can hardly make your renders look right if you use translucency with depth-buffering but don't sort back-to-front. šSo my strategy would be implement the sorting to make stuff look right, then look into how to restore plausible performance if needed. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: HTC and LG haven't implemented Android in the right way
Did you get a sample project I sent you earlier? It uses point sprites and has no black squares around particles. On 21 окт, 15:20, MobileVisuals eyv...@astralvisuals.com wrote: I solved this problem now for the morphed animation. I used a TreSet for the sorting. I made a Quad class and and added the quads to the treeset for each draw. The TreeSet then sorts them in an automatic way. It's not as fast as with real Point sprites and size attenuation, but the speed is OK. This really took a long time to fix. I am still going to write to the HTC support, just to let them know that they haven't implemented Android in the right way. On Oct 14, 10:39 am, MobileVisuals eyv...@astralvisuals.com wrote: The morphed positions for the stars are calculated from some precalculated 3d arrays, one 3d array for each single galaxy shape, like below. positionsM1 and positionsM2 are the two 3d arrays, which get morphed for this frame. The result is the new morphedPositions array, which is drawn later. I can't find any frame-to-frame coherency here. I am considering to start with another 3d animation instead, which doesn't use morphing, because I don't have a clue how to make an effective and fast sorting algorithm for this: for (int i = 0; i morphedPositions.length; i++) { morphedPositions[i] = (morphcount * positionsM1[i]) * mlInv + ((morphLength - morphcount) * positionsM2[i]) * mlInv; } On Oct 14, 10:17 am, Latimerius l4t1m3r...@googlemail.com wrote: On Wed, Oct 12, 2011 at 7:09 PM, MobileVisuals eyv...@astralvisuals.com wrote: Thanks a lot for the info! The problem is that the positions for the stars change for each new frame. This happens because the positions are morphed.Wouldn't it be very slow to sort all the positions according to their z-value for every frame? I'd take a close look at my positions morphing algorithm. How does the z-order change frame-to-frame? I doubt it can change randomly, there will be some kind of frame-to-frame coherency - perhaps just a bunch of fix-ups are needed from the previous frame? I'd try to take advantage of that, it should reduce your problem from a general full sorting one to something possibly way smaller. Wouldn't I have to make one drawElements call for each quad if I sorted them? Not necessarily. Try keeping vertex positions data in system memory (i.e. in normal Java objects). Before rendering each frame you recompute positions, reshuffle the data to restore back-to-front order and make a single VBO out of that. You could check glBufferSubData() and similar to avoid transferring all of the data over the bus into VRAM each frame. You can then issue a single glDrawElements() to render the whole thing. How exactly to do that depends on your particular algorithm but it should be possible. I assume that would be a lot slower than one drawElements call for all of the quads, as it is now. I understand your worries, they are well grounded. Trying to do a more complex thing will usually mean your performance takes a hit. However, I found out in a surprising amount of cases that a thing I would have expected to be prohibitively slow performed very well. GPUs are complex beasts, they can parallelise, hide latencies and all kinds of stuff. You never know until you try. And, above all, remember that you can hardly make your renders look right if you use translucency with depth-buffering but don't sort back-to-front. So my strategy would be implement the sorting to make stuff look right, then look into how to restore plausible performance if needed. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Someone have code examples of a cube with different textures on each face? (OpenGL ES 1)
What are you trying to achieve? Just create a single texture with 6 different square images in it, modify texture coordinates in your example and you'll get different images on each face. This way is also faster than drawing each face separately and switching texture for each face. On 18 окт, 12:03, saex elpablos...@gmail.com wrote: I need to understand how to put different textures on each face of a cube (OpenGL ES 1). But i can't find examples of how to do it Atm i found an example of how to paint the same texture on all the faces of the cube, but i dont need that this is the actual code i have: public class Cube { /** The buffer holding the vertices */ private FloatBuffer vertexBuffer; /** The buffer holding the texture coordinates */ private FloatBuffer textureBuffer; /** The buffer holding the indices */ private ByteBuffer indexBuffer; /** Our texture pointer */ private int[] textures = new int[1]; /** * The initial vertex definition * * Note that each face is defined, even * if indices are available, because * of the texturing we want to achieve */ private float vertices[] = { //Vertices according to faces -1.0f, -1.0f, 1.0f, //Vertex 0 1.0f, -1.0f, 1.0f, //v1 -1.0f, 1.0f, 1.0f, //v2 1.0f, 1.0f, 1.0f, //v3 1.0f, -1.0f, 1.0f, //... 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, }; /** The initial texture coordinates (u, v) */ private float texture[] = { //Mapping coordinates for the vertices 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, }; /** The initial indices definition */ private byte indices[] = { //Faces definition 0,1,3, 0,3,2, //Face front 4,5,7, 4,7,6, //Face right 8,9,11, 8,11,10, //... 12,13,15, 12,15,14, 16,17,19, 16,19,18,
[android-developers] Re: HTC and LG haven't implemented Android in the right way
Probably your source texture image has no any transparency. That's why black squares are visible. Setting alpha to 0.25f makes your stars look faded. You should not change the alpha value in glColor4f. You should prepare star image with transparency. Anyway I still think that it's possible to get away with point sprites. BTW glDrawArrays works fine with other primitive type. Not just GL_TRIANGLE_STRIP. On 8 окт, 13:08, MobileVisuals eyv...@astralvisuals.com wrote: How do you mean that I should put brightness level in the textures? I have already enabled transparency with gl.glEnable(GL10.GL_BLEND); gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); gl.glColor4f(1f, 1f, 1f, 0.25f); I see that the transparency have effect, but it doesn't work as well as it should. I have also noticed that the black square quads are visible. Do you know what I can do to get rid of the black square quads? Is there any way to make it as shiny and smooth as it was with point sprites? I use this call to draw the quads: gl.glDrawElements(GL10.GL_TRIANGLES, vertices*2, GL10.GL_UNSIGNED_SHORT,indiceBuffer); I don't think that I can use glDrawArrays,because that is for TriangleStripArrays. I have 1200 particles, which makes it 4800 vertices in the array for the quads. The positions are morphed for each repaint. Maybe that is what is making it slow,but it was fast with point sprites. Each star particle consists of 2 quads. The star particle in the middle is smaller quad. The transparent blueish blur around that particle is another quad. These are drawn with 2 arrays. I draw the most opaque array first (the star particle in the middle) and then the more transparent array later. This approach worked very well with point sprites and size attenuation, but maybe this doesn't work with texture mapped quads. Maye there are simply too much quads for the system to take care off, which messes up the Depth Testing and the z buffer. Maybe this is the reason that the transparency is not working like it should, which causes the visible black square quads? On Oct 7, 4:58 pm, Kostya Vasilyev kmans...@gmail.com wrote: Looking at the dull screenshot, I can see that your sprites are wrong - they don't have transparency around the point itself. The black square quads are clearly visible, and they shouldn't be. The brightness level is what you put in the textures, you should be able to make them as bright as you want. As for performance, I haven't done any 3D work specifically on Android devices, so can't say for sure. Using glDrawArrays should help, does it not? -- Kostya 07.10.2011 17:44, MobileVisuals пишет: I have implemented this according to your approach now. I replaced attenuated points with texture mapped quads. I implemented bilinear filtering and alpha test. It works, but the visual quality is not good. It doesn't look at all as good as with Point sprites and size attenuation. It looked shiny and smooth when I used Point sprites and size attenuation and it was fast: http://www.mobile-visuals.com/mgw.php Now it is just rough and dull and it is slow: http://www.mobile-visuals.com/dull.png Are you really sure that is possible to get good visual quality with your approach? On Sep 29, 9:26 pm, Kostya Vasilyevkmans...@gmail.com wrote: 29.09.2011 23:01, MobileVisuals ?: I claim that HTC HD doesn't support OpenGL ES 2.0, because size attenuation is a part of OpenGL ES 1.1 and it is not supported. Quite possibly, you're right... So HTC hasn't implemented the things that they say in the specification, but why not? Who knows? You could contact their support, but even if they provide a plausible answer (and that's a big if), it's not going to magically fix all the HTC devices out there... Thanks for the idea, do you mean like this? Scale to small size if the sprite is far away. Scale to medium size if the sprite is medium distance. Scale to big size if the sprite is close. More or less - you are currently doing continuous range scaling of your sprites (I presume). If you replace them with texture mapped quads, you could always use the same image, or pick one of the ones predefined at various scale factors, to improve the image quality and performance. Sort of like mip-mapping. But that's not the core idea - the main thing is to replace attenuated points with texture mapped quads. That could work for other animations, but it would be very slow for my star cluster animations. There are hundreds of stars in each cluster. As it is now, I draw each star cluster in one single glDrawArrays call. That makes it fast. Hundreds doesn't sound too bad - at those poly counts, it's the fill rate (overdraw) that can kill performance. But since sprites are typically small, it probably won't be an issue. Wouldn't I have to make one glDrawArrays call for
[android-developers] Re: HTC and LG haven't implemented Android in the right way
AFAIK it is possible to specify point size array along with vertex array. Enabling point sprites turns points to textured quads. Turn on bilinear filtering and alpha test or blending. Of course the texture should depict a star. On 29 сен, 23:26, Kostya Vasilyev kmans...@gmail.com wrote: 29.09.2011 23:01, MobileVisuals ?: I claim that HTC HD doesn't support OpenGL ES 2.0, because size attenuation is a part of OpenGL ES 1.1 and it is not supported. Quite possibly, you're right... So HTC hasn't implemented the things that they say in the specification, but why not? Who knows? You could contact their support, but even if they provide a plausible answer (and that's a big if), it's not going to magically fix all the HTC devices out there... Thanks for the idea, do you mean like this? Scale to small size if the sprite is far away. Scale to medium size if the sprite is medium distance. Scale to big size if the sprite is close. More or less - you are currently doing continuous range scaling of your sprites (I presume). If you replace them with texture mapped quads, you could always use the same image, or pick one of the ones predefined at various scale factors, to improve the image quality and performance. Sort of like mip-mapping. But that's not the core idea - the main thing is to replace attenuated points with texture mapped quads. That could work for other animations, but it would be very slow for my star cluster animations. There are hundreds of stars in each cluster. As it is now, I draw each star cluster in one single glDrawArrays call. That makes it fast. Hundreds doesn't sound too bad - at those poly counts, it's the fill rate (overdraw) that can kill performance. But since sprites are typically small, it probably won't be an issue. Wouldn't I have to make one glDrawArrays call for each one of the stars if I had to scale them in different sizes? That would mean hundreds of glDrawArrays calls instead of one. Not the way I'm reading the docs (mind you, my GL is more than a little rusty - last time I worked with 3D was more than 10 years ago) But it seems like you should be able to draw all quads that use the same texture in one call, using GL_TRIANGLES or GL_QUADS (not _STRIP or _FAN, because those are always joined). This can product transparency artifacts depending on their z-order, so you'd need to sort the quads according to their texture and z-order both. Or just forgo the mipmapping for initial tests, then there's be one less thing to worry about with respect to sorting. A point sprite is a screen-aligned element of variable size that is defined by a single point. Would it really be a sprite if it was mapped to a quad polygon? If it looks like a sprite, and quacks like a sprite... -- Kostya Vasilyev -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: HTC and LG haven't implemented Android in the right way
Point sprites can be used to display stars in space. On 27 сен, 11:26, MobileVisuals eyv...@astralvisuals.com wrote: I need Point attenuation to produce space animations with shining particles, which look like stars. How can I achieve that effect without using Point attenuation? Do you mean that I should make small rectangular polygons with transparent textures instead? I have tried that before on M3G and it didn't look as good as Point attenuation. Anti-Aliasing is a method of fooling the eye that a jagged edge is really smooth.Will that really be enough to get the same effect as Point attenuation? Could you please be more specific in which OpenGL technique I should use to make it work on HTC and LG? Isn't Point attenuation a part of the Android OpenGL standard? Shouldn't HTC and LG support it in that case? On Sep 27, 3:34 am, Indicator Veritatis mej1...@yahoo.com wrote: Short answer: no. Longer: why do you need point attenuation? There are other ways to do anti-aliasing, and some really cool graphics have been done for Android phones using that instead of point attenuation. On Sep 26, 6:26 am, MobileVisuals eyv...@astralvisuals.com wrote: I have found that everything implemented with Point attenuation will look like a blurry mess on devices from HTC and LG. This happens on even the newest devices from HTC, like HTC Desire HD. Why is it like this? Haven't they implemented Android in the right way? Point attenuation works like it should on most Android devices, like those from Samsung. I have implemented Point attenuation according to the Android specification in two of my company's apps.I have worked with Point attenuation on Symbian and C++ before, so I am quite sure that I have implemented it the right way. It is about the same code implementation in all OpenGL. Shouldn't all new Android devices support Point attenuation? It works on IPhone, so I think Point attenuation should work on all new Android devices too. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How do I can make resolution independent game?
Building Aggressively Compatible Android Games http://www.badlogicgames.com/wordpress/?p=1921 On 22 авг, 23:59, Zwiebel hunzwie...@gmail.com wrote: Thanks for the help! On aug. 22, 07:20, Appaholics raghavs...@appaholics.in wrote: Use 9-patch images to have them scaled properly. As for the rest of it use a game engine. They do most of the work for you. I usehttp://www.andengine.orgbutyou can use any other you like. Try Googling Android game engine. Thanks On Sun, Aug 21, 2011 at 10:12 PM, Zwiebel hunzwie...@gmail.com wrote: How do I can make, for example if the user clicks at the 50,50 coordinates on the 800x480 resolution screen, will it be on the appropriate resolution on the 480x320 resolution screen too? I read on the internet that I need to make my game for only one resolution, and then scale the touches, and the images up, or down. But how I can do this scale? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- -- Raghav Sood CEO/Founder/Owner/Dictator/Tyrant at Appaholics (Basically all titles required to have complete control)http://www.raghavsood.com/https://market.android.com/developer?pub=Ap... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Opengl ES Texture working on Emulator but not on Device
Try using bitmap with power of two dimensions or even square bitmap with power of two dimensions. Something like 64*64 or 128*128. On 16 июл, 19:00, odrya12 odr...@gmail.com wrote: I tried everything.. Source: Texture class: public class XAndroidTexture { private int[] textures = new int[1]; public int width, height; Bitmap bmp; public XAndroidTexture(GL10 gl, Bitmap bitmap) { gl.glEnable(GL10.GL_TEXTURE_2D); this.bmp = bitmap; width = bmp.getWidth(); height = bmp.getHeight(); gl.glGenTextures(1, textures, 0); // ...and bind it to our array gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); // create nearest filtered texture gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE); // Use Android GLUtils to specify a two-dimensional texture image from our bitmap GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); //GLUtils.texSubImage2D(GL10.GL_TEXTURE_2D, 0, 0, 0, bmp); // Clean up bitmap.recycle(); } public void bind(GL10 gl) { gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); } public static XAndroidTexture createTextureFromBitmap(GL10 gl, Bitmap bmp) { return new XAndroidTexture(gl, bmp); } } Texture loading function: XAndroidTexture Textureload(String path) { InputStream is; Bitmap bmp = null; try { is = this.getAssets().open(path); BitmapFactory.Options opts = new BitmapFactory.Options(); opts.inDither = true; Bitmap tBmp = BitmapFactory.decodeStream(is, null, opts); bmp = Bitmap.createBitmap(tBmp.getWidth(), tBmp.getHeight(), Bitmap.Config.ARGB_); Canvas canvas = new Canvas(bmp); canvas.drawBitmap(tBmp, 0, 0, null); canvas.save(); tBmp.recycle(); tBmp = null; } catch (IOException e) { e.printStackTrace(); } if(bmp == null) return null; else return new XAndroidTexture(gl, bmp); } It working on Emulator perfect, but not on device Can anyone post here texture class that work on device? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Emulator shows lock screen rather than my app screen for the first time. MENU button has to be clicked.
Starting emulator is just like turning on a phone. Usually a phone displays lock screen at startup so does emulator. On Jun 14, 12:54 am, Jonathan Zhong jonathan.zh...@panasonic.aero wrote: Hi, I'm new to Android development. I apologize if my question is too simple to be posted to this group, but I have not found a satisfactory answer through Google search. Start Eclipse. Create/open any simple HelloWorld Android project. Run the app. This will bring up the emulator. After a few minutes, the lock screen appears, instead of the expected HelloWorld default Activity screen. And I have to click MENU button to have my app's screen show up. To me this is an extra step, or a little bit frustrating, or confusing. Note that this does not happen in subsequent runs of my app, which is good. This is my development environment: Ubuntu 2.6.32 32-bit; Eclipse SDK 3.5.2; Android 2.3.3. Is this (showing the lock screen rather than my app screen for the first time) by design? How can I skip this extra step? Thanks in advance, - Jonathan Disclaimer: The information contained in this transmission, including any attachments, may contain confidential information of Panasonic Avionics Corporation. This transmission is intended only for the use of the addressee(s) listed above. Unauthorized review, dissemination or other use of the information contained in this transmission is strictly prohibited. If you have received this transmission in error or have reason to believe you are not authorized to receive it, please notify the sender by return email and promptly delete the transmission. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Using an android phone as a controller
Establish Bluetooth or WiFi connection between devices and go ahead. On Jun 2, 11:36 pm, Coolestkid92 coolestki...@gmail.com wrote: Hey, I was wondering if there is a way to use an android phone as a controller for a tablet game? I have seen this done with iOS, and I see many possibilities for this in android games as well. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Weird performance issues with native application
The only suggestion I have is that some thread does not allow to work other threads. Turning profiling on slows down this thread so others have more chances to do their work. On May 25, 3:41 pm, Habba olli.alat...@gmail.com wrote: Hi, I'm working on a game which uses OpenGL 1.1 and Android 2.3 95% of the code is c/cpp code, which is run natively. That includes game logic loops and drawing. the remaining 5% of java code is for taking advantage of all kinds of services (open/hide soft keyboard, open browser, ad-views, game service components, etc..) I have a GLSurfaceView for drawing, and in onDrawFrame I call my native code which does all the game state updating and OpenGL drawing. On higher end devices, frame rate is good and rather stable, but on lower end devices (ZTE Blade, Wildfire S) FPS is very low (10-12). I had already given up on the idea that I could increase the fps to acceptable levels (20+), when I accidentally turned Method Profiling on from Eclipse. Suddenly, the game ran around 30fps and was smooth as any. I also managed to pull the same result by applying Debug.startMethodTracing() at my activity's onStart(). Anyone has any idea why doing MethodeTracing would increase the FPS so dramatically (or raise at all, to begin with)? First I thought that maybe it's about thread priorities, but no priorities were changed. The game has quite a few threads going on... one for draw/updating, one for event queue, android probably has it's internal thread for handling UI events, and then there's some threads from 3rd party application. Android SDK says that startMethodTracing would make VM run slower than usual. I gave my game loop/drawing thread a max priority, and that seemed to increase the FPS a little bit, but I'm still very far away form the magnificient results of startMethordTracing. The question is: what the heck does that thing do?? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Playing two audio files at once
Use audio track and mix any source to any channel. http://developer.android.com/intl/de/reference/android/media/AudioTrack.html On May 17, 10:13 am, Raghav Sood raghavs...@gmail.com wrote: Hi, Is it possible to play two audio files at once, one of which is played through the right earphone and the other through the left? Is it even possible to send different audio to each earphone? Thanks -- Raghav Soodhttp://www.raghavsood.com/http://www.androidappcheck.com/http://www.telstop.tel/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Why not AWT or a simple way to draw - animation
Take a look at the Lunar Lander from API Demos. On May 17, 6:53 am, Heuristic heuristic...@gmail.com wrote: Thanks for the reply, Dianne. I wished I had got your answer before I made further changes earlier - I draw the drawings onto another image buffer and copy the image buffer back to the real image view. (This is what I learned before that it could make the drawing smooth so that there is no flicker like you said.) It turned out to be useless anyway. Like you said - Android's drawing will not draw until the drawing is complete. What I want is to draw is the moving of the tower of hanoi in a step by step way so that the users could see the moving - not the end of the moving. I see that Android has some animation mechanism. I wonder if I could start an animation thread, then uses the images that I draw as an animation source for the animation. Theoretically, it should work. But, I hate that I might find out that it's not what I think. I believe that I can associate a view with an animation. Then, I could start an animation that plays the images I create one by one. That probably will work. But, I am new to Android, so I have no idea about Android animation at this moment. Thanks anyway. On May 17, 10:27 am, Dianne Hackborn hack...@android.com wrote: Android's drawing model is totally different, so it can provide a smoother experience without flicker. When drawing your window, you need to completely draw it and the result is not composited to the screen until all drawing is complete, so the user never seen flicker and artifacts due to partially drawn windows on screen. You just need to learn how Android works. Yes, it does not use AWT, so you just need to learn the way that Android does drawing just like if you were coming from any other platform. On Tue, May 17, 2011 at 1:11 AM, Heuristic heuristic...@gmail.com wrote: I write an Android Java program to simulate the moving of Tower of Hanoi. The drawing does not show in steps I expected, instead it shows in a chunk at the end of the drawing. Why? The scenario can been seen in my personal website - 1. I set the disc number to be 5. http://homepage8.seed.net.tw/web@3/heuristic/TOH_Set051411001.JPG 2. Then, I start the moving. (I used the sleep timer so that it won't move too fast.) http://homepage8.seed.net.tw/web@3/heuristic/TOH_Start051411001.JPG 3. It ends up with the BLACK piles of the discs on the two other sticks as shown on the following URL: http://homepage8.seed.net.tw/web@3/heuristic/TOH_End051411001.JPG (This is due to an error in my program. It's fixed.) The button start is used to trigger the movement. I can see that the button's color is changed and hold there until all the drawings are done, then the color of the button is reset to original. This is not what I want. I want to show - moving the disc 1 from stick 1 to stick 2, then moving the disc 2 from stick 1 to stick 3, and so on. It does not show this - it shows the last step that finishes the tower of hanoi movement. I wrote this Java program long time ago using Java Applet (and it works as an application with little modification). The library used to draw is AWT only. Now, I just changed the interface to be Android GUI/ API interface. The old program works fine on my website (in fact, in my all showoffs.) - http://homepage8.seed.net.tw/web@3/heuristic/tohjava.html This program was developed on Android 2.1-updated. I just ported to 3.0, it shows the first time, then halts there. I haven't got time to figure out. This is a very good educational material - to teach Math, Java, Computer Sciences, etc. Hope experienced Android guy can share experience here. This is a little bit like the flush in some i/o problem. Sometimes, if you don't flush, there is no output. So, why Android does not show the drawing out right away, instead it waits until the end of all the drawings. It looks like that using threads could solve the problem. But, it's too much of the work for just drawing some object movings. Anyone has any idea how to make the programming simpler and easier for a simple task like this? How come Android not provide the AWT library? Is it too big or too clumsy? It's just some simple drawings, why do you want your developers to write so many codes for a simple task like this? Is there a way that the displaying view (view to show the images) sends a message to the button and asks the button to release the control to the view so that the view can draw the drawings as it should do. I think it's the button control holds the operation until the called routine exits. Painting or drawing should be independent of the processes that activate the painting or drawing like AWT, right? Any idea? -- You received this message because you are subscribed to the Google Groups Android
[android-developers] Re: Possible to use OpenGL in both C++ and Java?
Calling native functions for rendering from GLSurfaceView.onDrawFrame() works. Texture loading goes to onSurfaceCreated(). On Apr 23, 4:54 pm, Ash McConnell ash.mcconn...@gmail.com wrote: Hi Folks, I am new to Android coding. I am trying to convert an iPhone app and would like to keep the core c++ code in tact if possible (so that bugs can be fixed in a cross platform way). I am currently using an extended GLSurfaceView to do rendering, I believe this uses a separate thread and therefore doing OpenGL stuff in C++ doesn't work. I tried to load a texture in C++ and pass the id back to java, but it didn't work - the texture was blank. Should I be using an alternative to GLSurfaceView? Is there a normal way of achieving what I am trying? Thanks for your help All the best, Ash -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Physics in Box2D
http://box2d.org/manual.html On Mar 28, 6:32 pm, Lord_Peter piotrek@gmail.com wrote: Hi, I making game for Android. I wish to my game had elements of physics. I installed box2d on my project. My question: how to make an object that could fall, jump, etc? Do you have any examples how to add physics with box2d? Thanks for the reply. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: OpenGL rendering blank with min SDK set
Do you use textures and store images in res\drawable? Try storing them in drawable-nodpi. On Mar 28, 12:42 am, joe bain mrjoeb...@gmail.com wrote: Hi all, I'm about to release a game and have been developing without a min sdk version set in the manifest. The game uses opengl in a GLSurfaceView but now I have set a min sdk version the opengl part is completely white. The game overlays some standard android widgets which still appear fine and work. Does anyone know why changing the min sdk requirement would affect the opengl rendering? I can find no errors in the logs and I'm really at a loss to work out what is happening here. Thanks, Joe -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Music for background
http://developer.android.com/intl/de/guide/topics/media/index.html Playing from a Raw Resource MediaPlayer mp = MediaPlayer.create(context, R.raw.sound_file_1); mp.start(); On Mar 24, 12:42 pm, Nikolay Yanev yane...@gmail.com wrote: How can I set mp3 for background music in my app? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: write tag with opengl on android
If text is static then you need texture (picture) with label Dog, apply it to a quad (two triangles that form up a rectangle). On Mar 21, 11:48 am, a a harvey.a...@gmail.com wrote: Hi all, How can i write a tag like string Dog on the picture. Can anyone paste his/her code on here? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Playing music in Background
http://developer.android.com/intl/zh-CN/guide/topics/media/index.html On 27 фев, 06:27, Ankur Avlani ankuravl...@gmail.com wrote: Hi, I have developed an application in Android using Webview. Now i want to play a music in background. The Mp3 file will come from a URL dynamically. Any pointers would be helpful. I tried to search online but couldnt find much help. Thanks and regards, Ankur -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android.graphics.Point with no getter methods
There are no restrictions on x and y values. Method call is expensive operation in comparison to simple assignment. In this case having getter methods make your code slower with no other benefits (other than your satisfaction). Write your own class and use Point class as a base. Add all desired methods and enjoy the results. On Feb 17, 11:18 am, Raja Nagendra Kumar nagendra.r...@tejasoft.com wrote: Nope.. I almost got used to not having any public fields in our code.. Thanx for letting me know android still uses such approach. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to get the best double buffering?
Do you redraw entire canvas each frame? http://developer.android.com/intl/de/reference/android/view/SurfaceHolder.html#lockCanvas() The content of the Surface is never preserved between unlockCanvas() and lockCanvas(), for this reason, every pixel within the Surface area must be written. On Feb 16, 4:47 pm, MobileVisuals eyv...@astralvisuals.com wrote: I am painting polygons with the Paint class in an animation. New polygon shapes are created for every new frame. These are painting over parts of the screen. The parts of the screen which are not painted in the new frame flicker in a disturbing way. I am using lockCanvas(null); and unlockCanvasAndPost(c). Shouldn't this fix the double buffering to avoid flickering? Does anyone know why the flickering occurs and how I can fix this? It seems like only the part of the screen that is painted for the new frame is double buffered. So I wonder if there is some better way than lockCanvas(null); and unlockCanvasAndPost(c) to implement double buffering? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: android.graphics.Point with no getter methods
Just use public x and y fields. On Feb 17, 8:50 am, Raja Nagendra Kumar nagendra.r...@tejasoft.com wrote: Hi, The point class at android.graphics.Point has no getter methods (getX() and getY()). How does one use Point in general and what is its value as Data Structure for co-ordinates. I am surprised and curies to know how is this used in any android application. Regards, Raja Nagendra Kumar, C.T.Owww.tejasoft.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: OpenGL textures fail to load, white image
Have you looked at logcat? Are there any suspicious messages? Probably there's a problem with freeing bitmaps and you run out of memory. On Feb 14, 5:21 am, peter petero...@gmail.com wrote: Greetings, I've been having an interesting problem with a game I'm developing. The game is being built using the cocos2d-android-1 library. All sprites are loaded from ARGB files. They are of varying size (not powers of 2). When I deploy a test build to my Nexus One after making any code changes (anything that forces the device to redeploy the APK) all the sprites show up just fine. Alpha shows up correctly, etc. If I rerun the application from my N1, it will be missing some or all of the textures at random. Occasionally this is my splash screen sprite. Sometimes it is sprites of individual items on the screen. There doesn't seem to be any rhyme or reason as to what sprites are rendered and which are not. All the items move and behave correctly, but the sprites have been rendered with white textures. If I reboot my phone, the game loads fine for the initial play through, but subsequent play throughs have the bug again. Now I've done some research and it looks like some people had issues using non-power of 2 images for openGL textures. However this doesn't explain why my non-power of 2 textures render fine on the first passthrough, and fail on subsequent passthroughs. Also I've noticed that this problem seems to occur more often when I have the application loading images from the sdcard. If I load the images from the assets folder and use the AssetManager I don't run into the issue as much, although I did see it very rarely. Is there some type of file locking going on here that is preventing subsequent playthroughs from accessing the image file? When a bitmap is loaded, does it prevent other applications from reading the image file while it's in use? I'm going to try using sprite sheets and/or switching everything to use powers of 2, but I'm not sure if that will fix it. I swear it is something wrong with how the files are loaded (asset folder vs folder on sdcard) that is prevent subsequent playthroughs from correctly loading the texture. This is the code I'm using to read in the files: private static HashMapString, CCTexture2D textureMappings = new HashMapString, CCTexture2D(); public static final CCTexture2D addTexture(String filePath) { if(filePath.contains(../)) { return null; } CCTexture2D rtn = textureMappings.get(filePath); if (rtn == null) { String path = Constants.DEFAULT_PATH + filePath; File f = new File(path); if (f.exists()) { Bitmap bmp = BitmapFactory.decodeFile(Constants.DEFAULT_PATH + filePath); rtn = new CCTexture2D(bmp); textureMappings.put(filePath, rtn); } } return rtn; } This is the constructor for CCTexture2D: public CCTexture2D(Bitmap image) { CGSize imageSize = CGSize.make(image.getWidth(), image.getHeight()); CGAffineTransform transform = CGAffineTransform.identity(); int width = toPow2((int) imageSize.width); int height = toPow2((int) imageSize.height); while (width kMaxTextureSize || height kMaxTextureSize) { width /= 2; height /= 2; transform = transform.getTransformScale(0.5f, 0.5f); imageSize.width *= 0.5f; imageSize.height *= 0.5f; } if (imageSize.width != width || imageSize.height != height) { Bitmap bitmap = Bitmap.createBitmap(width, height, image.hasAlpha() ? Bitmap.Config.ARGB_ : Bitmap.Config.RGB_565); Canvas canvas = new Canvas(bitmap); canvas.drawBitmap(image, 0, 0, null); image.recycle(); image = bitmap; } init(image, imageSize); } This is what happens in init: private void init(Bitmap image, CGSize imageSize) { mBitmap = image; mWidth = image.getWidth(); mHeight = image.getHeight(); mContentSize = imageSize; // _format = image.getConfig(); _maxS = mContentSize.width / (float) mWidth; _maxT = mContentSize.height / (float) mHeight; _texParams = _gTexParams; ByteBuffer vfb = ByteBuffer.allocateDirect(4 * 3 * 4); vfb.order(ByteOrder.nativeOrder()); mVertices = vfb.asFloatBuffer(); ByteBuffer tfb = ByteBuffer.allocateDirect(4 * 2 * 4); tfb.order(ByteOrder.nativeOrder()); mCoordinates = tfb.asFloatBuffer(); if(mBitmap.getConfig() == Bitmap.Config.ARGB_)
[android-developers] Re: AdSense for Android: is it available in Europe?
adMob allows using adSense as ads source. In case of adSense (without adMob) you have to register account and mention that you're going to show ads in mobile application. On Jan 19, 11:39 pm, Mik mam.marche...@gmail.com wrote: On Jan 18, 6:52 pm, ko5tik kpriblo...@yahoo.com wrote: It is available but not for everybody - you have to meet certain criteria (amount of traffic) to be accepted Ah! Ok thanks. So I guess the solution for developers who are just starting is admob... Mik -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Best, easiest, cleanest, way to make a game and cross platfrom.
libgdx allows you to develop mostly on PC and then generate apk for android. Unity engine has iPhone and Android targets. However android version will cost you. On Jan 20, 3:30 am, brian purgert brianpurge...@gmail.com wrote: Well, I,ve decided that I want to make my next game a diffrent way, after learning alot, i don't think i want to draw it with the canvas altough very easy for the concept im going with. So what do you think about andengine or corona sdk or even straight opengl i saw a little kid use it to make a game lol, so its probably easy, also i want it to be easy to transfer from platfrom to platfrom. What are my options, your advice.. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Getting Generic Failure when sending Many SMS (Android)
There's a limit on the SMS number. Look it up. On Jan 18, 12:43 am, john stutteringjohnsm...@gmail.com wrote: If I run my program with 2 phone numbers it works but if I run with with like 100 I get the Generic Failure. any way to make my program not sent 2nd text until the 1 first one is back? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Making cross-thread blocking/sync calls
Probably you just need some flag signaling that your hardware isn't ready. Rendering thread always runs without blocking, checks for this flag and do not do certain things (may be render function just returns right away). UI thread sets the flag and then rendering thread checks for it. On 9 янв, 11:22, Kostya Vasilyev kmans...@gmail.com wrote: 08.01.2011 10:37, Bob Kerns пишет: Memorize this pattern! If you're using notify/wait, it should ALWAYS look something like this. Always - except unless you actually want to respect the meaning of InterruptedException and unwind the code around wait() to the caller, canceling the operation. -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android NDK r5
Just my observation. I was trying to use ogg in my project. Shared libvorbisfile uses static libogg. My final shared library uses libvorbisfile. For some reason it works on Galaxy S (Android 2.2) and doesn't on G1 (Android 1.6). So I had to merge libogg and libvorbisfile into one static library that is used by my shared library. On 6 янв, 07:02, Dan dan.schm...@gmail.com wrote: I have a build setup that was ok with the r4 NDK, but STLPort and all the other nifties of the r5 ndk tempted me to upgrade (despite the don't fix what ain't broke rule.) The process builds a shared library, and it fails on r5 (where it worked on r4) not finding a bunch of the symbols it should find. I think I've tracked it down to LOCAL_SHARED_LIBRARIES not being propagated as a dependency to the SharedLibrary .so creation, and was wondering if the removal of the $(call module-add-shared-depends,$(LOCAL_MODULE),$ (LOCAL_SHARED_LIBRARIES)) from build/core/build-binary.mk in the r5 ndk was intentional, and if so, how should I be passing the other libraries that my shared library depends on through so that the symbols are found? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how to get the GPU information of android device?
Quadrant benchmark displays GPU info. On 28 дек, 12:21, 陈彧堃 chenyuku...@gmail.com wrote: thanks, but it can only display CPU information. On Tue, Dec 28, 2010 at 2:31 PM, patrick patrick.boul...@gmail.com wrote: You can use the application android system info in the android market On 28 déc, 00:24, 陈彧堃 chenyuku...@gmail.com wrote: rt, thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: My game, what do you think help me out
Biker is hard to see on game background. Controls aren't very intuitive. It seems that releasing finger doesn't mean releasing throttle. If it's really the case then there should be some indication on the screen about current acceleration level. Texts in menus are somewhat hard to read. In fact everything in the menus look a bit squeezed. My device has 800*480 resolution. It seems that you do not close any game activities. After playing around I had to press back key many many times to get rid of all start screens, help screens etc. On 25 дек, 15:56, brian purgert brianpurge...@gmail.com wrote: Do you think I should tone the menus down or the ingame graphics down. Also what did you find hard about playing it. don't really regard the second level because its hard to beat then expected so ill update that tonight On Dec 25, 2010 1:38 AM, Brill Pappin br...@pappin.ca wrote: I found it a bit difficult, although this kind of game really isn;t my cup of tea. I liked the graphics as unusual but they made it a bit hard to see what I was supposed to do. Maybe tone them down a little. I'm not much help I think, but thanks for sharing. - Brill Pappin On Dec 24, 9:46 pm, brian purgert brianpurge...@gmail.com wrote: So, I would like you guys to try out my app I just updated it, its called doodle bike. I figured you could help me alot more then the average users could. So tell me what you think about the tilting the physics, bike speed, levels style,art and everything. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: call c++ function with jni and android ndk
Enclose contents of your cpp with following #ifdef __cplusplus extern C { #endif your cpp functions #ifdef __cplusplus } #endif On 22 дек, 14:30, TobyKaos aubrun.thib...@chaos-interactive.com wrote: Hello, I first run samples found in androind ndk and I create my own in C. I successfully print a hello world with c function. but now I want to call c++ function. Then I change file extensions to .cpp and remake with ndk-build. Ok that seems to work fine. I refresh my eclispe project. Ok eclispe seems to find my hello world function in new .so lib made in c++. Then I launched debug and application failed because it does not find c ++ function. My function is the same but I modify jni function in it to match c++ jni. My TestSTL.java package com.project.teststl; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class TestSTL extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); TextView tv = new TextView(this); tv.setText( stringFromJNI() ); setContentView(tv); } native public static String stringFromJNI(); static { //System.loadLibrary(stlport_shared); System.loadLibrary(teststl); } } * my test.cpp file #include string.h #include jni.h #include stdlib.h #include stdio.h /* Call to initialize the graphics state */ JNIEXPORT jstring JNICALL Java_com_project_teststl_TestSTL_stringFromJNI( JNIEnv* env, jobject obj ) { jstring s = (env)-NewStringUTF( Hello from JNI !); return s; } I repeat, in C all is ok (I just modify NewStringUTF for C or C++ because are not the same definition). Please help me. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Application visibility on Galaxy S
Searching for secu4 on the Android Market lists BlueWathDog for android 2.x (one result). My Galaxy S is running Android 2.2 On Dec 16, 3:47 pm, Laurent Lugon laurent.lu...@secu4.com wrote: Hi all, I have published an application on the market and I find it with different android 2.x phone. The problem is when I make the same key-word search (secu4) with my Galaxy S, I don't see anithing, however there is 2 application (for android 1.x and android2.x) on the market which should be found. Here is my manifest : ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.secu4.bluewatchdog2 android:versionCode=5 android:versionName=2.2 application android:icon=@drawable/card android:label=@string/app_name android:screenOrientation=sensor android:debuggable=false activity android:name=.Welcome android:configChanges=orientation|keyboardHidden android:label=@string/app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity activity android:name=.Connected android:configChanges=orientation|keyboardHidden/ activity android:name=.Alarm android:launchMode=singleTask android:configChanges=orientation|keyboardHidden android:theme=@android:style/Theme.Dialog/ activity android:name=.Protecting android:configChanges=orientation|keyboardHidden/ activity android:name=.Settings android:configChanges=orientation|keyboardHidden/ service android:name=.provider.ArmService android:enabled=true/ service android:name=.provider.ProtectionService android:enabled=true/ /application uses-permission android:name=android.permission.BLUETOOTH/ uses-permission android:name=android.permission.BLUETOOTH_ADMIN/ uses-permission android:name=android.permission.VIBRATE / uses-sdk android:minSdkVersion=3/ /manifest I also try to add this in the manifest : supports-screens android:smallScreens=true android:normalScreens=true android:anyDensity=true android:largeScreens=true android:resizeable=true / But the application still hidden for the Galaxy S... Why ? Thank you ! *Best regards* SECU4 SA Laurent Lugon Moulin Technical Development Assistant Technopôle 5 3960 Sierre – Switzerland Office : +4127 4567 931 Fax : +4127 4567 935 Mobile : +4179 4509 566 Skype : laurent.lugon.moulin www.secu4.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: OpenGL glScissor not working on HTC phones
Try to render static part of the screen twice so both back and front buffers have the same content. However I think it's better to render static scene, store it as texture and draw simple quad at the beginning of each frame. On Nov 14, 7:42 pm, Jeff Boody jeffbo...@gmail.com wrote: I do not do a gl.glClear(GL10.GL_COLOR_BUFFER_BIT); so the bits that were drawn previously should remain. Actually this isn't the default behavior. I think you need to request EGL_BUFFER_PRESERVED for the EGL_SWAP_BEHAVIOR. Unfortunately this currently (froyo) isn't possible because Android only supports EGL 1.0 + some extensions. The eglSurfaceAttrib() API entry point was added at a later version of EGL. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: onSurfaceCreated called twice
Set desired screen orientation for your activity in android manifest file. On Oct 28, 1:09 am, deki dcec...@gmail.com wrote: Is there a way to make sure onSurfaceCreated is called only once during startup. Currently in my app it gets called once with say 800x480 then it gets called a second time with 480x800. I guess this is probably due to a call to setRequestedOrientation in onCreate. Is there any way to make sure the app starts in a particular orientation, to prevent orientation changes, and to have onSurfaceCreated get called only once during start up? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem with OpenGL ES application,please help
Try reducing texture resolution. 128x128 texture for each of 6 sides of the cube. That means you do 6 texture switches to draw one cube. 10 cubes - 60 texture switches per one scene. Use one texture for all your cubes and see what you get. On 25 окт, 16:40, gambiting gambit...@gmail.com wrote: Hi there, I am currently trying to develop a game for android in OpenGL ESand I am testing it on my Nexus One. But I have run into some performance problems,and I would like to ask somebody about it,could you help? I currently have a very basic scene - background made of 25 tiles(256x256 texture each), and then a number of textured cubes(128x128 texture for each side of a cube ). However,when I try to display approx. more than 10 cubes, the performance becomes so sluggish that I can't even rotate the scene smoothly. I can't imagine how can I add more objects(player,enemies, all that kind of stuff) when it runs so slowly with 35 objects in total. I mean - games like Raging Thunder 2 probably display hundreds of objects at once(plus they do lots of computations behind the scenes) and they run super- smooth on my nexus one. What am I doing wrong? Could somebody help me please -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Stolen app on market
Google removed infringing app upon our request. On 13 окт, 22:00, Moto medicalsou...@gmail.com wrote: Oh man... I was actually thinking this could happen to me any time soon and now that it happen to you I'm even more worried! I guess I'm gonna have to invest some money for protecting my application :( it already insanely pirated... And yes I have originally wanted to go with Amazon! I bet they got a better solution to spam pirates and all that... -Moto On Oct 13, 8:35 am, JP joachim.pfeif...@gmail.com wrote: On Oct 13, 4:51 am, Edmund Higgins ehiggins...@gmail.com wrote: I would rather have controlled quality in my market than chaotic crap! O well who wouldn't agree. It'll be interesting to see if Amazon can come up with compelling terms to attract a sufficient critical mass of quality apps, offer decent discoverability, presentation with customer appeal, easy payment, in app payment - short, offer all that's missing in Android Market to emphasize monetization for devs that put in the effort. If these guys take off, they might be able to stick Android Market with the crap. It's a longshot though. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Best phone for OpenGL game dev
Results are pretty good. However iPhone 4 has higher resolution (960 by 640) so in some cases it'll be harder for it to compete. BTW Samsung Galaxy S gets Android 2.2 in Europe. Anyway there are only 33% of Android 2.2 phones. And only few of them are Samsung. If your game will run smooth only on one device you won't get large install base. On 14 окт, 18:22, Tudor Tihan tudorti...@gmail.com wrote: Thank you all for your answers. @Nightwolf: That link was much appreciated. I also found this benchmark comparison, how do the results look to you:http://www.glbenchmark.com/compare.jsp?benchmark=glpro11showhide=tru...) @Andy: On Oct 14, 12:32 am, Adam Hammer adamhamm...@gmail.com wrote: I do mine on a N1. 2.2 is a target if you want to support ES2.0. You can do so in 2.1 but it'll be a headache using the NDK for such. [...] Can you give me a bit more details on this? The only high performance phone I can get in my country (Romania) is the Samsung Galaxy S, but it is 2.1. I am interested in making use of shaders in a character detailed 3D video game with lots of particle effects. What sort of pain would I get myself into if I bought that phone? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Best phone for OpenGL game dev
http://androidandme.com/2010/10/news/3dmarkmobile-gpu-showdown-adreno-205-vs-powervr-sgx540/ Those are the fastest. However if install base matters then you should target the least capable device. On 13 окт, 19:31, Tudor Tihan tudorti...@gmail.com wrote: Hello everyone, What do you think is the best phone for OpenGL ES based game development? Large screen, OS 2.0.1+. Maybe even having the shaders path accessible from NDK. Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Stolen app on market
Thank you for the answers. We reported about infringement to adMob and Google. AdMob advised to file CD to Google and we did so. On 4 окт, 21:44, { Devdroid } webnet.andr...@gmail.com wrote: On 4 October 2010 19:14, Nightwolf mikh...@gmail.com wrote: Recently I've discovered that our app Little Python is distributed by developer who call himself Adam Gates. He renamed our app to snake, replaced icon and changed AdMob id. He has 55 published apps. Please take a look may be you'll find yours. Is there any way to shut him down? Please advise. Sure. Write to Google using this link (in Market console Help on the upper side, then Contacting Us on bottom and then Android Market Developers: Publishers Merchants then probably Application Removal which would lead you to this: http://www.google.com/support/androidmarket/bin/request.py?contact_ty... Write down your discovery -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Stolen app on market
I guess it'll take some time to get answer from Google. Hope they'll do something this year. In CD we mentioned that this particular Developer is a repeat infringer. So now there are at least 3 cases with this guy - the first is mentioned in the link above, the second is developer who has his app stolen and warned us and the third is our case. On 12 окт, 19:57, Kumar Bibek coomar@gmail.com wrote: Yeah, that should be straightforward. I guess, they just don't look at these issues seriously as yet. Or may be the legal procedures just take too long. BTW, have you got a reply? 2010/10/12 Yahel kaye...@gmail.com Ok, this is getting ridiculous !! We are on theft issue here, not just spam or something dull. GOOGLE should not just remove the app. This is a big, huge, and the worst infringement you can find in the whole history of market crapiness : The account of this guy should be deleted. period. As soon as GOOGLE receive the first CD letter and checked that it is indeed exactly the same app, boom !! Even if all the other apps are his own work. Yahel On 12 oct, 15:57, Nightwolf mikh...@gmail.com wrote: Thank you for the answers. We reported about infringement to adMob and Google. AdMob advised to file CD to Google and we did so. On 4 окт, 21:44, { Devdroid } webnet.andr...@gmail.com wrote: On 4 October 2010 19:14, Nightwolf mikh...@gmail.com wrote: Recently I've discovered that our app Little Python is distributed by developer who call himself Adam Gates. He renamed our app to snake, replaced icon and changed AdMob id. He has 55 published apps. Please take a look may be you'll find yours. Is there any way to shut him down? Please advise. Sure. Write to Google using this link (in Market console Help on the upper side, then Contacting Us on bottom and then Android Market Developers: Publishers Merchants then probably Application Removal which would lead you to this: http://www.google.com/support/androidmarket/bin/request.py?contact_ty. .. Write down your discovery -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubs-cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Stolen app on market
Recently I've discovered that our app Little Python is distributed by developer who call himself Adam Gates. He renamed our app to snake, replaced icon and changed AdMob id. He has 55 published apps. Please take a look may be you'll find yours. Is there any way to shut him down? Please advise. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Implement seek bar for playing videos
Implement OnSeekBarChangeListener for your seekBar and handle onProgressChanged(). On Oct 1, 8:51 am, Ashok Jeevan ashokjee...@gmail.com wrote: Hi, I am using seekBar to show the progress of the video which I implemented using Media Player / Video View. But as the thumb of the seekBar is moved back and forth, the video is not starting correspondingly from the position of the thumb. Is there any way to locate the position of the thumb so that the video can load from the seekBar's thumb's position? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how do i draw a semicircle using a path?
path.addArc(oval, startAngle, sweepAngle) path.addArc(oval, 0, 180) On 27 сен, 15:19, dadada ytbr...@gmail.com wrote: hi, how do i draw a semicircle using a path? thanks, bryan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How can I track down a crash in a .so without a stack trace?
What is your game? I could try it on G1 with 1.6. On Sep 20, 9:42 pm, Leigh McRae leigh.mc...@lonedwarfgames.com wrote: My game is crashing on the HTC Hero and I have managed to get a user to send me their log. I don't see a Java stack trace at all. It looks like it's crashing in the OpenGL driver. I was wondering how I could go about trying to determine the problem. I was thinking of adding that acra project that sends crash reports to a server but I am thinking it will just send the same that is in this log. I have error checking everywhere so I am really at a lose where to go from here. I even went out and bought a HTC Hero but Canada only has 1.5 for the OS. 09-19 09:09:40.957 I/DEBUG ( 53): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 09-19 09:09:40.957 I/DEBUG ( 53): Build fingerprint: 'sprint/htc_heroc/ heroc/heroc:2.1-update1/ERE27/169236:user/release-keys' 09-19 09:09:40.957 I/DEBUG ( 53): pid: 5999, tid: 6009 com.lonedwarfgames.tanks.androidpaid 09-19 09:09:40.957 I/DEBUG ( 53): signal 11 (SIGSEGV), fault addr 0089e268 09-19 09:09:40.957 I/DEBUG ( 53): r0 00387ab4 r1 00387ab0 r2 0089e268 r3 03ff 09-19 09:09:40.957 I/DEBUG ( 53): r4 0005 r5 0089e268 r6 009705b0 r7 00387ab0 09-19 09:09:40.957 I/DEBUG ( 53): r8 00382128 r9 00382c24 10 004554c0 fp 00162480 09-19 09:09:40.957 I/DEBUG ( 53): ip sp 462f8ce4 lr 8052b6a8 pc 8053ec30 cpsr 2010 09-19 09:09:43.007 I/DEBUG ( 53): #00 pc 0003ec30 /system/lib/egl/ libGLES_qcom.so 09-19 09:09:43.007 I/DEBUG ( 53): #01 lr 8052b6a8 /system/lib/egl/ libGLES_qcom.so 09-19 09:09:43.007 I/DEBUG ( 53): 09-19 09:09:43.007 I/DEBUG ( 53): code around pc: 09-19 09:09:43.017 I/DEBUG ( 53): 8053ec20 e0225492 e08cc144 e59041b4 e2810004 09-19 09:09:43.017 I/DEBUG ( 53): 8053ec30 e5925000 e2444003 e4815008 e5925004 09-19 09:09:43.017 I/DEBUG ( 53): 8053ec40 e5805000 e5b25008 e2810004 e2822004 09-19 09:09:43.017 I/DEBUG ( 53): 09-19 09:09:43.017 I/DEBUG ( 53): code around lr: 09-19 09:09:43.017 I/DEBUG ( 53): 8052b698 e1a03004 e1a01007 e1a9 e12fff3c 09-19 09:09:43.017 I/DEBUG ( 53): 8052b6a8 e599a024 e59d0008 e318 e087b10a 09-19 09:09:43.017 I/DEBUG ( 53): 8052b6b8 0a0a e3a03000 e58d3000 e599c080 09-19 09:09:43.017 I/DEBUG ( 53): 09-19 09:09:43.017 I/DEBUG ( 53): stack: 09-19 09:09:43.017 I/DEBUG ( 53): 462f8ca4 00383128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8ca8 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cac 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cb0 00382528 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cb4 8053bfc0 /system/lib/egl/ libGLES_qcom.so 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cb8 0080 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cbc 00383128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cc0 00382c24 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cc4 00382128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cc8 00383128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8ccc 8052afe0 /system/lib/egl/ libGLES_qcom.so 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cd0 4224 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cd4 00383128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cd8 df002777 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cdc e3a070ad 09-19 09:09:43.017 I/DEBUG ( 53): 462f8ce0 00382128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): #00 462f8ce4 0400 09-19 09:09:43.017 I/DEBUG ( 53): 462f8ce8 004554c0 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cec 009705b0 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cf0 00382528 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cf4 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cf8 0008 09-19 09:09:43.017 I/DEBUG ( 53): 462f8cfc 09-19 09:09:43.017 I/DEBUG ( 53): 462f8d00 0006 09-19 09:09:43.017 I/DEBUG ( 53): 462f8d04 001dbfa0 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8d08 00382128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8d0c 00383128 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8d10 00382528 [heap] 09-19 09:09:43.017 I/DEBUG ( 53): 462f8d14 004554c0 [heap] 09-19 09:09:43.027 I/DEBUG ( 53): 462f8d18 00162480 [heap] 09-19 09:09:43.027 I/DEBUG ( 53): 462f8d1c 8051fa14 /system/lib/egl/ libGLES_qcom.so 09-19 09:09:43.027 I/DEBUG ( 53): 462f8d20 001dbfa0 [heap] 09-19 09:09:43.027 I/DEBUG ( 53): 462f8d24 09-19 09:09:43.027 I/DEBUG ( 53): 462f8d28 00148aa8 [heap] -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: opnegl es 2.0 on the Froyo is working now?
AFAIK emulator comes with software rasterization that doesn't support 2.0. You should use real device for that. On Aug 23, 6:07 am, choi devmc...@gmail.com wrote: It tested on the Emulator. not a device. On 8월23일, 오전11시01분, choi devmc...@gmail.com wrote: Hello, I am testing the opengl es 2.0 on the Froyo(SDK2.2) for the code thing and make it as normal. but it has been failed all the time. Always it says, No configs match configSpec what prablem is here? isn't opengl es 2.0 working on the android sdk 2.2?? Please someone tell why... Regards -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Yet another Droid OpenGL texture problem
Why do you set GL_TEXTURE_MIN_FILTER twice? Replace one of the calls with GL_TEXTURE_MAG_FILTER. On Aug 10, 5:22 am, Mike mcmulle...@gmail.com wrote: Welp, I did even better. I went out and bought a Droid from Craigslist. I logged the height and width of the bitmaps at each of the mipmap levels and here's the output: DEBUG/Texture(1558): Texture image loaded at 256 x 256 DEBUG/MMTexture(1558): Texture image loaded at 128 x 128 DEBUG/MMTexture(1558): Texture image loaded at 64 x 64 DEBUG/MMTexture(1558): Texture image loaded at 32 x 32 DEBUG/MMTexture(1558): Texture image loaded at 16 x 16 DEBUG/MMTexture(1558): Texture image loaded at 8 x 8 DEBUG/MMTexture(1558): Texture image loaded at 4 x 4 DEBUG/MMTexture(1558): Texture image loaded at 2 x 2 DEBUG/MMTexture(1558): Texture image loaded at 1 x 1 So, if it's not the size that's the problem, something with the format of the bitmaps themselves? Well at least now I have a phone to test on. On Aug 9, 7:35 pm, String sterling.ud...@googlemail.com wrote: Can I suggest you stick a Log call in with your actual loaded texture sizes? Something like the following: Log.i(TAG, Texture image loaded at + mapImage.getWidth() + x + mapImage.getHeight()); Then get one of the Droid/Milestone users to shoot you a logcat output... xda-devs folks ought to be able to handle that. That'll at least tell you if the images are loading at the size you expect, or if it's a different problem. String On Aug 9, 10:11 pm, Mike mcmulle...@gmail.com wrote: I am. That's what's so perplexing. On Aug 9, 3:56 pm, Tom orei...@mbari.org wrote: Make sure that you are loading your textures from the drawable-nodpi resource directory:http://www.anddev.org/opengl_textures_-_motorola_droid-t10930.html On Aug 9, 1:07 pm, Mike mcmulle...@gmail.com wrote: I'm getting white (blank) textures on everything when running on the Droid and Galaxy S devices. My textures are all power-of-two PNGs and they're in the /res/drawable- nodpi folder. Here's my code: public GLTextures(GL10 gl, Context context) { if(gl==null)return; this.gl = gl; this.context = context; this.textureMap = new java.util.HashMapInteger, Integer(); sBitmapOptions.inPreferredConfig = Bitmap.Config.RGB_565; } public void freeTexs(){ gl.glDeleteTextures(textures.length, textures,0); textureFiles = null; } public void loadTextures() { if(gl==null)return; int[] tmp_tex = new int[textureFiles.length]; gl.glGenTextures(textureFiles.length, tmp_tex, 0); textures = tmp_tex; for (int i = 0; i textureFiles.length; i++) { this.textureMap.put(new Integer(textureFiles[i]), new Integer(i)); int tex = tmp_tex[i]; gl.glBindTexture(GL10.GL_TEXTURE_2D, tex); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT); gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE); InputStream is = context.getResources().openRawResource(textureFiles[i]); Bitmap bitmap; try { bitmap = BitmapFactory.decodeStream(is, null, sBitmapOptions); } finally { try { is.close(); } catch (IOException e) { // Ignore. } } buildMipmap(gl, bitmap, tex); bitmap.recycle(); } } private void buildMipmap(GL10 gl, Bitmap bmp, int tex) { // int level = 0; // int height = bmp.getHeight(); int width = bmp.getWidth(); while (height = 1 || width = 1) { GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bmp, 0); if (height == 1 || width == 1) { break; } // Increase the mipmap level level++; // height /= 2;
[android-developers] Re: Drawing 2D stuff on the screen in OpenGL over a 3D scene
There's a chance that your 2D stuff is behind 3D stuff. Turning depth test off is a good idea for drawing UI. gl.glDisable(GL10.GL_DEPTH_TEST); Does drawing 2D alone work? On Jun 27, 4:01 pm, Navigateur naveen.c...@googlemail.com wrote: Can somebody take me step-by-step how to draw 2D stuff over a 3D scene (such as controls, etc.). What I've been doing so far has not been working (it only draws the 3D scene), which is (in every frame): draw the 3D scene as normal, projection matrix mode, load identity, call GLU.gluOrtho2D(gl, 0, myScreenWidthInPixels, 0, myScreenHeightInPixels), switch the array pointers (vertices and texture coords) to the ones for my 2D stuff, then drawElements with an appropriate index list. (then switch the array pointers back so the 3D stuff works again). I get nothing added to the screen (just the 3D stuff). Do I need to be doing something else for it to draw? Can somebody take me step-by-step? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Transparent textures in OpenGL ES.. How?
Part of my texture loading code looks like this: final Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), resId); GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); bitmap.recycle(); Following lines should be somewhere in initialization: // Blending Function For Translucency Based On Source Alpha Value gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); gl.glEnable(GL10.GL_BLEND); On Jun 21, 9:30 pm, Navigateur naveen.c...@googlemail.com wrote: I got it working! The right data order is ARGB, but it just wasn't accepting my original data for some reason (even though the data is fine)... so by writing it, pixel by pixel, to a new Bitmap.. it works (that's why RGBA version was treating the A as B) Can anyone tell me why I have to write a new Bitmap (it's a waste of processing). Does the Bitmap have to be mutable or something? On Jun 21, 6:13 pm, Navigateur naveen.c...@googlemail.com wrote: Correction: if I use the original ARGB format of the .png without converting it to RGBA, it doesn't work at all. (But with RGBA it has the problem as stated). On Jun 21, 5:30 pm, Navigateur naveen.c...@googlemail.com wrote: I should add, maybe GL10's glTexImage2D is the way to go here but I can't get that working at all. Maybe I have the pixel buffer pixels in the wrong order, since I use Bitmap's copyPixelsToBuffer to create the pixels buffer (what's the correct ordering for pixels in this buffer)? Or is GLUtils.texImage2D is the best one to call? On Jun 21, 4:57 pm, Navigateur naveen.c...@googlemail.com wrote: I can't seem to get GLUtils.texImage2D to use my full RGBA (A=my alpha component). I've tried doing setEGLConfigChooser(8, 8, 8, 8, 0, 0); getHolder().setFormat(PixelFormat.RGBA_); I've tried converting the source image (.png in ARGB) to RGBA.. which works ok for the ordering of data before texImage2D, but when it draws, it draws yellow where it should be transparent white... which suggests it's diminishing the B(blue) component instead of the A(alpha) component. But the same thing happens when I just use the orignal ARGB data instead (B diminishes instead of A, leaving yellow). I have no idea why but I'll keep trying, but has anybody done this properly and has the answer?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Best way to live demo apps
Only Gallery app is allowed right now. On Jun 16, 7:58 am, Stuart Reynolds s...@stureynolds.com wrote: Any word on whether the EVO can display the phone screen to a monitor? Thanks - Stuart On Fri, May 28, 2010 at 5:42 PM, Mark Murphy mmur...@commonsware.com wrote: Wayne Wenthin wrote: don't some of the newer phones have output ports? I thought a couple of them even did 720p At least with the EVO 4G, one review indicated it only played video (and...gallery images?), not the Android home screen or regular activities. I haven't picked up the right HDMI cable to try it out yet. -- Mark Murphy (a Commons Guy) http://commonsware.com|http://github.com/commonsguy http://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.5 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Game Stuttering
Try to measure time needed to render each frame. May be something's wrong with your game logic. For ex. thread calculating new ingame positions is called too often and takes precedence over rendering thread. On Jun 14, 8:14 pm, czimm...@exit4gaming.com czimm...@exit4gaming.com wrote: I have an issue with the OpenGL game I am developing that I am getting significant stuttering. I have put in a lot of debug code to try to see if it is something I am doing, but I haven't had any success at narrowing down what is going on. Stutters are between 80 msec and sometimes annoyingly as high as 200+ msec on my Droid. When the game is running, I don't think I am creating any garbage, but when I am initializing a level, I am definitely creating some garbage. Just before starting the level, I give a hint to collect the garbage. This got rid of a lot of my problems, but there is still stuttering going on. I put in some code to instrument the amount of time that I spend in various parts of my main rendering loop. The stutters seem to happen randomly, each time in a different piece of code, so I am attributing them to something outside of my main loop code. I also am NOT seeing the GC running when these stutter happen on the catlog. Is this services running while my game is running? Is there a way to prevent this or at least mitigate the damage? I notice that sometimes the backlight on the menu keys (back/home/ search etc.) is going on and off in sync to some of these stutters. Why is this happening? I have orientation changes turned off and I don't think I understand what is going on with this backlight or why this would be related to the stutters. I have bumped my game up to MAX_PRIORITY and it seemed to help some, but did not get rid of this issue entirely. Can anyone help here or offer any suggestions on what could potentially be going wrong or with suggestions on how to debug this problem? Thanks, Charlie -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Frame rate suprisingly low in landscape mode
Such things should be definitely tested on a device. We had such issue in the past. Even tried to make some optimizations. However switching to a real phone showed that we were moving in the wrong direction. On Jun 10, 8:17 pm, satlan esh satlan_...@yahoo.com wrote: I am testing some OpenGL code on the emulator, and I've noticed some frame rate issues. There is obviously a 60fps ceiling for portrait, and 30fps ceiling for landscape, that's clear. However, frame rate in landscape mode seems to be inherently lower by a factor of almost 1.5 or more. That is, if I get 30fps in portrait, I'd get around 20fps in landscape. The application runs full screen, so there's exactly the same screen real estate. Is this just an emulator issue, or does real hardware behave alike? Since the application is full screen, I can get around most of this by rotating the scene 90 degrees. Is this the recommended setup? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: stop/prepare MediaPlayer issues
My guess is to use just stop() without checking for isPlaying. And instead of recreating mediaPlayer on each button press call stop() and prepare(). On Jun 15, 7:38 pm, Jeff B. jeffbromber...@gmail.com wrote: To avoid any confusion, I don't know if I made it clear that the code I have listed is currently working. I'm just not sure of why I am needing the IllegalStateException logic. Thanks, Jeff On Jun 12, 12:39 am, Jeff B. jeffbromber...@gmail.com wrote: Hello, I have an ImageButton that plays a sound whenever it is held down and stops as soon as you let up. To do this I register an onTouch handler and operate on ACTION_DOWN and ACTION_UP MotionEvents. The code is below. The idea is that when the ACTION_UP comes in I first call stop() and then I re-prepare the sound so that it is all ready for the next start() in a subsequent ACTION_DOWN. I do this instead of start/ pause because I need the sound to start from the beginning each time and the seekTo() call is asynch which seemed to complicated the logic. The problem I'm having is that every now and then if I'm really beating on the button (i.e. clicking it rapidly and for different durations) I will hit the illegal state exception. The debugger log shows that I am in MEDIA_PLAYER_PLAYBACK_COMPLETE (128) when trying to call prepare(). As you can see below, I only try to call prepare after I have called stop. So this would imply that stop is somehow either asynchronous or the two operations are being allowed to happen in an overlapped fashion. So two questions: 1) does anyone have an explanation for what I'm seeing? 2) is there a better/cleaner way to do what I'm trying to do in general? This is my first android app so it's very possible I'm missing the boat on something. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Context appCtx = getApplicationContext(); // button init code removed mSoundBeep = MediaPlayer.create(appCtx, R.raw.beep); mImgBtnBeep.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: mSoundBeep.start(); break; case MotionEvent.ACTION_UP: if (mSoundBeep.isPlaying()) { mSoundBeep.stop(); try { mSoundBeep.prepare(); } catch (IllegalStateException e) { mSoundBeep.release(); Context appCtx = getApplicationContext(); mSoundBeep = MediaPlayer.create(appCtx, R.raw.beep); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } break; } return false; } });- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Any ScoreLoop users out there?
Sometimes users enter profanity as their nick name. Are there any means to avoid that with ScoreLoop? If the answer is positive then what are the supported languages? Is it possible to attach a picture to user record? On May 29, 11:28 am, Prenitha prenitha...@yahoo.co.in wrote: Hi Neil, We have posted the answer to your query as an FAQ on Scoreloop's support website. You can directly click the following link to get there. http://support.scoreloop.com/faqs/android-development/removing-search... If you have any additional queries, the fastest way to get a response will be to use our support website. Regards, Prenitha. On May 27, 12:18 am, Neilz neilhorn...@googlemail.com wrote: Great, thanks Junde. Can you tell me how I can filter this list, to only show the values I want? Like my example with the Jewels game, I really only want the first three items in the list, at most. Or is it just a simple code hack? On May 26, 6:29 pm, Junde (Scoreloop) jun...@gmail.com wrote: Hi Neil, I'm sure there should be some Scoreloop users here. There's actually guys from the Scoreloop team here too, I'm one of them :) These are basically some ISO jargon, that we are going to replace with friendlier words very soon. Basically, iso3166_1 refers to country codes, and iso3166_2 refers to country subdivision codes (regions/cities etc). So it's 2 additional ways of filtering scores. As for how iso3166_1 differs from your Country, I think your Country is based on the user's input on their player profile, while iso3166 is based on detection. I'll verify this for you. By the way, we've also got a nice support forum up athttp://support.Scoreloop.com if you're interested to learn more. Cheers, Junde On May 26, 9:42 pm, Neilz neilhorn...@googlemail.com wrote: I'm implementing ScoreLoop for my game. There is a standard selection widget for the leaderboard type, which lets you refine the scores. By default, I get: - Global Leaderboard - Your Country Leaderboard - 24h Leaderboard - search_list.nationality_iso3166_1 - search_list.nationality_iso3166_2 What on earth are the last two items? This list seems to come from ScoreLoop, rather than being anything configurable in the xml. I only want the first three in the list, is there anyway I can set this somewhere? I notice that other games that use ScoreLoop (like Jewels for example) only have the first three items also. Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Using MediaPlayer - multiple sound files
Another way is to use single MediaPlayer and call reset(), setDataSource(), prepare() and start(). There could be some delays though, at least for the first time. BTW the last time I tried SoundPool it was impossible to have more than 1 MB of sounds. SoundPool uses uncompressed audio and I didn't find a way to control bitrate and other stuff. I wanted five 17-18 sec samples and that was impossible with SoundPool. On 11 мар, 02:50, Neilz neilhorn...@googlemail.com wrote: Anyone? I'm sure this must be a common problem... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GLSurfaceView problem/querry
Please do not copy and paste example since it only illustrates the idea. GameView is descendant of GLSurfaceView FrameLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent com.***.GameView android:id=@+id/game android:layout_width=fill_parent android:layout_height=fill_parent requestFocus / /com.***.GameView RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent RelativeLayout android:layout_width=60px android:layout_height=60px android:gravity=center android:layout_alignParentRight=true android:focusable=false android:focusableInTouchMode=false TextView android:id=@+id/timer_text android:layout_width=fill_parent android:layout_height=fill_parent android:gravity=center android:textSize=15px android:textColor=#FF android:focusable=false android:focusableInTouchMode=false/ /RelativeLayout /FrameLayout On 3 фев, 08:06, satish bhoyar getsatonl...@gmail.com wrote: Thanks for the reply Nightwolf , But sorry i did not understood it.. please can u tell me clearly. thanks sat On Tue, Feb 2, 2010 at 11:28 AM, Nightwolf mikh...@gmail.com wrote: Try to place regular view on top of your GLSurfaceView and use TextView on this regular view. On 1 фев, 14:19, satish bhoyar getsatonl...@gmail.com wrote: Hi please tell me some thing about this problem... thanks On Fri, Jan 29, 2010 at 6:49 PM, satish bhoyar getsatonl...@gmail.com wrote: Hi all, I am developing the app where I want Text on GLSurfaceView. So I am using TextView on GLSurfaceView. I m able to do that properly. Now problem is I want to translate both this views (TextView GLSufaceView) to the position where i scroll. for this I am using the ViewGroup onTouch method of that i am doing it, but both doesnt seems moving together.TextView is faster than that of GLSurfaceView. I think the co-ordinate system of the ViewGroup that of the GLSurfaceView are different so it is calculation mistake but I am not sure. please help thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GLSurfaceView problem/querry
Try to place regular view on top of your GLSurfaceView and use TextView on this regular view. On 1 фев, 14:19, satish bhoyar getsatonl...@gmail.com wrote: Hi please tell me some thing about this problem... thanks On Fri, Jan 29, 2010 at 6:49 PM, satish bhoyar getsatonl...@gmail.comwrote: Hi all, I am developing the app where I want Text on GLSurfaceView. So I am using TextView on GLSurfaceView. I m able to do that properly. Now problem is I want to translate both this views (TextView GLSufaceView) to the position where i scroll. for this I am using the ViewGroup onTouch method of that i am doing it, but both doesnt seems moving together.TextView is faster than that of GLSurfaceView. I think the co-ordinate system of the ViewGroup that of the GLSurfaceView are different so it is calculation mistake but I am not sure. please help thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: glReadpixel call in open-gl
According to OpenGL ES spec: Only two combinations of format and type are accepted. The first is format RGBA and type UNSIGNED BYTE. The second is an implementation-chosen format. The values of format and type for this format may be determined by calling GetIntegerv with the symbolic constants IMPLEMENTATION COLOR READ FORMAT OES and IMPLEMENTATION COLOR READ TYPE OES, respectively. The second supported format for emulator and G1 is GL_RGB, GL_UNSIGNED_SHORT_5_6_5. And make sure you specify correct dimensions. On 23 дек, 19:04, yog usb...@gmail.com wrote: Hi all, Iam trying to read glReadpixel API to get frame buffers, when printed buffer in API Iam getting all 0's in my Emulator. Iam a new-bie to android and open-gl. can any one help me why this is happening? Iam using Android 2.0. Is there any opensource android APP using glReadPixel function. GLES10.glReadPixels(x, y, screenWidth, screenHeight,GLES10.GL_RGB, GLES10.GL_UNSIGNED_BYTE, pixel); 0 0 320 480 Thanks in advance, Yog. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: NDK all from within Eclipse
There is also useful video Using CDT for Android Native http://cdtdoug.blogspot.com/2009/09/using-cdt-for-android-native.html It would be great to know how to debug native code. On 16 дек, 06:26, datoudatou datouda...@gmail.com wrote: hi Robert Green, great thanks. i have tried your method, it really worked for me (slackware 12.1, android sdk-2.1 + ndk1.6 + eclipse galileo + cdt 6.0.1). now, i can declare that the method workes under win32 and linux dev env. yours waynechen 2009.12.16 Robert Green wrote: I was going to post this to the group but figured I'd write up a how- to on my website instead. Basically, here's how you configure Eclipse to do nice C/C++ editing and automatically build your native code for you on-save. It also automatically refreshes your lib directory and consequently ADT puts it straight into your APK. http://www.rbgrn.net/content/348-get-your-eclipse-integrated-ndk-on I'll post this to the NDK dev group as well. I can't believe I didn't set that up sooner. It cut my native development time in half. Let me know if you have problems/questions with it. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Lags during onTouchEvent on Motorola DROID
It seems that starting from android 1.6 there is no need in sleep workaround. Tried this on HTC G1. On 16 дек, 12:58, Mobile mstream2...@gmail.com wrote: I have several complaints from Moto DROID users who experience lags while touching. In my app I implement the recommended workaround with two threads and Thread.Sleep( 35 ) . It worked and works perfectly on my G1 and on some other Google devices. But for DROID I hear many complaints. As I don't have a DROID, could someone please tell me if there is still a need for this workaround? Or shall I have to do anything else? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to handle simultaneous key press
You should try it. At least combinations like w+a+space work. I haven't try with special keys though. My app that needs to handle multiple key presses has boolean array for each action (turn left or right, fire etc.). Corresponding array elements are set in onKeyDown and onKeyUp event handlers. On 14 дек, 09:50, onceaweek kyu@gmail.com wrote: I was wondering whether Androd can catch simultaneous Key Press. For example, a application does something when a user press HOME and MENU key simultaneously. Is it a possible scenario? Thank you in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: please help me with opengl exception.
It should be allocateDirect instead of allocate. On 14 дек, 02:22, billconan billco...@gmail.com wrote: hello guys, i'm trying to draw a very simple 2D triangle with opengl. but i have exception illegal parameters the problematic line is gl.glVertexPointer(3, GL11.GL_FLOAT, 0, mVertexBuffer); i'm new to android, my experience with it so far is so frustrating. i simply copied code from other examples. and it simply doesn't work. i'm pretty sure the mVertexBuffer is successfully initialized. because i can see the size of the buffer is 48 right before the execution of the problematic line with the debugger. and this size is correct. however it just doesn't work. i initialized the buffer this way: mVertexBuffer = ByteBuffer.allocate(12*4); mVertexBuffer.order(ByteOrder.nativeOrder()); mVertexBuffer.position(0); mVertexBuffer.putFloat(-1); mVertexBuffer.putFloat(-1); mVertexBuffer.putFloat(-1); mVertexBuffer.putFloat(1); mVertexBuffer.putFloat(1); mVertexBuffer.putFloat(1); mVertexBuffer.position(0); the code was actually copied from a opensource example. can somebody help me? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: background sound continuous
http://developer.android.com/reference/android/media/SoundPool.html Sounds can be looped by setting a non-zero loop value. A value of -1 causes the sound to loop forever. soundPool.play(soundPoolMap.get(sound), streamVolume, streamVolume, 1, -1, 1f); On 24 ноя, 17:35, Jags jag...@gmail.com wrote: I am using soundpool to use sounds in my app. One of the sounds i need to play continuously in background. any example how to do this ? soundPool.play(soundPoolMap.get(sound), streamVolume, streamVolume, 1, 0, 1f); regards -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: glCopyTexImage2D - Success anyone?
This might help http://www.anddev.org/how_to_get_opengl_screenshot__useful_programing_hint-t829.html On 22 ноя, 00:45, Ben Gotow bengo...@gmail.com wrote: Hey everyone, I'm porting an OpenGL app from the iPhone to Android, and I need to render OpenGL content to a texture. Since framebuffers are not available in OpenGL 1.0 and the DROID is the only Android phone to support the framebuffer extension, I'm trying to draw using OpenGL and then copy the result into a texture using glCopyTexImage2D. However, my initial findings are not good: 1. glCopyTexImage2D works in the Android emulator (OS v. 1.5), but only with GL10.GL_RGB, not GL_RGBA. If you try to copy the alpha data from the scene into the texture, you just get a completely white texture. 2. glCopyTexImage2D doesn't seem to work _at all_ on the Android G1. It does not throw an UnsupportedOperationException but after calling it, the texture is completely white. Has anyone successfully used glCopyTexImage2D on an actual device? If so, could you please post a bit of the code you're using? I suspect it works only with specific settings, if at all. Right now, I'm calling it like this: gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 0,0, 256, 256, 0); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Choosing Dev Phone
You need any SIM card with data access to pass initial screen (of course if your phone is unlocked and accept any SIM) . After that SIM card can be removed. On 19 ноя, 08:54, Nathan nathan.d.mel...@gmail.com wrote: Just to update everyone. In the absence of guidance on what will run 2.0, I decided against Dev 2 or the Droid. That means I'll probably end up getting something else later, but hopefully when there is more clarification or more choices. The multitouch, for one, is one that will be hard to test out without 2.0. I've found a used G1 that is one of many on a local craigslist. Now here is the question: Will I be able to get past the initial Google Account screen and use wifi to activate it? Or do I need to go into the TMobile store and sign up for some data plan for long enough to activate the phone? If I have to do that second option, I can - it'll just take some time away from programming. So far I can't get past that initial screen because my SIM card is not provisioned for data access - it is a prepaid minutes TMobile plan. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Displaying Text such as score in an OpenGL game
It's possible to have regular view on top of the GLSurfaceView and use TextView for text. On 17 ноя, 17:11, Kevin S. dada...@gmail.com wrote: It's not that bad, you can just copy the LabelMaker and NumericSprite classes and then call them in the same way that example does in the render. That's good news, I'll go down that path then. Thanks for the reply! -Kevin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android Market Anti-Piracy
Only 20% of all installs are legal, other 80% are in piracy hands. I believe that in case of perfect copy protection only few of that 80% would buy your app. On 16 ноя, 14:12, AlexK kucherenko.a...@gmail.com wrote: Our company starts today anti-piracy initiative against piracy that already happened on Android Market. We request all vendors and developers to support this initiative. Piracy become a threat for vendors that publishing application on Android Market! It is not a joke, it is a real threat. Our last application publishing shows how bad is situation on the Android Market. Only 20% of all installs are legal, other 80% are in piracy hands. Google does not provide any actions to stop piracy, so we as a vendor that provide software for Android Market, have to think about protection measures. Piracy is threat that cannot be target easily and eliminated in one day. Only join of all vendors can help in anti- piracy. ArtfulBits company decide to start from today Android Anti-piracy Movement with main goal: protect vendors and punish piracy. Our next steps are: - Petition to Google with request to provide better anti-piracy protocols for Android Market; - Collective anti-Google charge, from side of vendors that loose money due to Google security holes in Android Market application distribution channel; - Public web service Black List, that helps all developer to check is there application installed on pirate phone; - Joining of the software vendors over that problem for finding better anti-piracy strategies; - Identification of the roots of piracy, that make possible Android Market software leaking and contribution them to justice. A little later today we will open black-list database of devices, where was installed stolen version of applications. In addition, we will provide easy code for all developers that can be integrated into own application and during first start, check is phone in black list or not. Opened Anti-Piracy forum thread:http://www.artfulbits.com/Support Petition can be signed here:http://www.petitionspot.com/petitions/androidpiracy Stay tuned! Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Application design - using threads
Actually I don't understand the need to separate rendering and game logic threads. If game state isn't changed there is nothing new to draw. Why bother rendering the same frame several times? It makes sense if there are two game state sets. For ex. OpenGL thread renders current frame using current vertex buffer while game logic thread updates another vertex buffer with new data. On 12 ноя, 23:28, Lance Nanek lna...@gmail.com wrote: There's a good blog post on this issue re games here:http://replicaisland.blogspot.com/2009/10/rendering-with-two-threads I started doing game updates in a separate thread, instead of on the render thread, in an OpenGL game I've been writing recently as well. It did result in some improvement. I normally log frame rate stats every 300 calls to onDrawFrame. The longest time between calls, ignoring times when the garbage collector triggers, used to be ~100ms. Doing updates in a separate thread cut that measurement down by about 10-20ms. On Nov 12, 10:55 am, Neilz neilhorn...@googlemail.com wrote: Well yes, but that isn't quite the same thing, is it? In LunarLander the thread that does the drawing is also the thread that does the logic. I took this statement from the dev guide to mean that you have a separate thread for each. I suppose the best thing I can do is code and experiment and see if I get any improvements... On Nov 12, 2:58 pm, RichardC richard.crit...@googlemail.com wrote: There is a nice simple game example (with multiple threads) in the SDK samples called LunarLander -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Gaming on android - somewhat disappointing...
There is a problem with Garbage Collector. You should be really careful to avoid producing too much garbage. While your game itself doesn't invoke GC in several minutes other apps still do. So there will be slowdown. If it's a fast arcade game user may miss the bad guy or fall into pit and will be very upset. Using touch and trackball controls produces huge cpu load. Sleep workaround helps a little. Having real device is crucial to game development because you may choose wrong render path or algorithm implementation. Some things work faster on emulator and others on device. I'm curious to know how many full-time devs work on Android apps. Everyone I know have primary job and do android development in their free time. This may be one of the reasons why so many apps are unpolished. BTW I tried Donkey Kong and that was terrible. Sega emulator works better but still not good enough. Droid is definitely faster than G1. On 11 ноя, 17:49, Justin Giles jtgi...@gmail.com wrote: Just want to throw out a me too here. When I got my android phone not too long ago, I was also surprised at how unpolished a lot of the games were, especially the free ones. That is what inspired me to make my first game and try to make it both a) responsive and b) more polished than those that were out there. If we just put in the extra little effort in these two categories, the android marketplace will be a much more attractive and lucrative place to publish your applications. Thanks for the added insight niko! Justin On Wed, Nov 11, 2009 at 7:21 AM, niko20 nikolatesl...@yahoo.com wrote: Hi, This is just an observation I had yesterday. I go myself a DROID now, and last night I was pulling down several different games that have good ratings to try them out. I have to say, Im actually pretty disappointed right now, I know android should be able to perform better than this, although I will admit yes, its still quite new in the gaming department. I am not ranting or anything here. Yes I know that if I wanted a better game than I should code one, I'm just making an observation here. Please bear with me. Firstly, several of the games I downloaded were just slow, or laggy. Maybe its the touch screen input that messed with them I don't know. But I wouldn't consider them very fun because they didn't really feel responsive. I'm not sure I should name any games outright so I don't annoy their developers. But some had touch screen controls, which I found didn't seem to respond very well. Even some of the word games where you draw across the letters to make the word didn't really respond as nicely as they could have (IMO). Others worked ok except they would have frequent slowdowns if too much was going on the screen at once (to be expected). Others were sort of ugly, because they combined their own graphics with android's built in GUI graphics (note to game devs, you want a hit game? Write all the graphics yourself, even the menu screens, it just will look better) The main reason I post this is because as android devs, we really need to step up our game a bit here. Looking at a lot of these games, I see two main problems: 1. The were never tested on a real device. 2. They have not been optimized in any way that I can tell. Ok first problem I'm also guilty of, so I'll let it slide. Not everyone can afford a real device. But face it, that will be a roadblock to really making the game perform as well as it could. Maybe you could write the next hit without one, but I think your chances are a lot smaller, since you won't be able to test out the touch interface as well, etc. It does make a difference to try it on a real device, I learned that myself! Second problem: It's sad to me that the Super Nintendo Emulator loaded with a Metroid ROM performs awesomely, but yet no native android game comes even close to that performance (of games that I have tried), as far as speed, animation, and overall responsiveness. Now, I'm sure the devices we have are at least as fast as a super nintendo was, if not faster. And while I know we are programming in java, not in machine code, that Super Nintendo Emulator seems to work fine, so what are they doing behind the scenes to draw the screen?. So that means if you wrote a game to be optimized, wrote it as though it was on a lesser platform, it should run great on android. Maybe just use smaller images, and draw to a smaller bitmap in memory, and stretch it. Even if it looks a bit pixelized, if the game is fast and has good response, people will enjoy it. I know I actually like that pixelated look, it gives games that nice retro feel. For newer games OpenGL probably has to be used to make it fast enough. Also, as a side note, those old school nintendo games - Metroid for example, would take at least 8 hours or so to complete (maybe not if doing a speed run), and it was only around 8MB in
[android-developers] Re: How can i update ADC2 Round2 Application
Android Blog says about updating judging application. On 11 ноя, 19:31, cpick cp...@vmenu.com wrote: I was under the impression that after initial submission, ADC2 would not allow any updates to the apps. On Nov 11, 12:55 am, victor lind...@gmail.com wrote: i find my application is in ADC2 Round2 from Android Blog and the Blog suggest update application for Round2 ,but we can't find the update entrance i try to update fromhttp://market.android.com/adc,itonly show the application list but can't allow update ,how can i update ADC2 Round2 Application? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: SoundPool problem
It seems that SoundPool can't allocate more than 1 MB. SoundPool stores uncompressed audio. Does anyone know is it possible to control uncompressed audio characteristics? That would allow storing relatively lengthy sounds. On 10 ноя, 22:18, Nikolay Ananiev devuni...@gmail.com wrote: I had the same problem. All my sounds were in .mp3 and they didn't play in 2.0. I had to reencode them in .ogg and everything started working again. But then I had a problem with one of the longer sounds (7 secs). Only 6 seconds were loaded, because there was some stack overflow at the end of the loading. I had to remove the stereo and encode it as a mono. It worked well. On Tue, Nov 10, 2009 at 6:17 PM, ayanir ayanir...@gmail.com wrote: Hello, I'm using a SoundPool for playing my game sound effects. It all worked fine until I checked it on the new SDK 2.0. the sounds are not played and I'm getting in my log: SoundPool Sample channel count (0) out of range right after the playerPool.load (see the code). does any one encountered with this problem? here is my code: package j2ab.android.rpcapp.utils; import android.content.Context; import android.media.AudioManager; import android.media.SoundPool; import j2ab.android.rpcapp.R; public class SoundManager { private static boolean isSoundEnabled = true; private static final int[] PLAYERS_RES_IDS = {R.raw.snd1, R.raw.snd2,R.raw.snd3}; /** * Player priority in case of ONE_PLAYER. the highest priority is 0. */ private static final int[] PLAYERS_PRIORITY = {1, 1, 1}; private int[] idToStream; private SoundPool playerPool; public SoundManager(Context context, int maxStreams) { playerPool = new SoundPool(maxStreams, AudioManager.STREAM_MUSIC, 0); idToStream = new int[PLAYERS_RES_IDS.length]; for (int i = 0; i idToStream.length; i++){ idToStream[i] = playerPool.load(context, PLAYERS_RES_IDS[i], PLAYERS_PRIORITY[i]); } } public int play(int playerId, boolean interrupt) { if(isSoundEnabled){ int status = playerPool.play(idToStream[playerId], 0.99f, 0.99f, 0, 0, 1); if(status == 0) MyLog.printLog(, cant play a sound + playerId); return status; } return 0; } public void stopPlayer(int playerId, boolean resetMediaTime) { if(resetMediaTime){ playerPool.stop(idToStream[playerId]); } else{ playerPool.pause(idToStream[playerId]); } } public void onDispose() { playerPool.release(); } } BTW the emulator managed to play sound using MediaPlayer, but I don't want to use a low level sound management. Tanks Yanir -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Unable to install the app on emulator, I am getting Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
What's about your apk size? Did you try to uninstall app? On 11 ноя, 02:16, Shani shanithemon...@gmail.com wrote: did you ever figure this out? im having the same issue. On Oct 19, 2:35 am, manoj manojkumar.m...@gmail.com wrote: Hi all, I am trying to install an app on emulator. I am getting this error: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE At very first time it worked well, and tried to install again from the eclipse. I dont know why I am getting this. Can any one help to get rid of this? Thanks, Manoj. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Please help me to choose Android Phones (For Android development)
What's wrong with Samsung Galaxy in terms of 3D? On 10 ноя, 08:17, SoftwareForMe.com SoftwareForMe.com softwareforme@gmail.com wrote: Personally, I find all Android phones to be excellent for development. However, here are some things I would consider before deciding. Let's consider these devices: HTC G1 HTC Magic HTC MyTouch HTC Hero HTC Eris Samsung Galaxy Samsung Moment Motorola Cliq Motorola Droid Given the choice of a device with or without a keyboard, I'd choose one with a keyboard. You can use the soft keyboard on a device with a hard keyboard, but not vice versa. This leave us with: HTC G1 Samsung Moment Motorola Cliq Motorola Droid Next, I would make Android 2.0 a priority. The Multi-touch API, Bluetooth API and others are key to the near-term feature of mobile development. Nobody seems to know for sure, but it's unlikely the G1 will get 2.0, so I would probably not consider it unless you hear differently. Next, 3D UIs are getting more important, so I'd want a phone that has decent accelerated 3D hardware. This eliminates the Samsung Galaxy, but leaves all others. Last there is screen size. Most smartphones are HVGA now (320x480), but WVGA (800 or 854 x 480) will be the standard soon. So, the best choice depends on what you want to do. If you only want to cover the basics and don't mind skipping a few capabilities or API's, then the cheapest or most rugged might be the best choice. If you want the best device to prepare students for all aspects of Android and mobile development, there's really no choice but the Motorola Droid, because of it's: * WVGA screen * Terrific hardware accelerated OpenGL * Android 2.0 * Hardware keyboard * Full set of sensors (has a proximity sensor) I hope this helps. Scott, SoftwareForMe.com On Mon, Nov 9, 2009 at 5:31 PM, Ash ashwin.disco...@gmail.com wrote: I'm new to android development. We need to buy around 20 phones for android development for our university. Please share your views and comments on the phone you think is good for Android development. Thank You -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Warm regards, The PhoneMyPC Team -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: C++ Shared Library
Do you use exactly this code? There should be two underscore symbols. #ifdef __cplusplus extern C { #endif On 4 ноя, 13:47, zenoname zenonamem...@gmail.com wrote: Hello, I'm trying to create a simple project with the Android NDK. I created a jni library which is calling a function from a shared C* library. I make it work with a C library but as soon as I try with a C++ library it crashes (when calling the c++ function) As many posts I read I suspect a name mangling problem but whatever I tried it doesn't change the problem Here is a summary of what I've done : I created a jni library linking two simple libs (jnilib my jni interface with java, libtoto.so my c library, libtotocpp.so my cpp lib). The c* libs simply export a function returning a int. If I call GetNumber() form the C lib no problem. If I call the GetNumberCPP() from my C++ lib it crashes Here are the code and compilation stuffs. If anyone could tell me what's wrong that would be very very cool :) Thanks. - jnilib.c (arm-eabi-gcc -shared jnilib.c -o libjnilib.so libtoto.so libtotocpp.so -nostdlib -Bdynamic) Here if I don't call GetNumberCPP() all works #include toto.h #include toto.hpp #ifdef _cplusplus extern C { #endif jstring Java_amob_jnscapi_jnscapi_initserver (JNIEnv* env, jobject thiz ) { char version[50]; sprintf(version,%d %d,GetNumberC(),GetNumberCPP()); return (*env)-NewStringUTF(env, version); } #ifdef _cplusplus } - libtoto.so (arm-eabi-gcc -shared toto.c -o libtoto.so -nostdlib - Bdynamic) #include toto.h int GetNumberC() { return 33; } - libtotocpp.so (arm-eabi-g++ -shared toto.cpp -o libtotocpp.so - nostdlib -Bdynamic) #include toto.hpp #ifdef _cplusplus extern C { #endif int GetNumberCPP() { return 56; } #ifdef _cplusplus } #endif - In my java class I tried to load all libs ... System.loadLibrary(totocpp); System.loadLibrary(toto); System.loadLibrary(jnilib); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android heap limit and resources
You should try writing some test application with SoundPool. It's possible that you'll run out of memory sooner than you expect. It seems that SoundPool can't allocate more than 1 MB and uncompressed audio reaches this limit pretty quick. On 2 ноя, 17:09, renato.grottesi renato.grott...@gmail.com wrote: I'm an Android game developer and I need to ask you a couple of questions about Android heap limit. Does the 16 MB heap limitation also applies to OpenGL ES textures or SoundPool sound effects? Since they are managed by native code, is it correct to affirm that there is no problem in using more than 16 MB of RAM in app/game resources/assets? If it is possible right now, it is guarantee to be possible in the future? Thank you in advance for your reply, Renato. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ADC 2 rating
I have no such statistics. According to Google blog the target was about 100 ratings per application. On Oct 26, 11:36 am, Omer Saatcioglu osaatcio...@gmail.com wrote: Hi, I submitted an app to ADC 2 and I had the chance to track user statistics over my server. As I observed that only 125 users used my app during the first round. This seemed to me a very low rate. What do you think? Does anybody has an statistic like this? Best Regards, Omer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Paint onTouch
Try adding invalidate() in your translate() method instead of this.draw(_myCanvas);. On Oct 25, 2:37 pm, stephane.cast...@gmail.com stephane.cast...@gmail.com wrote: Hi! I have a problem with one of my app. I try to make a paint application but nothing is draw on the screen (except the first circle which is draw on the launch). The log Cat seems to be correct and i get the right x/y coordinates. I think i do something wrong on the ondraw. do you see my problem? Thanks. this is my code : public class Main extends Activity { /** Called when the activity is first created. */ private TableLayout myView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.i(onCreate, Start); setContentView(R.layout.main); myView= (TableLayout)findViewById(R.id.TableLayout01); myView.addView(new PaintView(this)); } } public class PaintView extends View implements OnTouchListener { private float _x, _y; private int _taille; private Canvas _myCanvas; private Paint _paint = new Paint(Paint.ANTI_ALIAS_FLAG); public PaintView(Context context){ super(context); Log.i(Info, _paintview Constructor 1); //this.setFocusableInTouchMode(true); _x=20; _y=20; _taille = 10; _paint.setColor(Color.RED); } public PaintView(Context parent, float x, float y, int i) { super(parent); Log.i(Info, _paintview Constructor); _x=x; _y=y; _taille = i; _paint.setColor(Color.RED); } @Override protected void onDraw(Canvas canvas) { Log.i(Info ,onDraw start); try{ // make the entire canvas white canvas.drawColor(Color.WHITE); canvas.drawCircle(_x, _y, _taille, _paint); super.onDraw(canvas); Log.i(Info ,x=+_x+ y=+_y); _myCanvas=canvas; } catch(Exception e) { Log.i(ERROR, onDraw : + e.getMessage()); } } public void translate(float x, float y){ try{ _x=x; _y=y; this.draw(_myCanvas); } catch (Exception e){ Log.i(ERROR, +e.getMessage()); } } @Override public boolean onTouchEvent(MotionEvent evt){ translate(evt.getX(), evt.getY()); return true; } @Override public boolean onTouch(View v, MotionEvent evt) { translate(evt.getX(), evt.getY()); return false; } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Is it possible to access raw data of a bitmap (in order to try fade/blur effect)?
I want to try some fade/blur effect like in winamp visualization plug- ins. getPixel/setPixel way is very slow and do not allow to achieve decent frame rate. Direct access to pixels array could speed up processing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Is it possible to access raw data of a bitmap (in order to try fade/blur effect)?
Thank you Jason. I was hoping it's possible with Java. Do you use Direct Buffers to pass data from Java to C? image.getPixels() probably creates a copy of actual image. And it also seems as an area for improvements. On Oct 21, 9:49 pm, Jason Proctor jason.android.li...@gmail.com wrote: i implemented some full-screen fades and blurs for a recent project. doing it in Java resulted in, er, suboptimal performance, so i went native. i passed the results of image.getPixels() to the native function and did the transforms there. on the G1 and ADP, the performance was OK. I want to try some fade/blur effect like in winamp visualization plug- ins. getPixel/setPixel way is very slow and do not allow to achieve decent frame rate. Direct access to pixels array could speed up processing. -- jason.vp.engineering.particle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Keep pressing screen slow down the app very much
Try this solution public boolean onTouchEvent(final MotionEvent event) { try { Thread.sleep(50); } catch (final InterruptedException e) { } return super.onTouchEvent(event); } On Oct 19, 7:00 am, Eric Wang eric.wan...@gmail.com wrote: Hi all, I found that if I keep pressing the touch screen, the app will slow down very much. Both happened in my code and the sample app. The same issue happened to me on Windows Mobile, but not happened on Symbian. Anybody have some clew to fix it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android Sim Card Needed?
You need a SIM card with data plan in order to tie your G1 to your Google account. After that you can use your G1 without SIM card. On Oct 3, 1:36 am, Thomas tbirchm...@usa.net wrote: I bought a used T-mobile G1 without a sim card for internet development. For my purposes the wi-fi should provide enough internet capacity for testing as I don't care making phone calls or internet connection via cell service. Like duh on my part, the G1 will not go past the first menu to the apps screen without the sim card. Any suggestions? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: 3D Primitives in opengl ES (sphere)
Take a look at demo apps from SDK. Some of them draw a cube. You need to do similar thing to display a sphere. AFAIK there is no way to draw 3D sphere using some single command. You need to generate vertices, put them in vertex buffer and call DrawArrays or DrawElements function. On Sep 25, 5:14 pm, androidDeveloper stepmas...@googlemail.com wrote: Anyone know how to draw a 3D-sphere with OpenGL ES in android? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: drawing image in full screen on different device
Image view with layout_width and layout_height set to fill_parent should help. On Sep 3, 1:14 pm, Honest honestsucc...@gmail.com wrote: Hello, My application required to draw image on full screen. now the phone screen size will be different. So will i have to make different image for each phone or i can use just one image and it can display on full screen in any device. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Graphics
Take a look at the examples from Android SDK - JetBoy, LunarLander, Snake and APIDemos of course. On Sep 2, 5:49 pm, Naresh Kumar naresh.andro...@gmail.com wrote: thank u sir On Wed, Sep 2, 2009 at 4:42 AM, Yusuf Saib (T-Mobile USA) yusuf.s...@t-mobile.com wrote: Hello, there are several ways to do graphics in Android, but for starters I suggest you look at the Canvas class. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Sep 1, 5:30 am, Naresh naresh.andro...@gmail.com wrote: Hai Friends i am new to android i want to do some programs using graphics can anyone send me sample programs about graphics package --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SurfaceView to slow for games? OpenGL necessary to do games?
Another solution is to display regular view on top of the 3D view. On Sep 2, 8:14 am, Robert Green rbgrn@gmail.com wrote: Light Racer 3D uses dynamic text by drawing to a HUD canvas and then uploading that texture for each update. It did work to upload the new texture every frame (score changing every tick) but it did have a slight impact on performance. I ended up just updating every 10 frames. For my next game I'm going to add a utility that uploads an alphanumeric texture and stores letter sizes and coords, then draws a quad for each, like was suggested above. It takes a little longer to build that but once you've got it, it will be the fastest solution for really dynamic stuff like scores that change very often or timers that count down with 100ths of a second or something like that. On Sep 1, 9:51 pm, David Minor davemi...@gmail.com wrote: I believe you can also draw text on a Canvas, and then use the underlying bitmap to create a texture. On Sep 1, 4:21 pm, Dan Sherman impact...@gmail.com wrote: Yeah, that's what we were looking into doing. Was just hoping that there might be a nice framework I missed somehow :) Thanks man :) On Tue, Sep 1, 2009 at 3:10 PM, Phred phr...@gmail.com wrote: Dan,I've yet to start messing with GL ES so this is coming from Direct3D experience but the idea is the same. What you can do is create a texture with all the letters of the alphabet, numbers 0-9 and symbols. There are apps out there that will create such a texture and an XML file that contains the texture co- ords for each letter/number/symbol. This one would work as it exports in PNG format which Android supports: http://www.angelcode.com/products/bmfont/ To draw the text you have render 1 quad for each alpha-numeric character being drawn at the location on screen you want it drawn too. So if your text is Hello then you will have to render 5 quads. Each quad will contain the texture co-ords of the corresponding alpha- numeric character in the texture. I would create a vertex buffer object at start-up and make it large enough to hold 256 characters. Your draw text function would then fill out this buffer each frame update with the updated text location co- ordinates then all you have to do is get OpenGL to render it. You will want it rendered in orthographic projection mode and using screen space co-ordinates... that is you don't want OpenGL to transform or light those verticies for you. Again not sure of the GLES pipeline as all my experience is Direct3D. Make sense kinda kinda? Fred On Aug 24, 3:27 pm, Dan Sherman impact...@gmail.com wrote: We're having the same issues in some of our games. Unfortunately running into issues drawing dynamic text in OpenGL, any chance you'd care to share your solution for that? (if you have one that is) - Dan On Mon, Aug 24, 2009 at 2:39 PM, TjerkW tje...@gmail.com wrote: The SpriteMethodTest application shows the benefits of opengl, the main benefit is: If you have a lot of sprites / a lot of things happening at the same time it is better to use opengl. I am porting my game to opengl now. It was too slow on only the Canvas (30+ things moving at the same time) On 22 jul, 12:45, MrChaz mrchazmob...@googlemail.com wrote: The SurfaceView is fine for games, at least simple ones. Have a look at the LunarLander sample. http://developer.android.com/guide/samples/LunarLander/index.html On Jul 21, 9:33 pm, klirr haskell...@gmail.com wrote: I use SurfaceView for my game, tried normal View first but that was to slow. Problem is, it still is. The redrawing just isn't anywhere fast enough for a game. So unless it is a lot faster on the real phone this won't cut it at all. Is it necessary to use OpenGL for games? package com.android.shmup; import android.app.Activity; import android.content.Context; import android.graphics.*; import android.os.Bundle; import android.view.View; import android.view.KeyEvent; public class Shmup extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new GameView(this)); } private static class GameView extends View { private Paint mPaint = new Paint(); private int x; private int y; public GameView(Context context) { super(context); x = 135; y = 303; setFocusable(true); requestFocus(); } @Override
[android-developers] Re: glGenTextures returning 0
I don't know why you are getting 0. But onSurfaceChanged is good place to create textures. Placing texture creation/loading code inside of onDrawFrame is bad idea. On Aug 30, 12:24 pm, deki dcec...@gmail.com wrote: I am calling glGenTextures inside onDrawFrame and I am always getting 0. Calling glGenTextures in onSurfaceCreated works fine. What's the problem? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: OpenGL - Threading Texture Loading
If the problem is with glGenTextures then why not to generate texture ids pool beforehand? On Aug 27, 8:59 am, Dan Sherman impact...@gmail.com wrote: I'm converting an app I've written from Canvas to OpenGL, and not having too hard of a time yet. However, I've run into one snag that I can't seem to get around. My old app was threading image loads, because there are a ton of them, however, it looks like the OpenGL implementation protects itself to a single thread. I have a basic loadBitmap() function as follows: protected static void loadBitmap(GLSprite sprite, int resourceId) { int textureName = -1; if (mContext != null mGl != null) { mGl.glGenTextures(1, mTextureNameWorkspace, 0); textureName = mTextureNameWorkspace[0]; mGl.glBindTexture(GL10.GL_TEXTURE_2D, textureName); mGl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); mGl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); mGl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); mGl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); mGl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE); Bitmap bitmap = BitmapFactory.decodeResource(r, resourceId); GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); mCropWorkspace[0] = 0; mCropWorkspace[1] = bitmap.getHeight(); mCropWorkspace[2] = bitmap.getWidth(); mCropWorkspace[3] = -bitmap.getHeight(); sprite.setTextureName(textureName); sprite.setSize(bitmap.getWidth(), bitmap.getHeight()); bitmap.recycle(); ((GL11) mGl).glTexParameteriv(GL10.GL_TEXTURE_2D, GL11Ext.GL_TEXTURE_CROP_RECT_OES, mCropWorkspace, 0); int error = mGl.glGetError(); if (error != GL10.GL_NO_ERROR) { // Logging } } This is based heavily off of the SpriteMethodTest in apps-for-android. If I make a call to this function from the thread that mGl was created from, everything goes fine. However, if I thread the calls to this function, the calls to glGenTextures() fail with a varying error code (changes with each run). I haven't been able to find any information regarding how to deal with this... Any help? Thanks - Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SurfaceView behavior - what gives?
You should redraw the whole canvas. It's possible to lock only part of the canvas though. SurfaceView is intended for game applications that refresh their screen very often. On Aug 10, 7:59 am, SChaser crotalistig...@gmail.com wrote: I wrote a little test program that has a custom SurfaceView class and some buttons to let me cause various operations on them (draw bitmap over all of it - white or black, draw a circle on it, draw blue bitmap and circle). In each case, the drawing is done on a canvas obtained with getHolder.lockCanvas(). If I draw the white background in one op, then draw the red circle, the background vanishes. If I draw the red circle again, the white background re-appears behind it. Other operations have similar results - it's as if there is a toggle on the background pixels (those untouched by the circle drawing) - draw the circle once - get one background, draw it again, get another. Obviously I don't understand the semantics of SurfaceView. Any pointers? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: OpenGL leaking garbage
I think things aren't that bad. Take a look at Armadillo Roll. Checking DDMS showed that GC was't invoked during watching demo flyby and playing the game for 3-4 minutes. On Jul 29, 12:57 pm, Paul Thomas dr.paul.thomas.android.st...@googlemail.com wrote: Thanks for your helpful comments, everybody. 2009/7/28 smartpixgames smartpix.ga...@gmail.com: In general, it's very frustrating that we have a good hardware useful for gaming, but a bad realization of very critical things for 3D-gaming and now it's almost impossible to develop quality 3D-games for Android... Yes, agree completely. The hardware is quite fast, and we want to encourage everybody to program in Java for cross-platform compatibility. I think there needs to be a fast rendering path on OpenGL ES 1.0 without needing extensions as support for 1.1 is not guaranteed. Seems clear that gl.glVertexPointer / gl.glDrawElements must be fast as this is the obvious combination that anybody will try first. Could somebody at Google bump the priority of this a bit? It looks as though that patch might still need work according to the code reviews. Thanks Paul. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SurfaceView speed optimization suggestions (or just kick it up to openGL)?
You mentioned onFling. Do you use touch controls? May be you should employ workaround with calling sleep because without that touch and trackball events create huge cpu load. On Jul 23, 11:26 pm, Jason Van Anden jason.van.an...@gmail.com wrote: It is not b/c of the GC. Garbage does accumulate ... but I am triggering the GC to clear after the easing finishes. Jason On Thu, Jul 23, 2009 at 2:58 PM, MrChaz mrchazmob...@googlemail.com wrote: Are your hiccups being caused by the GC firing? A quick look at Logcat should tell you if it is. On Jul 23, 2:16 pm, Jason Van Anden jason.van.an...@gmail.com wrote: I am trying to optimize my graphics app. I have read the best practices and have employed these and they have helped but, I am still getting hiccups. I get the hiccups when more of the screen is drawn upon. I am looking for either strategies on how to speed things up or a convincing that employing openGL is the best solution. My app draws graphics directly on a SurfaceView. My workspace is larger than the screen. I am using translate. My draw loop determines time passed between draws and adjusts update calls accordingly. More updates are required in subsequent passes when more of the screen area is drawn upon (in other words, a big circle the diameter of the screen width will take longer than a small circle 1/10 of the screen width). It seems to me that the graphics processor is the bottleneck (no?). I have an easing routine when the app scrolls (triggered via onFling ... kind of like the way lists work but in 2D). This speed issue is most visually apparent here. If openGL is the solution, I can put this aside for now and upgrade later when I have time to ramp up on openGL. If there are other solutions, I would like to hear them. One thought I have is to draw to a bitmap before engaging my scrolling/easing and move the bitmap instead of adjusting the graphics. Feedback super appreciated. Thank You, Jason Van Andenhttp://www.smileproject.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Drawing a dotted line
Everything you need is in PathEffects.java of API Demos. mPaint.setPathEffect( new DashPathEffect(new float[] { 15, 5, 8, 5 }, phase) ); On Jul 18, 3:00 pm, karthikr karthik.scintill...@gmail.com wrote: I had a look at the demos but i am not able to find out as to how to draw a dotted rectangle. Can someone help me out with some example? On Jul 17, 8:57 pm, Peli peli0...@googlemail.com wrote: Have you looked into the API demos? There are a couple of examples of lines with various patterns. Peliwww.openintents.org On Jul 17, 5:49 pm, karthikr karthik.scintill...@gmail.com wrote: Hi Guys, How do i draw a dotted rectangle on a bitmape. Currently i use the following code, to draw a rectangle, but i want the line to be a dotted one. Can someone help me out... Paint mPaint = new Paint(); mPath.addRect(left, top, right, bottom, Direction.CCW); mPaint.setAntiAlias(true); mPaint.setDither(true); mPaint.setColor(Color.GRAY); mPaint.setStrokeWidth(1); mCanvas.drawPath(mPath, mPaint); Regards, R.Karthik- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How can I create this type of Rectangle??
One solution is to create a path and add lines to it to form a rectangle you need. Another way is to rotate canvas itself. On Jul 25, 1:44 pm, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: by a diagonal rectangle, do u mean a parallelogram? On Sat, Jul 25, 2009 at 12:40 PM, sagar.indianic sagar.india...@gmail.comwrote: Hi all, I have got a problem. How can i create the following rectangle by using Rect class?? __ __ __ __ I mean Diagonal Rectangle. Is it possible through Rect class?? if not then any other way?? plz help..its urgent!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Mipmap Generation
In texture loading function please try the following gl.glGenTextures(1, texID, 0); gl.glBindTexture(GL10.GL_TEXTURE_2D, texID[0]); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR_MIPMAP_LINEAR); On Jul 15, 12:08 am, Mike mmille...@gmail.com wrote: Well I've come up with a solution, but I'd still like to hear from others if you have a better way of doing it. private int loadTexture(GL10 gl, Bitmap bmp) { int level = 0; int size = bmp.getHeight(); int[] textures = new int[1]; gl.glGenTextures(1, textures, 0); int textureId = textures[0]; gl.glBindTexture(GL10.GL_TEXTURE_2D, textureId); while(size = 1) { GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bmp, 0); if(size == 1) break; level++; size /= 2; Bitmap bmp2 = Bitmap.createScaledBitmap(bmp, size, size, true); bmp.recycle(); bmp = bmp2; } return textureId; } On Jul 14, 9:20 am, Mike mmille...@gmail.com wrote: I've created a simple heightmap renderer for Android, and am at the point where I'd like to apply textures to the terrain. I've had success with applying a simple texture but there is an unbearable amount of texture aliasing visible, I guess because there are no mipmaps for the texture. I could not find any way of automatically generating mipmaps as all the usual OpenGL methods seem to be unsupported. Have any of you figured out how to generate mipmaps on Android? Do we need to write our own implementation to to it? Thanks, Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Why is my animation leaving a trail?
Do you have sample project to reproduce issue or may be screenshot with a trail? On Jun 19, 3:41 am, HeyChinaski tompo...@googlemail.com wrote: I'm animating a an ImageView from the right to the left of the screen using a translate animation. The ImageView is place inside a RelativeLayout over the top of my main layout using FrameLayout. When I run the animation on the emulator everything works pretty well but when I use run it on my G1 it leaves visual artifacts behind and effects the rendering of the text component behind it. Is this a performance issue and I'm being too ambitious or is it a bug I can overcome? If it is a performance issue is there anything I can do to improve things? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Where to put local file on the phone
If you only need to assign some background to you ImageView you should use resources instead. http://developer.android.com/guide/topics/resources/resources-i18n.html On Jul 2, 1:02 pm, qLabs quentin.font...@gmail.com wrote: okey so i found a solution here is it is = SharedData.context.getAssets().open(myFile); Bitmap bitmap=BitmapFactory.decodeStream(is); and after that i set my ImaveView sith setImageBitmap(bitmap). thanks u alot nightwolf Cheers On Jul 2, 10:28 am, qLabs quentin.font...@gmail.com wrote: First, thanks for replying. So since my asset directory did'nt exist, i created it and i placed 4 folders in it, each one containing files. My goal is to set up image (the contained files) on ImageView object from a xml parser. So with the InputStream i don't know how to use it, i mean the only methods ive got from an ImageView are setImageDrawable(from ressources) or setImagebitmap... I might be dump but i have no clue how to use this InputStream for setup image to my ImageViews. Cheers On Jul 2, 6:39 am, Nightwolf mikh...@gmail.com wrote: It's possible to store files to assets directory of your Android project and access them like this final InputStream is = context.getAssets().open(myfile.txt); Asset files like resource files are included into application package and you only need to install apk as usual. For other approaches please check MediaPlayerDemo from APIDemos. Confusing moment (for me) is that path to sd card should be started with /sdcard/ (sorry, don't remember which slash is correct). And remember that file name is case sensitive. On Jul 1, 4:43 pm, qLabs quentin.font...@gmail.com wrote: Hello, Im trying to read some local files, and ive been reading a lot of stuff about it, but i still don't know where to store the files on my phone and how to get the right path. Some say, it should be stored on /data/data/your.package.here/files but where is that, i mean i can get there when using the emulator but i have no clue how to put files in this on a real device. Cheers, qLabs --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Where to put local file on the phone
It's possible to store files to assets directory of your Android project and access them like this final InputStream is = context.getAssets().open(myfile.txt); Asset files like resource files are included into application package and you only need to install apk as usual. For other approaches please check MediaPlayerDemo from APIDemos. Confusing moment (for me) is that path to sd card should be started with /sdcard/ (sorry, don't remember which slash is correct). And remember that file name is case sensitive. On Jul 1, 4:43 pm, qLabs quentin.font...@gmail.com wrote: Hello, Im trying to read some local files, and ive been reading a lot of stuff about it, but i still don't know where to store the files on my phone and how to get the right path. Some say, it should be stored on /data/data/your.package.here/files but where is that, i mean i can get there when using the emulator but i have no clue how to put files in this on a real device. Cheers, qLabs --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: weird drawing on bitmap to canvas
Try using the following: Rect bounds = new Rect(); mFontPaint.getTextBounds(mText, 0, mText.length(), bounds); mCanvasBitmap.drawText(mText, 0, bounds.height(), mFontPaint); On Jun 25, 1:20 am, sleith raysle...@gmail.com wrote: thx for reply did u mean font's paint? i believe it's not that the font is cannot be drawn. i think it's the position of the position 0,0 of the bitmap is not really 0,0 (it's out of bounds) because when i move the position of bitmap (bitmap.translate) with some x and y, i could see the text and text background is drawn. On Jun 24, 11:22 pm, MrChaz mrchazmob...@googlemail.com wrote: setTextSize() and setStyle() need to be called on the Paint object I think. On Jun 23, 4:37 pm, sleith raysle...@gmail.com wrote: hi, i'm trying to draw bitmap in canvas. the bitmap is used to draw text and background using canvas (named canvasBitmap) but the text or background that are drown to bitmap is not displayed, as if it's out of bounds. i have to translate the canvasBitmap at some points to make it draw at right position. The problem is i don't know how many pixel i should translate to. here's the code example: public OnDraw(Canvas c){ Paint mBackgroundPaint = new Paint(); mBackgroundPaint.setColor(Color.RED); String mText = Testing; Paint mFontPaint = new Paint(); mFontPaint.setColor(Color.WHITE); //setting rect Rect mBackgroundRect = new Rect(); mFontPaint.getTextBounds(mText, 0, mText.length(), mBackgroundRect); //the bitmap to be drawn a text and backgroundRect Bitmap mBitmap = Bitmap.createBitmap(mBackgroundRect.width(), mBackgroundRect.height(), Bitmap.Config.ARGB_); Canvas mCanvasBitmap = new Canvas(mBitmap); //draw text and background to bitmap mCanvasBitmap.drawColor(Color.CYAN); mCanvasBitmap.drawRect(mBackgroundRect, mBackgroundPaint); mCanvasBitmap.drawText(mText, 0, 0, mFontPaint); //draw bitmap to canvas c.drawBitmap(mBitmap, 0, 0, null); } this will only drawn Cyan color, the text and red background is not displayed i have to translate for example : mCanvasBitmap.translate(0, mBackgroundRect.height()) to make it displayed (but not 100% correctly position) please help . thx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: vertice coodinates of Kube
It seems that you already know more than me on this subject. May be there is a sense to use simple approach. Treat cube as a circle and test whether touch point is in that circle or not. Of course it's less accurate and you need to define cube center somehow. On Jun 18, 12:21 pm, quill quill...@163.com wrote: Thank you Nightwolf. I want to choose the Kube when I touch on the Kube face in order to rotate Kube. My idea is: 1. to get vertices of Kube to compose a polygon(2D); 2. judge if the touch point locates in the polygon; As you said, the cube coordinates is not modified, so I use gluunproject() to change touch point coordinates(x, y, 0) in order to map window coordinates to object coordinates, and then I judged if the new touch point coordinates locates in the polygon. Am I on the right way? On Jun 18, 11:59 am, Nightwolf mikh...@gmail.com wrote: Cube coordinates are stored in vertices array in Cube.java. Rotating effect is achieved via model view matrix modification (glTranslate and glRotate commands). Original vertex data isn't modified. On Jun 17, 8:30 pm, quill quill...@163.com wrote: Hi all, I'm modifying Kube(api demo) to a game, does anyone who know how to get the vertice coodinates of Kube? From the source code in api demo, I think GLWorld.mVertexBuffer may save the vertice coodinates after rotate the Kube, but I was wrong, the infomation in mVertexBuffer always remains the same.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: vertice coodinates of Kube
Cube coordinates are stored in vertices array in Cube.java. Rotating effect is achieved via model view matrix modification (glTranslate and glRotate commands). Original vertex data isn't modified. On Jun 17, 8:30 pm, quill quill...@163.com wrote: Hi all, I'm modifying Kube(api demo) to a game, does anyone who know how to get the vertice coodinates of Kube? From the source code in api demo, I think GLWorld.mVertexBuffer may save the vertice coodinates after rotate the Kube, but I was wrong, the infomation in mVertexBuffer always remains the same. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: 2D Double Buffering in Android 1.5 (with Canvas?)
It's possible that the flickering you see is caused by slow lcd display. For example patterns from API demos looks really ugly in motion because of that. On Jun 11, 7:26 pm, Avatar Ng ngchee...@gmail.com wrote: By the way ... here's my working project (yes not tune yet, very slow even my demo). Any criticism or ideas were welcome ... http://hexagonm.blogspot.com/ Will try to post some of my game story and idea until I have the time ... I had these whole thing sketch down long before Android arrived ... It's time to bring it live now XD Regards, Avatar Ng --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to draw a circle ?
Try using something like this: package game.balance; import android.app.Activity; import android.os.Bundle; public class Balance extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new Ball(this, 10, 10, 30)); } } package game.balance; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.view.View; public class Ball extends View { private final float x; private final float y; private final int r; private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); public Ball(Context context, float x, float y, int r) { super(context); mPaint.setColor(0x); this.x = x; this.y = y; this.r = r; } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawCircle(x, y, r, mPaint); } } On Jun 9, 7:24 pm, patpat patrickzheng1...@hotmail.com wrote: I am new and here is my code.. when i ran it ...there was nothing...i expected there should be a circle appear.. can anyone tell me why?? package game.balance; import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup.LayoutParams; import android.widget.LinearLayout; public class theGame extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout mLinearLayout = new LinearLayout(this); Ball mBall = new Ball(this,10,10,30); setContentView(mLinearLayout); } } package game.balance; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.view.View; public class Ball extends View{ public Ball(Context context,float x,float y,int r) { super(context); // TODO Auto-generated constructor stub Paint mPaint = new Paint(); mPaint.setColor(0xFF); Canvas mCanvas = new Canvas(); mCanvas.drawCircle(x,y,r,mPaint); } } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---