[android-developers] Re: 3D game engine integration in the android framework

2012-11-10 Thread sebastian_bugiu
Unity is good but it's not free.

On Saturday, November 10, 2012 4:00:33 PM UTC+2, Diogo Henrique wrote:

 I'd use http://unity3d.com/




 Em sexta-feira, 9 de novembro de 2012 14h57min37s UTC-2, sebastian_bugiu 
 escreveu:

 I have created a 3D game engine written in java for Android. It is based 
 on the Ogre renderer and features 

 - a complete OpenGL ES 2.0 multithreaded renderer 
 - sound support
 - input as touch or sensors
 - GUI API
 - easy material creation
 - a new mesh format for fast loading based on ms3d format
 - artemis framework integration for data driven game design
 - easy to use and extensible design

 A game that will feature this engine will be released somewhere at the 
 end of this month or somewhere early in December to show off the engine 
 capabilities.

 From what I have seen the Android framework does not feature an API for 
 game programmers so everyone has to create their own engine. Instead of 
 this duplication I am asking the android developers if it could be possible 
 to integrate my engine (I will open source the code) in the android 
 framework so that everybody can have an easier way to create a 3D game?




-- 
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] 3D game engine integration in the android framework

2012-11-09 Thread sebastian_bugiu
I have created a 3D game engine written in java for Android. It is based on 
the Ogre renderer and features 

- a complete OpenGL ES 2.0 multithreaded renderer 
- sound support
- input as touch or sensors
- GUI API
- easy material creation
- a new mesh format for fast loading based on ms3d format
- artemis framework integration for data driven game design
- easy to use and extensible design

A game that will feature this engine will be released somewhere at the end 
of this month or somewhere early in December to show off the engine 
capabilities.

From what I have seen the Android framework does not feature an API for 
game programmers so everyone has to create their own engine. Instead of 
this duplication I am asking the android developers if it could be possible 
to integrate my engine (I will open source the code) in the android 
framework so that everybody can have an easier way to create a 3D game?


-- 
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 game engine integration in the android framework

2012-11-09 Thread sebastian_bugiu
Why should the platform take any Game Engine? Because beginning game 
developers would surely appreciate something that leverages the android API 
directly. It would be easier for them to choose Android over Apple when 
choosing a platform to learn game development. Right now Android has worse 
game development support than Apple since it requires beginning people to 
take a C++ engine from the internet and try to use it through the NDK that 
doesn't fully support C++, all the while the official language is Java. 
It's cumbersome. At Apple you already get everything streamlined in the 
platform. You use Objective-C and can easily port your C/C++ engine to it. 
Android basically doesn't fully support C++ and developing using the NDK is 
pretty bad, especially for a beginner. It would make android much more 
developer friendly if it were to have a java written engine (easy to use), 
without using the JNI for all the calls to a C++ engine underneath (so it 
would be faster). Integrating the engine in the platform shows better 
commitment to the people that start programming and want to get in game 
development. And people want to make games for phones since it's easier for 
an indie dev to start for the phone than to write a game for PC or Xbox etc.

Why this one? Because this one does not go anywhere near C++, so no JNI. 
Also because the renderer is very capable for all kinds of games as it is 
based on Ogre so you can have advanced graphics on the phone while using a 
simple programming language (Java). Also it has good documentation so 
people can learn about its design and understand how a game engine works, 
should they want to write their own or modify and extend this one.

On Friday, November 9, 2012 7:24:59 PM UTC+2, RichardC wrote:

 Yours is one of many Game Engines for Android.  Why should the platform 
 take any Game Engine and specifically why this one?

 On Friday, November 9, 2012 4:57:37 PM UTC, sebastian_bugiu wrote:

 I have created a 3D game engine written in java for Android. It is based 
 on the Ogre renderer and features 

 - a complete OpenGL ES 2.0 multithreaded renderer 
 - sound support
 - input as touch or sensors
 - GUI API
 - easy material creation
 - a new mesh format for fast loading based on ms3d format
 - artemis framework integration for data driven game design
 - easy to use and extensible design

 A game that will feature this engine will be released somewhere at the 
 end of this month or somewhere early in December to show off the engine 
 capabilities.

 From what I have seen the Android framework does not feature an API for 
 game programmers so everyone has to create their own engine. Instead of 
 this duplication I am asking the android developers if it could be possible 
 to integrate my engine (I will open source the code) in the android 
 framework so that everybody can have an easier way to create a 3D game?




-- 
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 game engine integration in the android framework

2012-11-09 Thread sebastian_bugiu
The problem is that formats that are used in model editors aren't exactly 
efficient for the rendering pipeline. So you need to create a format that 
keeps data prepared and compressed. Right now you have a jar that converts 
from a ms3d format to a hm format that is used in the engine. As long as 
your model can get exported to ms3d you can export them for my engine. I 
chose ms3d because it's a simple format and most modelling applications can 
export to it.

On Friday, November 9, 2012 9:45:52 PM UTC+2, bob wrote:

 This sounds like a good idea.  I spent forever and a day making a 
 Wavefront OBJ loader, and the performance wasn't even that great.


 What methods will you offer for people to convert to your new mesh format?



 On Friday, November 9, 2012 10:57:37 AM UTC-6, sebastian_bugiu wrote:

 I have created a 3D game engine written in java for Android. It is based 
 on the Ogre renderer and features 

 - a complete OpenGL ES 2.0 multithreaded renderer 
 - sound support
 - input as touch or sensors
 - GUI API
 - easy material creation
 - a new mesh format for fast loading based on ms3d format
 - artemis framework integration for data driven game design
 - easy to use and extensible design

 A game that will feature this engine will be released somewhere at the 
 end of this month or somewhere early in December to show off the engine 
 capabilities.

 From what I have seen the Android framework does not feature an API for 
 game programmers so everyone has to create their own engine. Instead of 
 this duplication I am asking the android developers if it could be possible 
 to integrate my engine (I will open source the code) in the android 
 framework so that everybody can have an easier way to create a 3D game?




