We are about to switch to a new forum software. Until then we have removed the registration on this forum.
When I added PShapes to my android app it began to only run about 1/3 of the time (just a black screen would come up and I would exit any just try it again and it sometimes would then run) . The same thing happens when I run the processing app I downloaded called "GeoTecha". Is this processing's fault or my tablet's fault. When it does run it works properly. Has this happened to anyone else?
Comments
You encounter this error when using the
PShape
class? I am the author of GeoTecha, and I did not use this class anywhere in it (but perhaps I should, the new APIs look really good). Maybe the error instead involves the device's GPU, as the newPShape
stores the data on the GPU for faster rendering and GeoTecha uses OpenGL (GPU hardware-accelerated) rendering for all parts of the app to speed up the drawing cycle. I can experiment a bit, but I have a feeling that this has something to do with your device.What kind of device / tablet are you using?
Calsign, Does GeoTecha use P2D? The strange thing is that sometimes it does run. I am using a cheap ($65) android tablet called "FastTouch".
I just tested a sketch that does not use the PShape class but does use P2D. It had the same problem (only running sometimes, with no pattern). Does P2D work properly with your tablet? The annoying thing is that PShapes can't use JAVA2D. One other random question, does android mode work in processing 2.1, just want to make sure before I upgrade from processing 2.0.3.
I did some more testing, and it appears that if you don't use JAVA2D, the program does not always run (at least on my device). Did GeoTecha always run on your android device calsign?
GeoTecha uses the OpenGL renderer... which P2D is built on top of (they might actually be the same thing, now). On my device (Samsung Galaxy S4), the app runs every time.
I use Processing 2.1 to build and run apps successfully, although there are several people on these forums that have trouble doing so. I haven't tried everything with my current configuration and will test some stuff shortly. If you do install 2.1, you can always go back to 2.0.3... there's no reason to uninstall it.
I have done some tests. I ran a couple of the PShape examples provided with Processing (GroupPShape, PolygonPShapeOOP3, and PathPShape) and found consistent results across the board: Each sketch uses the P2D renderer, and each sketch calls the function
orientation(LANSCAPE)
immediately after thesize()
function.I have been aware of the fact that the
orientation()
function is inherently broken for quite some time now, and have used a different method for a while (in GeoTecha, too).The bug occurs when the screen is oriented in a different way than the function requests before the app is started. If the renderer is OpenGL / P2D / P3D, then you are left with a white screen. I'm not sure if the same problem happens with Java2D. However, if the screen is oriented the "correct" way, then there is no problem; this is probably why you found inconsistent results.
To fix this, don't use the
orientation()
function; instead, use the method in the link above.I don't know why you still have the problem in GeoTecha, seeing as I implemented the orientation locking correctly. There might be another underlying problem that I am unaware of that has to do with your device (probably its GPU, assuming that it has one), as I mentioned earlier. And if you aren't using
orientation()
in your test code, then all of this is irrelevant... and we're back to where we were before.P.S. This forum software doesn't currently notify me if you have responded to my response unless you include my screen name preceded by an "@" symbol, e.g.: @calsign
I am using orientation but all my android programs use it and only the ones that use some form of opengl have the launch problem. I have decided that my device hardware seems to be the problem.But I will tell you if the other method somehow fixes it, even though that wouldn't explain GeoTecha's problem. @calsign