fullScreen doesn't work properly

edited January 2017 in Android Mode

Hi everyone, I've installed Android Mode 3.0.2 through the IDE. It doesn't work when I work with images with parallax and alpha channel, but it does if I draw an ellipse. I am trying the sketch in the device.

I noticed I need to put fullScreen between settings, because otherwise it crashes from the begining.

1- As soon as I change the orientation it crashes, no messages, it stops working.

void settings(){
  fullScreen();
}

2- With this, it doesn't even start.

void settings(){
  fullScreen(P2D);
}

It throws the following errors: _KetaiSensor: start()... Ignoring <#text> tag. FATAL EXCEPTION: GLThread 2841 Process: processing.test.aceleforce, PID: 22321 java.lang.ArrayIndexOutOfBoundsException: length=480000; index=480000 at processing.opengl.Texture.convertToRGBA(Unknown Source) at processing.opengl.Texture.set(Unknown Source) at processing.opengl.Texture.set(Unknown Source) at processing.opengl.PGraphicsOpenGL.initCache(Unknown Source) at processing.opengl.PGraphicsOpenGL.getTexture(Unknown Source) at processing.opengl.PGraphicsOpenGL$TexCache.getTexture(Unknown Source) at processing.opengl.PGraphicsOpenGL.flushPolys(Unknown Source) at processing.opengl.PGraphicsOpenGL.flush(Unknown Source) at processing.opengl.PGraphicsOpenGL.endDraw(Unknown Source) at processing.core.PApplet.handleDraw(Unknown Source) at processing.opengl.PGLES$AndroidRenderer.onDrawFrame(Unknown Source) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240) _

I put Fullscreen in the manifest file. I appreciate any ideas, thanks!.

PD:Which is the faster way to render images with parallax?

Tagged:

Answers

  • Ok let's see if I have more luck. I tested the example that is in the Processing Android page:

    import android.content.Context;
    import android.hardware.Sensor;
    import android.hardware.SensorManager;
    import android.hardware.SensorEvent;
    import android.hardware.SensorEventListener;
    
    Context context;
    SensorManager manager;
    Sensor sensor;
    AccelerometerListener listener;
    float ax, ay, az;
    
    void setup() {
      fullScreen();
      //size(displayWidth, displayHeight);
      context = getActivity();
      manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
      sensor = manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
      listener = new AccelerometerListener();
      manager.registerListener(listener, sensor, SensorManager.SENSOR_DELAY_GAME);
    
      textFont(createFont("Arial", 60));
    }
    
    void draw() {
      background(0);
      text("X: " + ax, 10, 60);
      text("Y: " + ay, 10, 120);
      text("Z: " + az, 10, 180);
    }
    
    class AccelerometerListener implements SensorEventListener {
      public void onSensorChanged(SensorEvent event) {
        ax = event.values[0];
        ay = event.values[1];
        az = event.values[2];    
      }
      public void onAccuracyChanged(Sensor sensor, int accuracy) {
      }
    }
    
    
    public void onResume() {
      super.onResume();
      if (manager != null) {
        manager.registerListener(listener, sensor, SensorManager.SENSOR_DELAY_GAME);
      }
    }
    
    public void onPause() {
      super.onPause();
      if (manager != null) {
        manager.unregisterListener(listener);
      }
    }
    

    I got the following error and the app doesn't even start:

    FATAL EXCEPTION: Animation Thread
    Process: processing.test.and1, PID: 13795
    java.lang.NullPointerException
        at processing.core.PGraphicsAndroid2D.backgroundImpl(Unknown Source)
        at processing.core.PGraphics.backgroundFromCalc(Unknown Source)
        at processing.core.PGraphics.background(Unknown Source)
        at processing.core.PGraphics.defaultSettings(Unknown Source)
        at processing.core.PGraphics.checkSettings(Unknown Source)
        at processing.core.PGraphicsAndroid2D.beginDraw(Unknown Source)
        at processing.core.PApplet.handleDraw(Unknown Source)
        at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)
        at processing.core.PApplet.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:841)
    

    I had to modify the code and put size(displayWidth, displayHeight); instead and it works fine.

    Processing version: 3.2.3

    Android Mode: 3.0.2 (installed through the IDE)

    Target SDK: API 6.0 (23)

    OS: Ubuntu 12.04 64 bits

    Hope I could have any hint to solve this.

Sign In or Register to comment.