-- 
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 game engine integration in the android framework

2012-11-09 Thread sebastian_bugiu
I use milkshape 3d to open .3ds or fbx or obj or lwo and then save as ms3d. 
But this is only temporary. I will add more format convertors in the future 
so you can skip the opening in milkshape 3d hassle.

On Saturday, November 10, 2012 12:21:31 AM UTC+2, bob wrote:

 Can you tell me which applications you use to export to ms3d?


 Right now, I'm using Cheetah3d, and it does not, in fact, export to that 
 format.



 On Friday, November 9, 2012 4:07:26 PM UTC-6, sebastian_bugiu wrote:

 The problem is that formats that are used in model editors aren't exactly 
 efficient for the rendering pipeline. So you need to create a format that 
 keeps data prepared and compressed. Right now you have a jar that converts 
 from a ms3d format to a hm format that is used in the engine. As long as 
 your model can get exported to ms3d you can export them for my engine. I 
 chose ms3d because it's a simple format and most modelling applications can 
 export to it.

 On Friday, November 9, 2012 9:45:52 PM UTC+2, bob wrote:

 This sounds like a good idea.  I spent forever and a day making a 
 Wavefront OBJ loader, and the performance wasn't even that great.


 What methods will you offer for people to convert to your new mesh 
 format?



 On Friday, November 9, 2012 10:57:37 AM UTC-6, sebastian_bugiu wrote:

 I have created a 3D game engine written in java for Android. It is 
 based on the Ogre renderer and features 

 - a complete OpenGL ES 2.0 multithreaded renderer 
 - sound support
 - input as touch or sensors
 - GUI API
 - easy material creation
 - a new mesh format for fast loading based on ms3d format
 - artemis framework integration for data driven game design
 - easy to use and extensible design

 A game that will feature this engine will be released somewhere at the 
 end of this month or somewhere early in December to show off the engine 
 capabilities.

 From what I have seen the Android framework does not feature an API for 
 game programmers so everyone has to create their own engine. Instead of 
 this duplication I am asking the android developers if it could be 
 possible 
 to integrate my engine (I will open source the code) in the android 
 framework so that everybody can have an easier way to create a 3D game?




-- 
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 game engine integration in the android framework

2012-11-09 Thread sebastian_bugiu
I've investigated the problem for a bit and it seems that you can run 
blender on mac and add an add-on from 
http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/MilkShape3D_MS3D
 
to add import and export ms3d support to blender. And blender has obj and 
3ds formats and probably you can add more as addons just like the ms3d one.

On Saturday, November 10, 2012 1:09:48 AM UTC+2, bob wrote:

 That would be great to have more converters.  Right now, I'm on Mac, which 
 doesn't support MilkShape 3d.



 On Friday, November 9, 2012 4:57:27 PM UTC-6, sebastian_bugiu wrote:

 I use milkshape 3d to open .3ds or fbx or obj or lwo and then save as 
 ms3d. But this is only temporary. I will add more format convertors in the 
 future so you can skip the opening in milkshape 3d hassle.

 On Saturday, November 10, 2012 12:21:31 AM UTC+2, bob wrote:

 Can you tell me which applications you use to export to ms3d?


 Right now, I'm using Cheetah3d, and it does not, in fact, export to that 
 format.



 On Friday, November 9, 2012 4:07:26 PM UTC-6, sebastian_bugiu wrote:

 The problem is that formats that are used in model editors aren't 
 exactly efficient for the rendering pipeline. So you need to create a 
 format that keeps data prepared and compressed. Right now you have a jar 
 that converts from a ms3d format to a hm format that is used in the 
 engine. 
 As long as your model can get exported to ms3d you can export them for my 
 engine. I chose ms3d because it's a simple format and most modelling 
 applications can export to it.

 On Friday, November 9, 2012 9:45:52 PM UTC+2, bob wrote:

 This sounds like a good idea.  I spent forever and a day making a 
 Wavefront OBJ loader, and the performance wasn't even that great.


 What methods will you offer for people to convert to your new mesh 
 format?



 On Friday, November 9, 2012 10:57:37 AM UTC-6, sebastian_bugiu wrote:

 I have created a 3D game engine written in java for Android. It is 
 based on the Ogre renderer and features 

 - a complete OpenGL ES 2.0 multithreaded renderer 
 - sound support
 - input as touch or sensors
 - GUI API
 - easy material creation
 - a new mesh format for fast loading based on ms3d format
 - artemis framework integration for data driven game design
 - easy to use and extensible design

 A game that will feature this engine will be released somewhere at 
 the end of this month or somewhere early in December to show off the 
 engine 
 capabilities.

 From what I have seen the Android framework does not feature an API 
 for game programmers so everyone has to create their own engine. Instead 
 of 
 this duplication I am asking the android developers if it could be 
 possible 
 to integrate my engine (I will open source the code) in the android 
 framework so that everybody can have an easier way to create a 3D game?




-- 
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] Cannot run traceview

2012-08-14 Thread sebastian_bugiu
Running traceview from eclipse does not work (I am on 3.7.2)

