Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all 941 articles
Browse latest View live

Functions doesn't exist

$
0
0

When I write the following code in Android mode, it instantly tells me: "The function "fullScreen()" does not exist".

void setup() { fullScreen(); }

When I do this in Java mode, it works. Any help?


Visualizing audio on Android (Minim-alternative)

$
0
0

Hello, I wrote a sketch in which multiple audio files are being visually represented by a waveform in real time. The whole thing was written using Minim, but apparently Minim is not supported on Android.

Is there a way to visualize audio on Android?

I googled around the web, seems like the android-compatible library "APwidgets" is not working in newer processing versions, also I didn't find any solution with "Cassette" so far...

Thanks in advance! :)

Here is the original code using Minim:

import ddf.minim.*;
Minim minim;
AudioPlayer player;
AudioPlayer player2;
AudioPlayer player3;
AudioPlayer player4;
AudioPlayer player5;
AudioPlayer player6;
AudioPlayer player7;
AudioPlayer player8;
AudioPlayer player9;

void setup()
{
  size(1128, 575, P2D);
  minim = new Minim(this);
  player = minim.loadFile("track1.mp3");
  player2 = minim.loadFile("track2.mp3");
  player3 = minim.loadFile("track3.mp3");
  player4 = minim.loadFile("track4.mp3");
  player5 = minim.loadFile("track5.mp3");
  player6 = minim.loadFile("track6.mp3");
  player7 = minim.loadFile("track7.mp3");
  player8 = minim.loadFile("track8.mp3");
  player9 = minim.loadFile("track9.mp3");
}

void draw()
{
  background(240);
  stroke(150, 100, 40);

  //WAVEFORMS
  for (int i = 0; i < player.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player.bufferSize(), 0, width);
    float x2 = map( i+1, 0, player.bufferSize(), 0, width);
    line( x1, 75 + player.left.get(i)*50, x2, 75 + player.left.get(i+1)*50 );
    line( x1, 100 + player.right.get(i)*50, x2, 75 + player.right.get(i+1)*50 );
  }

  stroke(20, 150, 90);

  for (int i = 0; i < player2.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player2.bufferSize(), 0, width);
    float x2 = map( i+1, 0, player2.bufferSize(), 0, width);
    line( x1, 125 + player2.left.get(i)*50, x2, 125 + player2.left.get(i+1)*50 );
    line( x1, 150 + player2.right.get(i)*50, x2, 125 + player2.right.get(i+1)*50 );
  }

  stroke(0, 70, 130);

  for (int i = 0; i < player3.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player3.bufferSize(), 0, width );
    float x2 = map( i+1, 0, player3.bufferSize(), 0, width );
    line( x1, 175 + player3.left.get(i)*50, x2, 175 + player3.left.get(i+1)*50 );
    line( x1, 200 + player3.right.get(i)*50, x2, 175 + player3.right.get(i+1)*50 );
  }

  stroke(80, 70, 130);

  for (int i = 0; i < player4.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player4.bufferSize(), 0, width);
    float x2 = map( i+1, 0, player4.bufferSize(), 0, width );
    line( x1, 225 + player4.left.get(i)*50, x2, 225 + player4.left.get(i+1)*50 );
    line( x1, 250 + player4.right.get(i)*50, x2, 225 + player4.right.get(i+1)*50 );
  }

  stroke(#9CC6A1);

  for (int i = 0; i < player5.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player5.bufferSize(), 0, width );
    float x2 = map( i+1, 0, player5.bufferSize(), 0, width );
    line( x1, 275 + player5.left.get(i)*50, x2, 275 + player5.left.get(i+1)*50 );
    line( x1, 300 + player5.right.get(i)*50, x2, 275 + player5.right.get(i+1)*50 );
  }


  stroke(#FA8A56);

  for (int i = 0; i < player6.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player6.bufferSize(), 0, width);
    float x2 = map( i+1, 0, player6.bufferSize(), 0, width );
    line( x1, 325 + player6.left.get(i)*50, x2, 325 + player6.left.get(i+1)*50 );
    line( x1, 350 + player6.right.get(i)*50, x2, 325 + player6.right.get(i+1)*50 );
  }

  stroke(#1ACFFF);

  for (int i = 0; i < player7.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player7.bufferSize(), 0, width );
    float x2 = map( i+1, 0, player7.bufferSize(), 0, width );
    line( x1, 375 + player7.left.get(i)*50, x2, 375 + player7.left.get(i+1)*50 );
    line( x1, 400 + player7.right.get(i)*50, x2, 375 + player7.right.get(i+1)*50 );
  }

  stroke(#D567DE);

  for (int i = 0; i < player8.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player8.bufferSize(), 0, width );
    float x2 = map( i+1, 0, player8.bufferSize(), 0, width );
    line( x1, 425 + player8.left.get(i)*50, x2, 425 + player8.left.get(i+1)*50 );
    line( x1, 450 + player8.right.get(i)*50, x2, 425 + player8.right.get(i+1)*50 );
  }

  stroke(#5A555A);

  for (int i = 0; i < player9.bufferSize() - 1; i++)
  {
    float x1 = map( i, 0, player9.bufferSize(), 0, width);
    float x2 = map( i+1, 0, player9.bufferSize(), 0, width );
    line( x1, 475 + player9.left.get(i)*50, x2, 475 + player9.left.get(i+1)*50 );
    line( x1, 500 + player9.right.get(i)*50, x2, 475 + player9.right.get(i+1)*50 );
  }
}

