Android mode - shape not working

Hi,

I made a small program using shape and it failed. So went to the examples, comes open with ‘Android Examples’ selected Topics, Create Shapes. PolygonPShapeOOP3. Ran that but it failed with:

OpenGL error 1280 at bot beginDraw(): invalid enum

So I removed the ‘P2D’ and it goes further but fails with:

Process: processing.test.polygonpshapeoop3_and2, PID: 27734
java.lang.ArrayIndexOutOfBoundsException: src.length=2 srcPos=0 dst.length=37 dstPos=0 length=37
at java.lang.System.arraycopy(Native Method)
at processing.core.PGraphics.vertex(PGraphics.java:1427)

If I remove the ‘shape(s);’ on line 30 of the Polygon tab the program runs without crashing but obviously the shapes don’t display.

Does shape work on Android?
Is there a list of what works/doesn’t for Android as compared with PC? (I’ve seen that G4P doesn’t.)
Do all the examples usually work?

Richard.

Hi.
Maybe you can try the PolygonPshapeOOP3 example here
Using shapes with APDE does not give errors at all. But looking the error the code seems to be different. You can use native android java easily, to substitute G4P… In my topics you find a few. I am planning to gather all I can find, and place them on github.

@noel, Thanks for that, in fact that PolygonPshapeOOP3 is the same as the standard example. I’ve tried an older lower-spec phone and strangely it’s alright on that, and P2D has to be included. There’s a 20 sec wait while the program starts.

Samsung Galaxy S5 Neo, Android v 6.0.1 - fail on P2D and shape.
Sony Xperia D2203, Android v 4.4.2 - PolygonPshapeOOP3 runs.