Could not open the editor: Method exit (java/util/ArrayList.remove 
(I)Ljava/lang/Object;) does not match current method 
(java/lang/System.arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V)

java.lang.RuntimeException: Method exit (java/util/ArrayList.remove 
(I)Ljava/lang/Object;) does not match current method 
(java/lang/System.arraycopy (Ljava/lang/Object;ILjava/lang/Object;II)V)
at com.android.traceview.ThreadData.exit(ThreadData.java:106)
at com.android.traceview.DmTraceReader.parseData(DmTraceReader.java:323)
at 
com.android.traceview.DmTraceReader.generateTrees(DmTraceReader.java:92)
at com.android.traceview.DmTraceReader.init(DmTraceReader.java:87)
at 
com.android.ide.eclipse.traceview.editors.TraceviewEditor.createPartControl(TraceviewEditor.java:258)
at 
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at 
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at 
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at 
org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
at 
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
at 
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at 
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at 
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at 
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at 
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
at org.eclipse.ui.ide.IDE.openEditorOnFileStore(IDE.java:1155)
at 
com.android.ide.eclipse.traceview.TraceviewLauncher$1.run(TraceviewLauncher.java:65)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at 
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at 
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at 
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at 
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at 
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at 
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

and running traceview from terminal after pulling the calc.trace file gives

./traceview /tmp/calc
Exception in thread main java.lang.RuntimeException: Method exit 
(java/lang/String.indexOf (II)I) does not match current method 
(java/lang/String.fastIndexOf (II)I)
at com.android.traceview.ThreadData.exit(ThreadData.java:106)
at com.android.traceview.DmTraceReader.parseData(DmTraceReader.java:323)
at 
com.android.traceview.DmTraceReader.generateTrees(DmTraceReader.java:92)
at com.android.traceview.DmTraceReader.init(DmTraceReader.java:87)
at com.android.traceview.MainWindow.main(MainWindow.java:286)

-- 
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] GLES20.glLinkProgram() does not return

2012-05-24 Thread sebastian_bugiu
I have a LinkedQueue that stores the calls to anything from the GLES20
class. After loading it up I send a requestRender() call to
GLSurfaceView and in onDrawFrame() I process the queue and call the
actual GLES20 method.

Yet when I call GLES20.glLinkProgram() the function never returns. I
don't have anything in the logcat, no exception, no killed thread
nothing. It just remains there.

Any ideas in which conditions glLinkProgram() doesn't return and what
can I do to debug this situation?

I use a queue in which I add the gl commands issued by the renderer
and then I requestRender() to empty the queue by iterating through it
and calling each method in the added order. Some gl commands are of
get type and they can't be added to a queue so after issuing
glCreateShader I immediately requestRender() and store the retrieved
id that I then pass into the queue with the next commands like
glAttachShader etc. So in one onDrawFrame() call I create the shaders
and in the next I attach the source compile and link.

What I do may seem awkward but it does create both a vertex and
fragment shader and then compiles them both correctly. It also creates
a program with no errors. But linking the shaders to program just goes
into infinite loop or something

-- 
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: GLES20.glLinkProgram() does not return

2012-05-24 Thread sebastian_bugiu
Well the simple case works. I check after each call and compiling
works.. creating the program works...everything return success. But
when linking it just remains in the native call, never to return.

I suspected that creating the shaders and program in one
requestRender() and then linking in the next one could be the issue
but it isn't.

Anyway even if there is something wrong with my shader code it still
should return immediately. This sounds like an Android bug to me

On May 24, 9:32 pm, RichardC richard.crit...@googlemail.com wrote:
 Have your tried a simple test case?  I would suggest a skeleton program
 with just 1 fragment and 1 vertex shader and link them into a program.

 Are you calling glGetError and logging or aborting after every OpenGL ES
 API call?







 On Thursday, May 24, 2012 6:37:17 PM UTC+1, sebastian_bugiu wrote:

  I have a LinkedQueue that stores the calls to anything from the GLES20
  class. After loading it up I send a requestRender() call to
  GLSurfaceView and in onDrawFrame() I process the queue and call the
  actual GLES20 method.

  Yet when I call GLES20.glLinkProgram() the function never returns. I
  don't have anything in the logcat, no exception, no killed thread
  nothing. It just remains there.

  Any ideas in which conditions glLinkProgram() doesn't return and what
  can I do to debug this situation?

  I use a queue in which I add the gl commands issued by the renderer
  and then I requestRender() to empty the queue by iterating through it
  and calling each method in the added order. Some gl commands are of
  get type and they can't be added to a queue so after issuing
  glCreateShader I immediately requestRender() and store the retrieved
  id that I then pass into the queue with the next commands like
  glAttachShader etc. So in one onDrawFrame() call I create the shaders
  and in the next I attach the source compile and link.

  What I do may seem awkward but it does create both a vertex and
  fragment shader and then compiles them both correctly. It also creates
  a program with no errors. But linking the shaders to program just goes
  into infinite loop or something

-- 
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: GLES20.glLinkProgram() does not return

2012-05-24 Thread sebastian_bugiu
This is the vertex shader. I think it's basic enough

uniform mat4 view_proj_matrix;
uniform vec4 view_position;

attribute vec4 vertex;
attribute vec3 normal;

varying vec3 vNormal;
varying vec3 vViewVec;

void main(void)
{
   gl_Position = view_proj_matrix * vertex;
   vNormal = normal;
   vViewVec = view_position.xyz - vertex.xyz;
}

and the fragment shader:

uniform vec4 color;

varying vec3 vNormal;
varying vec3 vViewVec;