void keyPressed()
{

    player.rewind();
    player.play();
    player2.rewind();
    player2.play();
    player3.rewind();
    player3.play();
    player4.rewind();
    player4.play();
    player5.rewind();
    player5.play();
    player6.rewind();
    player6.play();
    player7.rewind();
    player7.play();
    player8.rewind();
    player8.play();
    player9.rewind();
    player9.play();
}

Processing Build Error

$
0
0

Hi, I'm getting this error when i try to build Processing.

compile:
  [methods] No changes to PApplet API.
    [mkdir] Created dir: C:\Users\Carlos\Desktop\Pross\processing\core\bin
    [javac] Compiling 52 source files to C:\Users\Carlos\Desktop\Pross\processing\core\bin
    [javac] ----------
    [javac] 1. ERROR in C:\Users\Carlos\Desktop\Pross\processing\core\src\processing\javafx\PSurfaceFX.java (at line 249)
    [javac]     float renderScale = Screen.getMainScreen().getRenderScale();
    [javac]                                                ^^^^^^^^^^^^^^
    [javac] The method getRenderScale() is undefined for the type Screen
    [javac] ----------
    [javac] 2. ERROR in C:\Users\Carlos\Desktop\Pross\processing\core\src\processing\javafx\PSurfaceFX.java (at line 252)
    [javac]     renderScale = Math.max(renderScale, s.getRenderScale());
    [javac]                                           ^^^^^^^^^^^^^^
    [javac] The method getRenderScale() is undefined for the type Screen
    [javac] ----------
    [javac] 3. ERROR in C:\Users\Carlos\Desktop\Pross\processing\core\src\processing\javafx\PSurfaceFX.java (at line 255)
    [javac]     float uiScale = Screen.getMainScreen().getUIScale();
    [javac]                                            ^^^^^^^^^^
    [javac] The method getUIScale() is undefined for the type Screen
    [javac] ----------
    [javac] 3 problems (3 errors)

BUILD FAILED
C:\Users\Carlos\Desktop\Pross\processing\build\build.xml:307: The following error occurred while executing this line:
C:\Users\Carlos\Desktop\Pross\processing\build\build.xml:362: The following error occurred while executing this line:
C:\Users\Carlos\Desktop\Pross\processing\core\build.xml:57: Compile failed; see the compiler error output for details.

Every time Compile APK into Android Phone, It Keep Stop Working?!

$
0
0

I had sought the answer from everywhere but there was not the solution at all and it makes me upset. Even thought I tried my friend's phone but it still stops working when I tried to run the game. Could someone please help get me out of this?