void main(void)
{
   float v = 0.5 * (1.0 + dot(normalize(vViewVec), vNormal));
   gl_FragColor = v * color;
}

On May 24, 9:43 pm, sebastian_bugiu
sebastian.bugiu.reloa...@gmail.com wrote:
 Well the simple case works. I check after each call and compiling
 works.. creating the program works...everything return success. But
 when linking it just remains in the native call, never to return.

 I suspected that creating the shaders and program in one
 requestRender() and then linking in the next one could be the issue
 but it isn't.

 Anyway even if there is something wrong with my shader code it still
 should return immediately. This sounds like an Android bug to me

 On May 24, 9:32 pm, RichardC richard.crit...@googlemail.com wrote:







  Have your tried a simple test case?  I would suggest a skeleton program
  with just 1 fragment and 1 vertex shader and link them into a program.

  Are you calling glGetError and logging or aborting after every OpenGL ES
  API call?

  On Thursday, May 24, 2012 6:37:17 PM UTC+1, sebastian_bugiu wrote:

   I have a LinkedQueue that stores the calls to anything from the GLES20
   class. After loading it up I send a requestRender() call to
   GLSurfaceView and in onDrawFrame() I process the queue and call the
   actual GLES20 method.

   Yet when I call GLES20.glLinkProgram() the function never returns. I
   don't have anything in the logcat, no exception, no killed thread
   nothing. It just remains there.

   Any ideas in which conditions glLinkProgram() doesn't return and what
   can I do to debug this situation?

   I use a queue in which I add the gl commands issued by the renderer
   and then I requestRender() to empty the queue by iterating through it
   and calling each method in the added order. Some gl commands are of
   get type and they can't be added to a queue so after issuing
   glCreateShader I immediately requestRender() and store the retrieved
   id that I then pass into the queue with the next commands like
   glAttachShader etc. So in one onDrawFrame() call I create the shaders
   and in the next I attach the source compile and link.

   What I do may seem awkward but it does create both a vertex and
   fragment shader and then compiles them both correctly. It also creates
   a program with no errors. But linking the shaders to program just goes
   into infinite loop or something

-- 
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 BitmapRegionDecoder fast enough?

2012-02-02 Thread sebastian_bugiu
I would like to use decodeRegion method in my game to only open a
region covering the screen from a larger bitmap. The idea is that I
would like to roam the map using the direction buttons and decode only
the part that is visible every frame. Is the BitmapRegionDecoder class
fast enough for decoding a bitmap 20 times per second? Or will I get
bad framerate?

I am asking this since I don't have a real android device right now
and I only work in the emulator, which is slow anyway. Did any of you
tried this thing? Does it work?

-- 
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] Skia issue with BitmapRegionDecoder

2012-01-05 Thread sebastian_bugiu
I have 2 pngs. One has transparent parts the other doesn't. Decoding a
region in the one without transparency works while decoding a region
from the one with transparency gives

I/DEBUG   (   34): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   (   34): Build fingerprint: 'generic/sdk/generic:4.0.2/
ICS_MR0/229537:eng/test-keys'
I/DEBUG   (   34): pid: 652, tid: 652   headwayEnt.OfficeWork 
I/DEBUG   (   34): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault
addr 4118a000
I/DEBUG   (   34):  r0 4118a000  r1 001a3280  r2 046d  r3 
I/DEBUG   (   34):  r4   r5   r6   r7 
I/DEBUG   (   34):  r8   r9   10   fp 
I/DEBUG   (   34):  ip 0101  sp be9ad378  lr 0018  pc
40011d40  cpsr 2010
I/DEBUG   (   34):  d0    d1  fff9006cb2b8
I/DEBUG   (   34):  d2  00060003  d3  3f00
I/DEBUG   (   34):  d4  4163e000  d5  4317
I/DEBUG   (   34):  d6  3ff0  d7  3faa
I/DEBUG   (   34):  d8    d9  
I/DEBUG   (   34):  d10   d11 
I/DEBUG   (   34):  d12   d13 
I/DEBUG   (   34):  d14   d15 
I/DEBUG   (   34):  scr 2013
I/DEBUG   (   34):
I/DEBUG   (   34):  #00  pc dd40  /system/lib/libc.so
(memcpy)
I/DEBUG   (   34):  #01  pc 000dd9e6  /system/lib/libskia.so
I/DEBUG   (   34):  #02  pc 000d86a2  /system/lib/libskia.so
(png_read_row)
I/DEBUG   (   34):  #03  pc 000d88dc  /system/lib/libskia.so
(png_read_rows)
I/DEBUG   (   34):  #04  pc 00049d6c  /system/lib/libskia.so
(_ZN17SkPNGImageDecoder14onDecodeRegionEP8SkBitmap7SkIRect)
I/DEBUG   (   34):  #05  pc 00045340  /system/lib/libskia.so
(_ZN14SkImageDecoder12decodeRegionEP8SkBitmap7SkIRectNS0_6ConfigE)
I/DEBUG   (   34):  #06  pc 0004cde4  /system/lib/libskia.so
(_ZN21SkBitmapRegionDecoder12decodeRegionEP8SkBitmap7SkIRectNS0_6ConfigEi)
I/DEBUG   (   34):  #07  pc 0006847a  /system/lib/
libandroid_runtime.so
I/DEBUG   (   34):  #08  pc 0001ec70  /system/lib/libdvm.so
(dvmPlatformInvoke)
I/DEBUG   (   34):  #09  pc 0005925a  /system/lib/libdvm.so
(_Z16dvmCallJNIMethodPKjP6JValuePK6MethodP6Thread)
I/DEBUG   (   34):  #10  pc 0004cc7c  /system/lib/libdvm.so
(_Z21dvmCheckCallJNIMethodPKjP6JValuePK6MethodP6Thread)
I/DEBUG   (   34):  #11  pc 00030ad0  /system/lib/libdvm.so
I/DEBUG   (   34):
I/DEBUG   (   34): code around pc:
I/DEBUG   (   34): 40011d20 e1a07427 e1877c08 e1a08428 e1888c09
I/DEBUG   (   34): 40011d30 e1a09429 e1899c0a e1a0a42a e18aac0b
I/DEBUG   (   34): 40011d40 e8a007f8 e1a0342b 2ae8 ea17
I/DEBUG   (   34): 40011d50 e491c004 e1a0400c e8b10fe0 f5d1f040
I/DEBUG   (   34): 40011d60 e2522020 2491c004 e1833404 e1a04c24
I/DEBUG   (   34):
I/DEBUG   (   34): code around lr:
I/DEBUG   (   34):     
I/DEBUG   (   34): 0010    
I/DEBUG   (   34): 0020    
I/DEBUG   (   34): 0030    
I/DEBUG   (   34): 0040    
I/DEBUG   (   34):
I/DEBUG   (   34): stack:
I/DEBUG   (   34): be9ad338  0008
I/DEBUG   (   34): be9ad33c  0008
I/DEBUG   (   34): be9ad340  0008
I/DEBUG   (   34): be9ad344  0004
I/DEBUG   (   34): be9ad348  0004
I/DEBUG   (   34): be9ad34c  
I/DEBUG   (   34): be9ad350  
I/DEBUG   (   34): be9ad354  071f
I/DEBUG   (   34): be9ad358  0641
I/DEBUG   (   34): be9ad35c  00f5
I/DEBUG   (   34): be9ad360  400d7920  /system/lib/libz.so
I/DEBUG   (   34): be9ad364  
I/DEBUG   (   34): be9ad368  00222a90
I/DEBUG   (   34): be9ad36c  00222850
I/DEBUG   (   34): be9ad370  df0027ad
I/DEBUG   (   34): be9ad374  
I/DEBUG   (   34): #00 be9ad378  0640
I/DEBUG   (   34): be9ad37c  41189e70
I/DEBUG   (   34): be9ad380  41189e70
I/DEBUG   (   34): be9ad384  0001
I/DEBUG   (   34): be9ad388  406c7707  /system/lib/libskia.so
I/DEBUG   (   34): be9ad38c  001de830
I/DEBUG   (   34): be9ad390  00ff
I/DEBUG   (   34): be9ad394  41189e70
I/DEBUG   (   34): be9ad398  001de6f8
I/DEBUG   (   34): be9ad39c  406959e9  /system/lib/libskia.so
I/DEBUG   (   34): #01 be9ad3a0  0001
I/DEBUG   (   34): be9ad3a4  
I/DEBUG   (   34): be9ad3a8  
I/DEBUG   (   34): be9ad3ac  41189e70
I/DEBUG   (   34): be9ad3b0  406c7733  /system/lib/libskia.so
I/DEBUG   (   34): be9ad3b4  001de6f8
I/DEBUG   (   34): be9ad3b8  
I/DEBUG   (   34): be9ad3bc  41189e70
I/DEBUG   (   34): be9ad3c0  406c7733  /system/lib/libskia.so
I/DEBUG   (   34): be9ad3c4  406c7733  

[android-developers] OutOfMemory exception when there should be enough memory left

2011-11-05 Thread sebastian_bugiu
So I am allocating a 4659200 bytes int[] that should be used as pixels
in a bitmap (a background bitmap). The int[] should be collected since
it's local to a method but somehow I get this stack trace:

D/dalvikvm(  339): GC_EXTERNAL_ALLOC freed 18K, 76% free 2882K/11783K,
external 7405K/7713K, paused 91ms
I/System.out(  339): background width: 320 height: 3640 total size:
4659200 bytes
D/dalvikvm(  339): threadid=11: still suspended after undo (sc=1 dc=1)
D/dalvikvm(  339): threadid=14: still suspended after undo (sc=1 dc=1)
D/dalvikvm(  339): GC_FOR_MALLOC freed 3K, 76% free 2882K/11783K,
external 11955K/14003K, paused 61ms
I/dalvikvm-heap(  339): Forcing collection of SoftReferences for
4659216-byte allocation
D/dalvikvm(  339): threadid=14: still suspended after undo (sc=1 dc=1)
D/dalvikvm(  339): threadid=11: still suspended after undo (sc=1 dc=1)
D/dalvikvm(  339): GC_FOR_MALLOC freed 1K, 76% free 2881K/11783K,
external 11955K/14003K, paused 56ms
E/dalvikvm-heap(  339): Out of memory on a 4659216-byte allocation.


I am not getting it. It says 76% free but that seems to be some
internal stuff since the external does increase from 7405 to 11955
which is correct since the object is 4 MB but why does it go to the
external memory?

 And finally this is the line that causes the OutOfMemory:

int[] pixel = new int[backgroundBitmap.getWidth() *
backgroundBitmap.getHeight()]; //width: 320 height: 3640

-- 
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: OutOfMemory exception when there should be enough memory left