PFont bitoem; PImage birdImg, bgImg, obsImg, menuImg, startBtn; int score = 0, highScore = 0, genestate = 1, x = -200, y, vy = 0, wx[] = new int[2], wy[] = new int[2]; import ddf.minim.*;

AudioPlayer playerBGM, playerSwing, playerDie, playerScore; Minim minim;

void setup() { fullScreen(P2D); //size(600 , 800);
//game images birdImg = loadImage("chosenBird_8Bit.png"); bgImg = loadImage("background_color002(1680x800).jpg"); obsImg = loadImage("obstacle_long.jpg"); menuImg = loadImage("startMenu.jpg"); startBtn = loadImage("startBtn.jpg"); bitoem = loadFont("8BITWONDERNominal-48.vlw");

//music & sfx minim = new Minim(this); playerBGM = minim.loadFile("Jextor.mp3", 128); playerBGM.play(); playerBGM.setGain(-10.0); playerBGM.loop();

playerSwing = minim.loadFile("sfx_wing.wav", 705);

playerScore = minim.loadFile("sfx_point.wav");

playerDie = minim.loadFile("sfx_hit.wav");

//fonts style textFont(bitoem, 24); fill(255,255,255); textSize(28);

}

void draw() { //runs 60 times a second //background image loop if(genestate == 0) { //background(255,255,255); imageMode(CORNER); image(bgImg, x, 0); image(bgImg, x+bgImg.width, 0);

x -= 3;
vy += 1;
y += vy;

if(x == -1680) x=0;

//generate obstacle imgs
for(int i = 0; i < 2; i++){
  imageMode(CENTER);
  image(obsImg, wx[i], wy[i] - ((obsImg.height/2)+100));
  image(obsImg, wx[i], wy[i] + (obsImg.height/2+100));
  if(wx[i] < 0 ){
    wy[i] = (int)random(200,height -200);
    wx[i] = width;
  }

  //accumulative score
  if(wx[i] == width/2){
    playerScore.play();
    playerScore = minim.loadFile("sfx_point.wav");
    highScore = max(++score, highScore);
  }

  //bird image touch obstacle img, it will goes to genestate1
  if(y>height || y<0 || (abs(width/2-wx[i])<25 && abs(y-wy[i]) > 100))
  genestate=1;
  wx[i] -= 6;


}

image(birdImg, width/2, y, 46, 30.5);

//calculate the score while middle pixel goes through the pipe
text(""+score, width/2-15, 70);

}

else{ imageMode(CENTER); image(menuImg, width/2, height/2); image(startBtn, width/2, 500); text(highScore, 350, width/2-15);

} }

void mousePressed(){ vy =- 17;

if(genestate == 1){ wx[0] = 600; wy[0] = y = height/2; wx[1] = 900; wy[1] = 600; x = genestate = score = 0;
}

}

void mouseClicked(){ if(genestate == 0){ playerSwing.play(); } }

void mouseReleased(){ playerSwing.close(); playerSwing = minim.loadFile("sfx_wing.wav", 705); }

void stop(){ playerBGM.close(); minim.stop(); super.stop();

}

processing file link here: https://www.dropbox.com/s/s1hokayheh3vv25/flyFarBird.rar?dl=0

Stretch processing sketch to full screen resolution meanwhile it still remain the same pixel as well

$
0
0

I developing this game by using this resolution size(600, 800); and every code has been developed based on 600pixels x 800pixels. But then when I tried to scale it to fullScreen();, everything messed and goes wrong. Therefore, I'm seeking the solution of what if only stretch the game to fullscreen but still remain same(600, 800) sketch pixels.

1) 600pixels x 800pixel (develop based on this pixels) but after compiled apk and install to my android phone, it became smaller resolution: https://www.dropbox.com/s/f18bq75eamxar4k/non-fullscreen.jpg?dl=0

size(600, 800, P2D);