2011-11-05 Thread sebastian_bugiu
Yes it's version 2.2 and no nothing native in my code. This bitmap is
a little large I do agree and I don't get this on the first run of the
app. It happens if I restart the activity and that whole bitmap gets
recreated. I think since it nullified before restarting the old one
should be collected before attempting to create the new one but it
seems that it does not collect the old bitmap (Actually all bitmaps
get nullified before restarting so they all should be collected if
necessary).

If the bitmap takes memory then it should OOM while creating the
bitmap. But the OOM gets thrown when creating the int[] which I assume
it's created in DalvikVM and not in the native side.

By any chance could it be the emulator? I use the 2.3.3 emulator.

On Nov 5, 7:51 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 I assume this is on pre honeycomb device.

 Do you have any bitmaps in your app or memory that is just in native
 (C/C++) code? Bitmaps take up process memory (that may contribute to
 OutOfMemory (OOM) errors) but the memory is native and isn't known to the
 DalvikVM.
 This means that it looks like you have plenty of memory left (in the
 DalvikVM), but memory used on the native side (by Bitmaps) may force the
 OOM.

-- 
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] The developer tools don't work as they should

2011-10-21 Thread sebastian_bugiu
First question: Why did you add gpu emulation option if the there is
no gpu emulation and setting it to yes makes the emulator not start??

Second question: Why when editing AVD and adding cache partition
support you can no longer click on new (I mean you can click just
nothing happens)??

Third question(rhetorical question): Do these guys actually test
anything before shipping???

I hate it when I have to work around bugs that are not mine!

And by the way..Is the Max vm application heap still 24 MB?? If yes
why? Most devices have at least 512 MB RAM so why can't we get more
for each 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: Ice cream sandwich gpu emulation issue

2011-10-21 Thread sebastian_bugiu
Then why did they add gpu emulation option in the emulator editor?? It
wasn't there before

On Oct 20, 6:26 am, Xavier Ducrohet x...@android.com wrote:
 Gpu emulation is not supported yet.
 On Oct 19, 2011 3:33 PM, sebastian_bugiu 







 sebastian.bugiu.reloa...@gmail.com wrote:
  If I have gpu emulation off everything works fine, if I turn emulation
  on then I get something like this in logcat

  I/DEBUG   (   32): Build fingerprint: 'generic/google_sdk/generic:
  4.0.1/ICS_MR0/202595:eng/test-keys'
  I/DEBUG   (   32): pid: 193, tid: 194   /system/bin/surfaceflinger
  
  I/DEBUG   (   32): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault
  addr 002b
  I/DEBUG   (   32):  r0   r1 0ff0  r2 0002  r3 002b
  I/DEBUG   (   32):  r4 00010400  r5 00010320  r6 00010320  r7 fde0
  I/DEBUG   (   32):  r8 0001  r9 000103e8  10   fp 0001
  I/DEBUG   (   32):  ip 40123ee4  sp 100ffd00  lr 40ff9c93  pc
  40ff9c96  cpsr 6030
  I/DEBUG   (   32):  d0  4290  d1  00a04320
  I/DEBUG   (   32):  d2  00a03f80  d3  
  I/DEBUG   (   32):  d4    d5  41ab2c459600
  I/DEBUG   (   32):  d6  3f80d2f1a9fc  d7  3f804320
  I/DEBUG   (   32):  d8    d9  
  I/DEBUG   (   32):  d10   d11 
  I/DEBUG   (   32):  d12   d13 
  I/DEBUG   (   32):  d14   d15 
  I/DEBUG   (   32):  scr 0010
  I/DEBUG   (   32):
  I/DEBUG   (   32):          #00  pc dc96  /system/lib/egl/
  libGLES_android.so (eglMakeCurrent)
  I/DEBUG   (   32):          #01  pc b40c  /system/lib/libEGL.so
  (eglMakeCurrent)
  I/DEBUG   (   32):          #02  pc 0001820a  /system/lib/
  libsurfaceflinger.so (_ZN7android15DisplayHardware4initEj)
  I/DEBUG   (   32):          #03  pc 000185aa  /system/lib/
  libsurfaceflinger.so
  (_ZN7android15DisplayHardwareC1ERKNS_2spINS_14SurfaceFlingerEEEj)
  I/DEBUG   (   32):          #04  pc 0001dcbc  /system/lib/
  libsurfaceflinger.so (_ZN7android14SurfaceFlinger10readyToRunEv)
  I/DEBUG   (   32):          #05  pc 00020c6a  /system/lib/libutils.so
  (_ZN7android6Thread11_threadLoopEPv)
  I/DEBUG   (   32):          #06  pc 000212d0  /system/lib/libutils.so
  I/DEBUG   (   32):          #07  pc 00012e08  /system/lib/libc.so
  (__thread_entry)
  I/DEBUG   (   32):          #08  pc 00012958  /system/lib/libc.so
  (pthread_create)
  I/DEBUG   (   32):
  I/DEBUG   (   32): code around pc:
  I/DEBUG   (   32): 40ff9c74 69076808 f8d4b1fc f8d9948c 03d02000
  I/DEBUG   (   32): 40ff9c84 42a7d502 e008d1ec f7ffb13f f8d7faed
  I/DEBUG   (   32): 40ff9c94 6819348c 3080f421 f8d96018 03d12000
  I/DEBUG   (   32): 40ff9ca4 4a3ad470 610c6811 3000f8d9 3080f443
  I/DEBUG   (   32): 40ff9cb4 f8c9 b13fe066 fad6f7ff 348cf8d7
  I/DEBUG   (   32):
  I/DEBUG   (   32): code around lr:
  I/DEBUG   (   32): 40ff9c70 49470a00 69076808 f8d4b1fc f8d9948c
  I/DEBUG   (   32): 40ff9c80 03d02000 42a7d502 e008d1ec f7ffb13f
  I/DEBUG   (   32): 40ff9c90 f8d7faed 6819348c 3080f421 f8d96018
  I/DEBUG   (   32): 40ff9ca0 03d12000 4a3ad470 610c6811 3000f8d9
  I/DEBUG   (   32): 40ff9cb0 3080f443 f8c9 b13fe066 fad6f7ff
  I/DEBUG   (   32):
  I/DEBUG   (   32): stack:
  I/DEBUG   (   32):     100ffcc0  0001040c
  I/DEBUG   (   32):     100ffcc4  0001
  I/DEBUG   (   32):     100ffcc8  
  I/DEBUG   (   32):     100ffccc  100ffcfc
  I/DEBUG   (   32):     100ffcd0  40123f14
  I/DEBUG   (   32):     100ffcd4  40123ec4
  I/DEBUG   (   32):     100ffcd8  0001
  I/DEBUG   (   32):     100ffcdc  40123f14
  I/DEBUG   (   32):     100ffce0  40123ec4
  I/DEBUG   (   32):     100ffce4  40123ec4
  I/DEBUG   (   32):     100ffce8  00010398
  I/DEBUG   (   32):     100ffcec  fe98
  I/DEBUG   (   32):     100ffcf0  000141b8
  I/DEBUG   (   32):     100ffcf4  4010c43f  /system/lib/libEGL.so
  I/DEBUG   (   32):     100ffcf8  df0027ad
  I/DEBUG   (   32):     100ffcfc  
  I/DEBUG   (   32): #00 100ffd00  0001
  I/DEBUG   (   32):     100ffd04  00010320
  I/DEBUG   (   32):     100ffd08  000141b8
  I/DEBUG   (   32):     100ffd0c  0001
  I/DEBUG   (   32):     100ffd10  00010398
  I/DEBUG   (   32):     100ffd14  40ff9bcd  /system/lib/egl/
  libGLES_android.so
  I/DEBUG   (   32):     100ffd18  00010398
  I/DEBUG   (   32):     100ffd1c  
  I/DEBUG   (   32):     100ffd20  000141b8
  I/DEBUG   (   32):     100ffd24  4010e40f  /system/lib/libEGL.so
  I/DEBUG   (   32): #01 100ffd28  40125b7c
  I/DEBUG   (   32):     100ffd2c  00010398
  I/DEBUG   (   32):     100ffd30  00010398
  I/DEBUG   (   32):     100ffd34  000141b8
  I/DEBUG   (   32):     100ffd38  0001
  I/DEBUG   (   32):     100ffd3c  fc48
  I/DEBUG   (   32):     100ffd40  0001
  I/DEBUG   (   32):     100ffd44  100ffdc8
  I/DEBUG   (   32):     100ffd48  00010398
  I/DEBUG   (   32):     100ffd4c