2)after I scale it to fullScreen(); it looked like this: https://www.dropbox.com/s/qltaescdo421u0z/fullscreen.jpg?dl=0

fullScreen();

PFont bitoem;
PImage birdImg, bgImg, obsImg, menuImg, startBtn;
int score = 0, highScore = 0, genestate = 1, x = -200, y, vy = 0,  wx[] = new int[2], wy[] = new int[2];

void setup() {

  fullScreen();
  //size(600, 800, P2D);

  //game images
  birdImg = loadImage("chosenBird_8Bit.png");
  bgImg = loadImage("background_color002(1680x800).jpg");
  obsImg = loadImage("obstacle_long.jpg");
  menuImg = loadImage("startMenu.jpg");
  startBtn = loadImage("startBtn.jpg");
  bitoem = loadFont("8BITWONDERNominal-48.vlw");

  //fonts style
  textFont(bitoem, 24);
  fill(255,255,255);
  textSize(28);

}

void draw() { //runs 60 times a second
  //background image loop
  if(genestate == 0) {
    //background(255,255,255);
    imageMode(CORNER);
    image(bgImg, x, 0);
    image(bgImg, x+bgImg.width, 0);

    x -= 3;
    vy += 1;
    y += vy;

    if(x == -1680) x=0;

    //generate obstacle imgs
    for(int i = 0; i < 2; i++){
      imageMode(CENTER);
      image(obsImg, wx[i], wy[i] - ((obsImg.height/2)+100));
      image(obsImg, wx[i], wy[i] + (obsImg.height/2+100));
      if(wx[i] < 0 ){
        wy[i] = (int)random(200,height -200);
        wx[i] = width;
      }

      //accumulative score
      if(wx[i] == width/2){
        //playerScore.play();
        //playerScore = minim.loadFile("sfx_point.wav");
        highScore = max(++score, highScore);
      }

      //bird image touch obstacle img, it will goes to genestate1
      if(y>height || y<0 || (abs(width/2-wx[i])<25 && abs(y-wy[i]) > 100))
      genestate=1;
      wx[i] -= 6;


    }

    image(birdImg, width/2, y, 46, 30.5);

    //calculate the score while middle pixel goes through the pipe
    text(""+score, width/2-15, 70);
  }

  else{
      imageMode(CENTER);
      image(menuImg, width/2, height/2);
      image(startBtn, width/2, 500);
      text(highScore, 350, width/2-15);

   }
}

void mousePressed(){
  vy =- 17;


  if(genestate == 1){
    wx[0] = 600;
    wy[0] = y = height/2;
    wx[1] = 900;
    wy[1] = 600;
    x = genestate = score = 0;
  }
}

IPCapture code example crashes

$
0
0

I am trying to use the example code from IPCapture, but it crashes right after start. I think I had it running once, but now I am not so sure. I do have the permissions set as required in the code. The app crashes Nexus 5 with latest LineageOS. The emulator also crashes. The code works fine in Java mode.

OS detection

$
0
0

Is it possible to use something like this?

void setup(){ if (OS == "Android"){ fullScreen(); } else size(400, 400); } ...

Error from inside the Android tools, check the console

$
0
0

Hello everyone,

Like many others I am encountering "Error from inside the Android tools, check the console" when trying to run my sketch on my device. My phone is running Android 4.4.2, I am using Processing 3.3.4. I am a beginner with all this but I will try to explain my setup and problem as well as I can...

I am using the Android serial library and Twitter4j – the phone will be communicating with an Arduino Mega via serial. My code runs fine on my Mac (with the regular processing serial library), but my code won't build in Android Mode. The Android code examples build and install fine on my Android.

When I try to run on device, the build stops after around 35 seconds.

This is from the output:

    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin
     [echo] org.eclipse.jdt.core.JDTCompilerAdapter

-set-mode-check:

-set-debug-files:

-check-env:
Android SDK Tools Revision 25.2.5
Installed at /Users/klaravan/Documents/Processing/modes/AndroidMode/sdk

-setup:
     [echo] Project Name: THERMAL_PRINTER_ANDROID
Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
Using latest Build Tools: 26.0.0
     [echo] Resolving Build Target for THERMAL_PRINTER_ANDROID...
Project Target:   Android 4.4.2
API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/res
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/rsObj
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/rsLibs
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/gen
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/classes
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for THERMAL_PRINTER_ANDROID...
Library dependencies:
No Libraries

------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 4 source files to /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/classes

-post-compile:

-obfuscate:

-dex:
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/classes
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4jstream404.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/usb-serial-for-android-b96f9ca.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/arduino.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4j404.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4jmediasupport404.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/slf4j-android-1.6.1-RC1.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/android-support-v4.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4j-core-4.0.4.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/AndroidSerial.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/processing-core.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4jasync404.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4jstream404.jar -> twitter4jstream404-842624e474271e1119dcc096c59d9787.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/usb-serial-for-android-b96f9ca.jar -> usb-serial-for-android-b96f9ca-226f408d8f00ded34ddf534a7c27f6f0.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/arduino.jar -> arduino-da1dc7a85994c2e8524323644c006aac.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4j404.jar -> twitter4j404-1061aae12996f11ede519dc5aefbe752.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/twitter4jmediasupport404.jar -> twitter4jmediasupport404-6bcaab2c12a9bde84258bd4b6590efb4.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/slf4j-android-1.6.1-RC1.jar -> slf4j-android-1.6.1-RC1-5f233d67026410b92fbe783ada9a1d79.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/libs/android-support-v4.jar -> android-support-v4-faf9b1f9fc4c7dc894b10e16174e6208.jar



       [dx]
       [dx] trouble writing output: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android7943944345409819765sketch/bin/dexedLibs/android-support-v4-faf9b1f9fc4c7dc894b10e16174e6208.jar (No space left on device)

  [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin
     [echo] org.eclipse.jdt.core.JDTCompilerAdapter

-set-mode-check:

-set-debug-files:

-check-env:
Android SDK Tools Revision 25.2.5
Installed at /Users/klaravan/Documents/Processing/modes/AndroidMode/sdk

-setup:
     [echo] Project Name: THERMAL_PRINTER_ANDROID
Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
Using latest Build Tools: 26.0.0
     [echo] Resolving Build Target for THERMAL_PRINTER_ANDROID...
Project Target:   Android 4.4.2
API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/res
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/rsObj
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/rsLibs
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/gen
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/classes
    [mkdir] Created dir: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for THERMAL_PRINTER_ANDROID...
Library dependencies:
No Libraries

------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 4 source files to /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/classes

-post-compile:

-obfuscate:

-dex:
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/classes
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4jstream404.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/usb-serial-for-android-b96f9ca.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/arduino.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4j404.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4jmediasupport404.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/slf4j-android-1.6.1-RC1.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/android-support-v4.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4j-core-4.0.4.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/AndroidSerial.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/processing-core.jar
input: /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4jasync404.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4jstream404.jar -> twitter4jstream404-0218e8c2d4f7f50a4c9d24fd6b2caa03.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/usb-serial-for-android-b96f9ca.jar -> usb-serial-for-android-b96f9ca-c296376d20c5b25b56ddd2a878e668ee.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/arduino.jar -> arduino-569b6310889839e71c38941de06c0073.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4j404.jar -> twitter4j404-9dde1ece43921b247b7963f1b336fe5e.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4jmediasupport404.jar -> twitter4jmediasupport404-990d2065f65866a495787d0710bd5dde.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/slf4j-android-1.6.1-RC1.jar -> slf4j-android-1.6.1-RC1-48314610ff6e9ec8894f0e75178e153f.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/android-support-v4.jar -> android-support-v4-2286ff6be82e7a679cf7283801014ee6.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4j-core-4.0.4.jar -> twitter4j-core-4.0.4-252d66578969888f70ca690a53595036.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/AndroidSerial.jar -> AndroidSerial-1073d5da2e571971de328ebb63c7dcc9.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/processing-core.jar -> processing-core-e0ab0e8be0caab6cb1fc70a3d2a09031.jar
Pre-Dexing /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/libs/twitter4jasync404.jar -> twitter4jasync404-e8dbb32dd6ccf77919cc67e83ad23912.jar
Converting compiled files and external libraries into /var/folders/1g/jdj0mvr913n_b53yfrwj7v8h0000gn/T/android1444489789936789373sketch/bin/classes.dex...
       [dx]
       [dx] UNEXPECTED TOP-LEVEL EXCEPTION:
       [dx] com.android.dex.DexException: Multiple dex files define Ltwitter4j/TwitterResponse;
       [dx]     at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:608)
       [dx]     at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:563)
       [dx]     at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:545)
       [dx]     at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:167)
       [dx]     at com.android.dx.merge.DexMerger.merge(DexMerger.java:194)
       [dx]     at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:506)
       [dx]     at com.android.dx.command.dexer.Main.runMonoDex(Main.java:336)
       [dx]     at com.android.dx.command.dexer.Main.runDx(Main.java:291)
       [dx]     at com.android.dx.command.dexer.Main.main(Main.java:247)
       [dx]     at com.android.dx.command.Main.main(Main.java:94)
       [dx]