[android-developers] Ice cream sandwich gpu emulation issue

2011-10-19 Thread sebastian_bugiu
If I have gpu emulation off everything works fine, if I turn emulation
on then I get something like this in logcat

I/DEBUG   (   32): Build fingerprint: 'generic/google_sdk/generic:
4.0.1/ICS_MR0/202595:eng/test-keys'
I/DEBUG   (   32): pid: 193, tid: 194   /system/bin/surfaceflinger

I/DEBUG   (   32): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault
addr 002b
I/DEBUG   (   32):  r0   r1 0ff0  r2 0002  r3 002b
I/DEBUG   (   32):  r4 00010400  r5 00010320  r6 00010320  r7 fde0
I/DEBUG   (   32):  r8 0001  r9 000103e8  10   fp 0001
I/DEBUG   (   32):  ip 40123ee4  sp 100ffd00  lr 40ff9c93  pc
40ff9c96  cpsr 6030
I/DEBUG   (   32):  d0  4290  d1  00a04320
I/DEBUG   (   32):  d2  00a03f80  d3  
I/DEBUG   (   32):  d4    d5  41ab2c459600
I/DEBUG   (   32):  d6  3f80d2f1a9fc  d7  3f804320
I/DEBUG   (   32):  d8    d9  
I/DEBUG   (   32):  d10   d11 
I/DEBUG   (   32):  d12   d13 
I/DEBUG   (   32):  d14   d15 
I/DEBUG   (   32):  scr 0010
I/DEBUG   (   32):
I/DEBUG   (   32):  #00  pc dc96  /system/lib/egl/
libGLES_android.so (eglMakeCurrent)
I/DEBUG   (   32):  #01  pc b40c  /system/lib/libEGL.so
(eglMakeCurrent)
I/DEBUG   (   32):  #02  pc 0001820a  /system/lib/
libsurfaceflinger.so (_ZN7android15DisplayHardware4initEj)
I/DEBUG   (   32):  #03  pc 000185aa  /system/lib/
libsurfaceflinger.so
(_ZN7android15DisplayHardwareC1ERKNS_2spINS_14SurfaceFlingerEEEj)
I/DEBUG   (   32):  #04  pc 0001dcbc  /system/lib/
libsurfaceflinger.so (_ZN7android14SurfaceFlinger10readyToRunEv)
I/DEBUG   (   32):  #05  pc 00020c6a  /system/lib/libutils.so
(_ZN7android6Thread11_threadLoopEPv)
I/DEBUG   (   32):  #06  pc 000212d0  /system/lib/libutils.so
I/DEBUG   (   32):  #07  pc 00012e08  /system/lib/libc.so
(__thread_entry)
I/DEBUG   (   32):  #08  pc 00012958  /system/lib/libc.so
(pthread_create)
I/DEBUG   (   32):
I/DEBUG   (   32): code around pc:
I/DEBUG   (   32): 40ff9c74 69076808 f8d4b1fc f8d9948c 03d02000
I/DEBUG   (   32): 40ff9c84 42a7d502 e008d1ec f7ffb13f f8d7faed
I/DEBUG   (   32): 40ff9c94 6819348c 3080f421 f8d96018 03d12000
I/DEBUG   (   32): 40ff9ca4 4a3ad470 610c6811 3000f8d9 3080f443
I/DEBUG   (   32): 40ff9cb4 f8c9 b13fe066 fad6f7ff 348cf8d7
I/DEBUG   (   32):
I/DEBUG   (   32): code around lr:
I/DEBUG   (   32): 40ff9c70 49470a00 69076808 f8d4b1fc f8d9948c
I/DEBUG   (   32): 40ff9c80 03d02000 42a7d502 e008d1ec f7ffb13f
I/DEBUG   (   32): 40ff9c90 f8d7faed 6819348c 3080f421 f8d96018
I/DEBUG   (   32): 40ff9ca0 03d12000 4a3ad470 610c6811 3000f8d9
I/DEBUG   (   32): 40ff9cb0 3080f443 f8c9 b13fe066 fad6f7ff
I/DEBUG   (   32):
I/DEBUG   (   32): stack:
I/DEBUG   (   32): 100ffcc0  0001040c
I/DEBUG   (   32): 100ffcc4  0001
I/DEBUG   (   32): 100ffcc8  
I/DEBUG   (   32): 100ffccc  100ffcfc
I/DEBUG   (   32): 100ffcd0  40123f14
I/DEBUG   (   32): 100ffcd4  40123ec4
I/DEBUG   (   32): 100ffcd8  0001
I/DEBUG   (   32): 100ffcdc  40123f14
I/DEBUG   (   32): 100ffce0  40123ec4
I/DEBUG   (   32): 100ffce4  40123ec4
I/DEBUG   (   32): 100ffce8  00010398
I/DEBUG   (   32): 100ffcec  fe98
I/DEBUG   (   32): 100ffcf0  000141b8
I/DEBUG   (   32): 100ffcf4  4010c43f  /system/lib/libEGL.so
I/DEBUG   (   32): 100ffcf8  df0027ad
I/DEBUG   (   32): 100ffcfc  
I/DEBUG   (   32): #00 100ffd00  0001
I/DEBUG   (   32): 100ffd04  00010320
I/DEBUG   (   32): 100ffd08  000141b8
I/DEBUG   (   32): 100ffd0c  0001
I/DEBUG   (   32): 100ffd10  00010398
I/DEBUG   (   32): 100ffd14  40ff9bcd  /system/lib/egl/
libGLES_android.so
I/DEBUG   (   32): 100ffd18  00010398
I/DEBUG   (   32): 100ffd1c  
I/DEBUG   (   32): 100ffd20  000141b8
I/DEBUG   (   32): 100ffd24  4010e40f  /system/lib/libEGL.so
I/DEBUG   (   32): #01 100ffd28  40125b7c
I/DEBUG   (   32): 100ffd2c  00010398
I/DEBUG   (   32): 100ffd30  00010398
I/DEBUG   (   32): 100ffd34  000141b8
I/DEBUG   (   32): 100ffd38  0001
I/DEBUG   (   32): 100ffd3c  fc48
I/DEBUG   (   32): 100ffd40  0001
I/DEBUG   (   32): 100ffd44  100ffdc8
I/DEBUG   (   32): 100ffd48  00010398
I/DEBUG   (   32): 100ffd4c  0004
I/DEBUG   (   32): 100ffd50  fe98
I/DEBUG   (   32): 100ffd54  4002543c
I/DEBUG   (   32): 100ffd58  40020bb0  /system/lib/
libsurfaceflinger.so
I/DEBUG   (   32): 100ffd5c  4001820d  /system/lib/
libsurfaceflinger.so
D/dalvikvm(  189): GC_FOR_ALLOC freed 215K, 53% free 963K/2048K,
paused 41ms
D/dalvikvm(  189): GC_EXPLICIT freed 43K, 51% free 1017K/2048K, paused
2ms+2ms
D/dalvikvm(  189): GC_EXPLICIT freed 27K, 49% free 1046K/2048K, paused

[android-developers] How do I report a bug to htc?

2011-09-30 Thread sebastian_bugiu
I have an application in android market that does not work on htc
desire and I am positive the issue is not in my code. Basically I have
a private static final field that is initialized to a reference to an
object and yet whenever I access that object from another thread it
throws a NullPointerException even though it is initialized.

It works in the emulator but I have not tested the application on many
phones. But on those that I tested it works.

I am absolutely positive that the object is initialized before the
thread accessing it starts. I moved the initialization in the
constructor that completes before the thread starts. I removed static
final. Nothing. The thread UI calls surfaceCreated and in it I create
this object and start a thread that later accesses the object and
somehow accessing the field in the run() method causes
NullPointerException. If I access it from the UI thread it works. Can
a field be thread specific? And for everybody else be invisible? And
why only on HTC Desire (haven't tested other HTC phones). I thought it
might be some race condition or something since it has a faster CPU
but the code really looks like this:

status = new Status();
Thread thread = new Thread() {
 public void run() {
if (status == null) {
 throw new NullPointerException();
 }

}.start();

And on HTC is always null.

-- 
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