VR sketch not working on Daydream View

$
0
0

The Introduction to VR page says VR sketches should run on both the Cardboard and the Daydream View. I have the latter, but I fail to deploy even the simplest of demos [1]. The app crashes and I get the following error:

Incompatible app This Cardboard application is not compatible with Daydream headsets.

I'm using the Google Pixel, Processing 3.3.5, AndroidMode 4.0-beta9, and have both the Daydream and Cardboard apps installed on the phone. Can someone confirm that the Daydream actually works?

[1] Code:

import processing.vr.*;

void setup() {
  fullScreen(STEREO);
}

void draw() {
}

Where do I find the net library

$
0
0

Hello. I feel like I'm being stupid, but I can't find the Network library. I tried looking for it everywhere on the internet and then I also thought, that it is already built in Processing and I tried importing it inside my code. Please, where is the network library?

Trouble with adb after installation

$
0
0

Hello everyone,

I'm using processing on ubuntu for almost one year now and I'd like to export my sketches for android. So I tried to install the android mode, which asked me to install the android sdk. I had the choice to locate the sdk on my computer on to let processing download the sdk itself, which I chose.

The download went great and after it a window named "Trouble with adb!" popped to say me this : "Could not run the adb tool from the android SDK. One possibility is that it's executable permission is not properly set. You can try setting this permission manually, or re-installing the SDK. The mode will be disabled until this problem is fixed."

I already tried to re-install the sdk and it didn't changed anything. I also searched on internet if a could find something to do with this but i didn't found something helpful.

I'm currently running on ubuntu 16.04 LTS and using processing-3.3

If someone can say me what to do or say me where to look i would be really thankful.

Best regards, Gaeth

.txt files in Android Mode

$
0
0

I'm upgrading an android game i've built some months ago ([https://play.google.com/store/apps/details?id=com.Sarothlon.MazeGenerator&hl=it](See it here)) so I first tested the new version on java mode and than in android mode where I'm not able to write textFiles i used to save some informations about the scores and some settings. The problem is that in android mode the PrintWriter class doesn't work. I think this is caused by the path of the argument of createWriter("data/textfile.txt"); I red that in android mode the path of the file should be absolute and not relative, but i couldn't find the textfile.txt searching in my smart phone. In addiction if an absolute path is requested it's still a problem because I think the path can change according to the different users'preferences (for example sd card or internal storage).

How can i fix this problem?

How do I get AndroidMode work?

$
0
0

I'm having a lot of trouble with processing for android... can anybody help me? I haven't found a solution yet:

-Once I've installed AndroidMode, and I try to run my sketch I receive 14 error messages about some importation problems like 'The import java.io.IOException is never used'. -When I write some predefined functions like size(); the console returns 'The function size() does not exist'. -Also, even my phone is connected processing doesn't recognise it at appears "no connected devices". I have tried a lot of things.

My phone is an LG G3 stylus with lollipop, I'm working in Mac, what's my problem?

@kfrajer I've seen you're good in this, can you help me? or anyone... Please!

Blepdroid receiving data

$
0
0

Thanks to the Blepdroid Library I’m able to send, with my Processing built Android App, commands to a Adafruit Bluefruit BLE module. Next thing I try to accomplish, is reading information from my Ultrasonic Wind Meter (from VAAVUD, BLE peripheral device). From the manufacturer I got the services and characteristic to listen to, with the Bluefruit NRF sniffer I can see what I’m sending, and after establishing the connection that the device starts broadcasting the characteristics which holds the wind information. I can also send a HEX to start a extra activity (like activate clinometer and eCompass). The only, and biggest, problem is that I’m not able to read the incoming data in my App. onCharacteristicRead shows [B@ebec62b, from what I read, a Byte array address but the length is 0.

Did some further research and read about a onBluetoothDataEvent which should be included in the sketch (found in the beginning of the Blepdroid.java file), like in the Ketai library. I didn’t find any part in the Blebdroid.java file that looks like handling the onBluetoothDataEvent. Hope someone knows the way to go. Thanks in advance.

Motion sensor application or solution

$
0
0

Motion sensor application or solution

Good morning. nice to meet you. Request a method or example for the motion sensor. Here's an image of what I want to do. tt

What should I use? Experts are waiting for your answers.


Exporting signed package

$
0
0

I downloaded processing, android mode and android SDK several times, but every time i try to export the signed package of a large project (pretty much 1300 lines of code) processing never end the operation:

Processing start to export the package, but at the end, after "release:" is printed, no one folder is created in the sketch folder. In addiction, while processing is exporting the package, nearly at the bottom-right corner of the IDE there's a rectangle, whose presence states that processing is exporting. this rectangle remains also after "release:" is printed.

The sketch of course has no errors, and the not signed apk runs smoothly on my android device.

I tried to export the android project and open it with android studio, but with the exported project android studio doesn't show the button to export the signed package(i'm sure of this).

How can i fix this problem? Thanks

How to show a print or text running on pc java or anrdoid java?

$
0
0

pseudo code:

  • if (androidjava) then text("your on android mode")

  • else if (pcjava) then text("your on pc mode")

can you give a working source code example?

Why return null length in Android mode?

$
0
0

This function in java mode works well.. but in android mode returns null length of folder.. any solution??

PImage[] loadImages(String nameFolder) {
  java.io.File folder = new java.io.File(dataPath("")+"/"+nameFolder);
  String[] filenames = folder.list();
  //println(filenames.length);
  //println(dataPath("")+"/"+nameFolder);
  PImage[] img = new PImage[filenames.length];
  for (int i = 0; i < filenames.length; i++) {
    //println("Loading: "+filenames[i]);
    img[i] = loadImage(dataPath("") + "/" + nameFolder + "/" + filenames[i]);
  }
  return img;
}

Testing the upcoming stable version of the Android mode

$
0
0

Hi everyone,

We have been hard at work during the past few months with the GSoC 2017 students (Rupak and Sara), readying the next stable version of the Android mode, which supports live wallpapers, watch faces, and VR apps, as well as the new build system in Android (Gradle)! We are very close to a stable release to make available through the Contributions Manager, and at this moment we have a "Release Candidate" package to test a bit before pushing it through the CM. Please download it from here, and file any issues you find with it. The Processing for Android will also be updated to reflect this new release, including a "what's new section" describing the main considerations when updating from versions 3 to 4 of the mode.

Andres

Is it serial library for android available?

$
0
0

Hello, I want to connect an arduino with my phone to transfer data but it's look like there is no working library for this. I've already tried this library but the apps crashed at the lauch with the error "java.lang.illegalArgumentException: This library works only on Android." (of course i'm on android). So if you know an other library or a fix for this error I will be happy to see your answer. thanks you by abvance :-)

Viewing all 941 articles
Browse latest View live