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

Emulator always says "Unfortunately, (Name of the sketch) has stopped."

$
0
0

Hello! I am really new to programming. Running a Win10 64bit. Downloaded Processing (works fine), klicked Android Mode+downloaded it, downloaded Emulator.

So far so good. but if i want to run a sketch on emulator that Error appears. Not in Emulator nor on device its possible to get a example sketch running. What could i try to fix that?!?!?


Is there a way to use javax.script.* in Android mode?

$
0
0

hi, all,

I am trying to port a java sketch to android mode. This sketch makes use of calling a javascript engine. When I compile it I get (among others) this error mesage:

    import javax.script.*;
           ^^^^^^^^^^^^
The import javax.script cannot be resolved

Is there a way to get this working?

Thanks in advance,

Michael.

How to install? (android)

$
0
0

Hello, i tried so many times to download processing 3 for android, processing 4 for android, with auto download of sdk and with manual download of sdk from androidStudio. Do NOT get it to run!!! Please.... is there some one, who is able to tell me how to get this android mode working?

win 10, 64bit my mobil is a samsung galaxy note 3 (debug is on), with 5.0 android

What to install? Do i have to set environment-variables or not? which ones? Do i have to run it as win 8 mode? etc. etc.

sorry... i hardly try to get this running but... i need some help!

Phone as Wireless Webcam Input

$
0
0

Dear Friends,

For an installation I am working, it would make very interactive if I would need several wireless camera from phones. BY using http://www.makeuseof.com/tag/how-to-use-an-android-device-as-a-pc-webcam/ i am able to see the phone capture on my laptop but in processing, I dont see as one of my capture deices.

How to overcome the limitation Or any other alternatives You recommend ?

Thanks a lot in advance

Cheers Raj

Android Mode doesn't work

$
0
0

I downloaded the android mode from the Contribution Manager of Processing. Than I've automatically downloaded the android SDK. But all my previous sketches don't work. Processing doesn't recognise any function. Here's an exampleImmagine

What can I do to fix this problem? Processing version : 3.3; Os: windows 10;

Android set-up - Quick black screen on device and gone

$
0
0

Dear Friends,

I am setting myself up on android mode (SDK API 6.0) on processing 3.2.3. Seems pretty straight forward. When I run a sample js (.pde) sketch on computer by selecting android mode and selecting my device connected though USB debugging enabled.

I notice my phone screen pops-up black screen for less than a second and then back to home screen.

I assume this is something very silly mistake am doing. Is this something anyone faced before ? Else I will dig deeper. ANy hints where to start highly appreciate.

Thanks in Advance Raj

How to decode qrcode in Android mode ?

$
0
0

Hello, I'm trying to create a qrcode scanner for Android but it doesn't work. I've tried with 2 different librairies, com.cage.zxing4p3 (zxing4p3) and qrcodeprocessing. Here are the issues when I'm trying to decode it :

With zxing4p3 :

FATAL EXCEPTION: Animation Thread
Process: processing.test.lycee_loth, PID: 18058
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/image/BufferedImage;
    at com.cage.zxing4p3.ZXING4P.decodeImage(ZXING4P.java:123)
    at processing.test.lycee_loth.Lycee_Loth.mouseReleased(Lycee_Loth.java:441)
    at processing.core.PApplet.mouseReleased(Unknown Source)
    at processing.core.PApplet.handleMouseEvent(Unknown Source)
    at processing.core.PApplet.dequeueEvents(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:761)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.image.BufferedImage" on path: DexPathList[[zip file "/data/app/processing.test.lycee_loth-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.lycee_loth-2/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 9 more

With qrcodeprocessing :

FATAL EXCEPTION: Thread-2
Process: processing.test.lycee_loth, PID: 22435
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/image/BufferedImage;
    at qrcodeprocessing.Decoder.scanImage(Decoder.java:113)
    at qrcodeprocessing.Decoder.run(Decoder.java:70)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.image.BufferedImage" on path: DexPathList[[zip file "/data/app/processing.test.lycee_loth-1/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.lycee_loth-1/lib/arm64, /system/lib64, /vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 2 more

In my application, when I touch the screen :

if (qr_code == true) { // When the QR code menu is on
    //camera.savePhoto("qr_code_a_decoder.jpg");
    //photos.add(loadImage("/storage/emulated/0/Pictures/savedFrames/qr_code_a_decoder.jpg"));
    PImage code = createImage(camera.width, camera.height, RGB);
    code.copy(camera, 0, 0, camera.width, camera.height, 0, 0, camera.width, camera.height);
    code.updatePixels();
    //messageDecode = zxing4p.decodeImage(true, loadImage("qr_test.jpg"));
    //println(messageDecode);
    decoder.decodeImage(code);
  }

Is anybody has an idea ? :) Thanks.

App freezes or seems unresponsive. APDE gives no errors.

$
0
0

Hi guys,

I've been using APDE for not too long now and I can't seem to get my sketch (which is running fine on my PC) to run on my tablet.

I've tried a bunch, but can't seem to get it to work.

This is the code:

PImage img, clk, sad, smile, itemIcon, sad_p, smile_p;
Animation rose;
int sep = 175;
int sel = 1;
int t = 101;
float opac = 0;
int frm = 350;
int event = 0;
boolean go = false;
int delay = 50;
int op = 2;
int item = 0;
int time = 0;
int moveBy = 120;
int textX = 105;
int textY = 35;
boolean animationReady = false;
void setup() {
  fullScreen ();
  frameRate  (10);
  orientation(LANDSCAPE);
  smile = loadImage("icons/smiley.png");
  sad = loadImage("icons/sad.png");
  sad_p= loadImage("icons/druksad.png");
  smile_p= loadImage("icons/drukblij.png");
  background(0);
  text("Loading...", 10, 10);
}
void draw() {
  if (animationReady == false) {
    rose = new Animation ("rose/rose ", 66);
    rose.loadAnimation();
  }
  if (t > delay && event != 2) {
    switch (event) {
    case 0:
      break;
    case 1:
      event = 2;
      break;
    case 2:
      event = 0;
      break;
    case 3:
      event = 0;
      break;
    }
    sel++;
    opac = 0;
    if (sel == 4) {
      sel = 1;
    }
    go = true;
    t=0;
    if (event == 0) {
      img = loadImage("family"+sel+".jpg");
    }
  }
  t++;
  if (go == true) {
    tint(255, opac);
    imageMode(CENTER);
    image(img, width/2, height/2, width, height);
    if (event == 3) {
      rose.display(width/2, height/2);
    }
    if (event == 1) {
      fill(0);
      rect(0, 0, width, 50);
      fill(255);
      textSize(30);
      switch (item) {
      case 1:
        text("Om 8 uur begint het ontbijt. Smakelijk eten!", textX, textY);
        break;
      case 2:
        text("Om 1 uur ga je kaarten. Veel succes!", textX, textY);
        break;
      case 3:
        text("Om 3 uur ga je zingen in het koor. Veel plezier!", textX, textY);
        break;
      case 4:
        text("Om 2 uur ga je even lekker koffie drinken.", textX, textY);
        break;
      case 5:
        text("Om 1 uur ga je even schilderen. Maak er iets moois van.", textX, textY);
        break;
      case 6:
        text("Om 7 uur ga je douchen.", textX, textY);
        break;
      case 7:
        text("Om 4 uur moet je je kamer opruimen.", textX, textY);
        break;
      case 8:
        text("Om 2 uur begint de wedstrijd. Neem maar vast plaats achter de TV!", textX, textY);
        break;
      case 9:
        text("Om 12 uur ga je zwemmen.", textX, textY);
        break;
      }
      image(clk, width/2-sep, height/2, frm, frm);
      image(itemIcon, width/2+sep, height/2, frm, frm);
    }
    if (event == 2) {
      fill(0);
      rect(0, 0, width, 50);
      fill(255);
      textSize(30);
      sep = sep + 290;
      switch (item) {
      case 1:
        text("Hoe was het ontbijt?", textX, textY);
        break;
      case 2:
        text("Hoe was het kaarten?", textX, textY);
        break;
      case 3:
        text("Hoe ging het zingen?", textX, textY);
        break;
      case 4:
        text("Hoe was de koffie?", textX, textY);
        break;
      case 5:
        text("Vond je het schilderen leuk?", textX, textY);
        break;
      case 6:
        text("Vond je het douchen fijn?", textX, textY);
        break;
      case 7:
        text("Vind je het leuk om je kamer op te ruimen?", textX, textY);
        break;
      case 8:
        text("Hoe was de wedstrijd?", textX, textY);
        break;
      case 9:
        text("Vond je het zwemmen leuk?", textX, textY);
        break;
      }
      image(sad, width/2-sep, height/2-moveBy, frm, frm);
      image(smile, width/2+sep, height/2-moveBy, frm, frm);
      image(sad_p, (width/2-sep)-frm/2+(frm/5)/2, (height/2-frm/2)-moveBy, frm/5, frm/5);
      image(smile_p, (width/2+sep)-frm/2+(frm/5)/2, (height/2-frm/2)-moveBy, frm/5, frm/5);
      if (mousePressed == true &&
        mouseX > ((width/2-sep)-frm/2) &&
        mouseX < ((width/2-sep)+frm/2) &&
        mouseY > ((height/2)-frm/2) &&
        mouseY < ((height/2)+frm /2)) {
        event = 3;
        op = 0;
      }
      if (mousePressed == true &&
        mouseX > ((width/2+sep)-frm/2) &&
        mouseX < ((width/2+sep)+frm/2) &&
        mouseY > ((height/2)-frm/2) &&
        mouseY < ((height/2)+frm /2)) {
        event = 3;
        op = 1;
      }
      sep = 175;
    }
    if (event == 3) {
      fill(0);
      rect(0, 0, width, 50);
      fill(255);
      textSize(30);
      text("Dankjewel voor de reactie!", textX, textY);
    }
    if (opac == 255) {
      go = false;
    }
    opac = opac + 25;
  }
}
void touchStarted() {
  if (event == 0) {
    opac = 0;
    img = loadImage("items/item (" + item + ").jpg");
    switch (item) {
    case 0:
      time = 8;
      break;
    case 1:
      time = 1;
      break;
    case 2:
      time = 3;
      break;
    case 3:
      time = 2;
      break;
    case 4:
      time = 1;
      break;
    case 5:
      time = 7;
      break;
    case 6:
      time = 4;
      break;
    case 7:
      time = 2;
      break;
    case 8:
      time = 12;
      break;
    }
    clk = loadImage("icons/time/"+ time +"u.png");
    switch (item) {
    case 0:
      itemIcon = loadImage("icons/tafel.png");
      break;
    case 1:
      itemIcon = loadImage("icons/kaart1.png");
      break;
    case 2:
      itemIcon = loadImage("icons/koor1.png");
      break;
    case 3:
      itemIcon = loadImage("icons/koffie1.png");
      break;
    case 4:
      itemIcon = loadImage("icons/schilderen1.png");
      break;
    case 5:
      itemIcon = loadImage("icons/douchen1.png");
      break;
    case 6:
      itemIcon = loadImage("icons/opruimen1.png");
      break;
    case 7:
      itemIcon = loadImage("icons/voetbal1.png");
      break;
    case 8:
      itemIcon = loadImage("icons/zwem1.png");
      break;
    }
    event = 1;
    go = true;
    t=0;
    item++;
  }
  if (event == 2) {
    event = 0;
    t=0;
  }
}
class Animation {
  PImage[] images;
  int imageCount;
  int frame;
  boolean getImages = false;
  String imageName = "";
  Animation(String imagePrefix, int count) {
    imageCount = count;
    images = new PImage[imageCount];
    imageName = imagePrefix;
  }
  void loadAnimation() {
    for (int i = 0; i < imageCount; i++) {
      String filename = imageName + "(" + i + ").jpg";
      images[i] = loadImage(filename);
    }
    animationReady = true;
  }
  void display(float xpos, float ypos) {
    frame = (frame+1) % imageCount;
    image(images[frame], xpos, ypos, width, height);
  }
  int getWidth() {
    return images[0].width;
  }
}

When I run the sketch on APDE it builds my app, I install it and run it as usual. It shows a black screen with the text "loading..." in the top left corner, just like I programmed it. But that's it. It doesn't continue from there. No errors or anything.

Can any of you tell what might be causing this?

All the best,

  • Ryan

PS: Sorry for the formatting of my program. When you program in a hurry it can never be good...


Android->PC UDP communication

$
0
0

Dear All, I spent the day try to make work the connection between android and pc via UDP. The code that I put here is what I hope "closer-to-work". Still I can't send data from PC to the Android, while the reception of PC from Android works.

::::::::::::::::::::::::: PC side code::::::::::::::::::::::::::

import hypermedia.net.*;

int portRX=50000;
int portTX=51000;
String ip="224.0.0.2";
int rx_buffer_size=100;
String rx_string="Waiting for Data";
byte[] rx_byte=new byte[rx_buffer_size];
int rx_byte_count=0;
String message="";

UDP udpTX,udpRX;
void setup() {
  size(300,300);
  udpTX=new UDP(this,portTX,ip);
  udpTX.log(true);
  udpTX.setBuffer(5);
  udpTX.loopback(false);

  udpRX=new UDP(this,portRX,ip);
  udpRX.log(true);
  udpRX.listen(true);
}

void draw(){
  background(255);
  fill(0);
  text("Is TX mulitcast: "+udpTX.isMulticast(), 20,20);
  text("Has TX joined multicast: "+udpTX.isJoined(), 20,40);
  text("Is loopback enabled on TX: "+udpTX.isLoopback(), 20,60);

  //confirm if rx is multicast
  text("Is RX mulitcast: "+udpRX.isMulticast(), 20,80);
  text("Has RX joined multicast: "+udpRX.isJoined(), 20, 100);
  text(rx_string, 20, 120);
  text(message, 20, 140);
}

void keyReleased() {
  udpsender(key+"ciao buonasera");
}

//------------------------------------------------- RECEIVER
void receive( byte[] data ) {
 message= bytes2string(data);
}

//------------------------------------------------- SENDER
void udpsender(String whatIsend){
  byte[] data = new byte[4];
  data=string2bytes(whatIsend);
  udpTX.send( data );
}

//------------------------------------------------- STRING CONVERSIONS
byte[] string2bytes(String chaine) {
  byte[] bytes = new byte[0];
  for (int i = 0; i < chaine.length(); i++) {
    bytes = append(bytes, byte(chaine.charAt(i)));
  }
  return bytes;
}

String bytes2string(byte[] bytes){
  String chaine = str(char(bytes[0]));
  for (int i = 1; i < bytes.length; i++) {
    chaine = chaine+str(char(bytes[i]));
  }
  return chaine;
}

::::::::::::::::::::::::: Android side::::::::::::::::::::::::::

import hypermedia.net.*;

UDP udpTX,udpRX;
color uno=#9C5052;
color due=#00A881;

color backgro;
int stage=0;

String receivedFromUDP = "";
String ip="224.0.0.2";
int portRX=51000;
int portTX=50000;
int rx_buffer_size=100;
String rx_string="Waiting for Data";
byte[] rx_byte=new byte[rx_buffer_size];
int rx_byte_count=0;

void setup() {
  backgro=0;
  orientation(PORTRAIT);
  smooth();

  udpTX=new UDP(this,portTX,ip);
  udpTX.setBuffer(5);
  udpTX.loopback(false);

  udpRX=new UDP(this,portRX,ip);
  udpRX.listen(true);
  super.start();
}

void draw() {
  background(backgro);
  textAlign(CENTER, CENTER);

  if(stage==0) {
    fill(uno);
    rect(0, 0, width, height/2);

    fill(due);
    rect(0, height/2, width, height/2);

    fill(255);
    textSize(36);

    text("Player 1",width/2,height/4);
    text("Player 2",width/2,height/4*3);
  }

  textSize(12);
  if(udpRX.isListening()) text("OK", width/2,height/2);

  text("Is TX mulitcast: "+udpTX.isMulticast(), width/2,20);
  text("Has TX joined multicast: "+udpTX.isJoined(), width/2,40);
  text("Is loopback enabled on TX: "+udpTX.isLoopback(), width/2,60);

  //confirm if rx is multicast
  text("Is RX mulitcast: "+udpRX.isMulticast(), width/2,80);
  text("Has RX joined multicast: "+udpRX.isJoined(), width/2, 100);
  text(rx_string, width/2, 120);
  text("message:"+receivedFromUDP, width/2,height/3);
}

//------------------------------------------------- SENDER
void udpsender(String whatIsend){
  byte[] data = new byte[4];
  data=string2bytes(whatIsend);
  udpTX.send( data );
}

//------------------------------------------------- RECEIVER
void receive( byte[] data ) {
 receivedFromUDP= bytes2string(data);
}

//------------------------------------------------- BUTTONS
boolean rectOver = false;

void mousePressed() {
  if (overRect(0, 0, width, height/2)) {
    stage=1; backgro=uno;
  }
  else {stage=2; backgro=due;}
  udpsender("s"+stage);
}

boolean overRect(int x, int y, int widthRect, int heightRect) {
  if (mouseX >= x && mouseX <= x+widthRect &&
    mouseY >= y && mouseY <= y+heightRect) {
    return true;
  }
  else {return false;}
}

//------------------------------------------------- STRING CONVERSIONS
byte[] string2bytes(String chaine) {
  byte[] bytes = new byte[0];
  for (int i = 0; i < chaine.length(); i++) {
    bytes = append(bytes, byte(chaine.charAt(i)));
  }
  return bytes;
}

String bytes2string(byte[] bytes){
  String chaine = str(char(bytes[0]));
  for (int i = 1; i < bytes.length; i++) {
    chaine = chaine+str(char(bytes[i]));
  }
  return chaine;
}

::::::::::::::::::::::::: ::::::::::::::::::::::::: I saw others having similar issues, but still could not figure out what is going wrong with mine. Thank you

Web comunication

$
0
0

I built a simple android game with processing (you can download it here https://play.google.com/store/apps/details?id=com.Sarothlon.MazeGenerator ). It is still a rough game, i know, but i want to implement a lot of cool features with new upgrades. One of these, i hope will be the possibility to compete with friends online. I thought something like these : my friend and i have the game downloaded on our devices; we both have an username and i know his; to compete against him i write his username and send him a request through a web server; he accept my request; we play the same maze and at the end of the game our devices send the results to a server; the server decide who's the winner and let us know.

To realize this feature i was thinking to do it using a second level domine ( this in particular sarothlon.altervista.org/) but i have no idea of how all the comunications should work. I think i should use the Client class of the Network library for the client part of the comunications, isn't it? But i don't know how to connect to a specific web page, how to question or to send data to it and how it should answer. So any suggestion or link from which i could learn something is very important for me. Thank you in advance !!!

P.S. I know something of html and php, so i should understand if you send me html or php code.

Can I override Android methods like onPause(), onResume() in Processing?

$
0
0

Hi! I want to know that can I override Android methods like onPause(), onResume() in Processing? I also want to override "back" key. Because by default if I press back key it closes the sketch. I dont want that to happend. Thanks in advance :)

[New to processing] How do I get started creating a weather app

$
0
0

Hi, I want to create a weather app for android, but I can't find any guidelines on how to actually get weather data. Haven't started yet and don't know how to. Any help is appreciated!

FX2D & Android

$
0
0

Testing my sketch on PC, I see that the FX2D render just blows everything in terms of performance

So I spontaneously think that this is the renderer I need to use for the Android version of my sketch... but FX2D is not available on Android.

Yet I see links ( 1 and 2 ) explaining that javaFX can work good in Android.

Wouldn't it make sens to try that ?

Anyone with experience in that ?

Sketch running slow

$
0
0

So I made this little game with pictures (they are hosted online so anyone can run this script) on my computer it runs fine but when I move to a device with lower specs it starts to drop to like 5fps how would I solve this? also when running this code it could look clitchy since I didn't keep aspect ratios in mind when making it.

EDIT: I made the stupid mistake of not mentioning that when I when I said "a lower spec system" I meant an andriod phone

ArrayList <Bullet> bullets;
int background_y;

PImage background;
PImage player;
PImage enemy;
PImage bullet;

int bullet_traveling;
int bullet_timer1;
int bullet_timer2;
int bullet_shot;
int bullet_side;
int bullet_x;
int bullet_y;

int enemy_health;
int enemy_x;
int enemy_y;

int player_x;
int player_y;

void setup() {
  fullScreen();
  frameRate(60);
  bullets = new ArrayList();

  background = loadImage("https://" + "s21.postimg.org/oubg978af/background.png");
  player = loadImage("https://" + "s13.postimg.org/hy84r98mv/player.png");
  bullet = loadImage("https://" + "s23.postimg.org/45ev766kr/bullet.png");
  enemy = loadImage("https://" + "s27.postimg.org/6njql63gz/enemy.png");

  bullet.resize(bullet.width/3, bullet.height/3);
  background.resize(width, height);

  player_y = height/4*3;
  player_x = width/2;
}

void draw() {
  background();
  for (Bullet temp : bullets) temp.update();
  bullet_enemy();
  player();
  enemy();

  if (mousePressed) {
    if (bullet_timer1 == 0) {
      bullet_timer1 = 1;
      bullet_timer2 = millis();
    }
    if (millis() - bullet_timer2 >= 200) {
      bullet_timer1 = 0;
      if (bullet_side == 1) {
        Bullet temp = new Bullet(player_x+55, player_y);
        bullets.add(temp);
        bullet_side = 0;
      } else {
        Bullet temp = new Bullet(player_x-55, player_y);
        bullets.add(temp);
        bullet_side = 1;
      }
    }
  }
}

void background() {
  image(background, 0, background_y);
  image(background, 0, background_y-height);
  background_y += 1;
  if (background_y >= height) background_y = 0;
}

void enemy() {
  if (enemy_health == 0) {
    enemy_health = 1;
    enemy_y = -enemy.width/2;
    enemy_x = int(random(enemy.width/2, width-enemy.width/2));
  }
  if (enemy_y-enemy.width/2 >= height) {
    enemy_health = 0;
  }
  enemy_y += 3;

  image(enemy, enemy_x-enemy.width/2, enemy_y-enemy.height/2);
}

void player() {
  if (mousePressed && player_x < mouseX) player_x = player_x + 12;
  if (mousePressed && player_x > mouseX) player_x = player_x - 12;
  image(player, -player.width/2+player_x, -player.height/2+player_y);
}

void bullet_enemy() {
  if (player_x <= enemy_x+100 && player_x >= enemy_x-100 || bullet_traveling == 1) {
    bullet_traveling = 1;
    if (bullet_shot == 0) {
      bullet_x = enemy_x;
      bullet_y = enemy_y;
      bullet_shot = 1;
    }
    rect(bullet_x, bullet_y, 10, 10);
    bullet_y = bullet_y + 30 ;
  }

  if (bullet_x <= player_x+player.width/2 && bullet_x >= player_x-player.width/2 && bullet_y >= player_y) {
    bullet_traveling = 0;
    bullet_shot = 0;
  }
}

class Bullet {
  float x;
  float y;
  float speed;

  Bullet(float tx, float ty) {
    x = tx;
    y = ty;
  }

  void update() {
    image(bullet, -bullet.width/2+x, -bullet.height/2+y);
    y -= 25;
    if (x <= enemy_x+enemy.width/2 && x >= enemy_x-enemy.width/2 && y <= enemy_y) {
      x = -10000;
      enemy_health = 0;
    }
  }
}

sketch doesn't work on a device, app probably started but gone immediately.

$
0
0

Hi! I'm just starting Processing android mode.

  • device : Samsung Galaxy Tab E 8.0
  • os : android 6.0.1
  • Processing ver. : 3.3.2
  • android mode ver. : 4.0 prereleases

After running a sketch(getting started example), the screen of a device turned black, but immediately the app is gone and the messase "Unfortunately, sketch_xxxx has stopped."

The below is error message on a console of Processing. Thanks in advance for any help!


FATAL EXCEPTION: main Process: processing.test.sketch_170429a, PID: 24633 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.sketch_170429a/processing.test.sketch_170429a.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3132) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7406) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.Instrumentation.newActivity(Instrumentation.java:1096) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122) ... 9 more Suppressed: java.io.IOException: Failed to open dex files from /data/app/processing.test.sketch_170429a-2/base.apk at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:295) at dalvik.system.DexFile.(DexFile.java:80) at dalvik.system.DexFile.(DexFile.java:59) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279) at dalvik.system.DexPathList.makePathElements(DexPathList.java:248) at dalvik.system.DexPathList.(DexPathList.java:120) at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48) at dalvik.system.PathClassLoader.(PathClassLoader.java:65) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:86) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:47) at android.app.LoadedApk.getClassLoader(LoadedApk.java:438) at android.app.LoadedApk.makeApplication(LoadedApk.java:663) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6469) at android.app.ActivityThread.access$1800(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887) ... 6 more Suppressed: java.lang.ClassNotFoundException: processing.test.sketch_170429a.MainActivity at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available FATAL EXCEPTION: main Process: processing.test.sketch_170429a, PID: 24952 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.sketch_170429a/processing.test.sketch_170429a.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3132) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7406) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.Instrumentation.newActivity(Instrumentation.java:1096) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122) ... 9 more Suppressed: java.io.IOException: Failed to open dex files from /data/app/processing.test.sketch_170429a-2/base.apk at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:295) at dalvik.system.DexFile.(DexFile.java:80) at dalvik.system.DexFile.(DexFile.java:59) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279) at dalvik.system.DexPathList.makePathElements(DexPathList.java:248) at dalvik.system.DexPathList.(DexPathList.java:120) at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48) at dalvik.system.PathClassLoader.(PathClassLoader.java:65) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:86) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:47) at android.app.LoadedApk.getClassLoader(LoadedApk.java:438) at android.app.LoadedApk.makeApplication(LoadedApk.java:663) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6469) at android.app.ActivityThread.access$1800(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887) ... 6 more Suppressed: java.lang.ClassNotFoundException: processing.test.sketch_170429a.MainActivity at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available FATAL EXCEPTION: main Process: processing.test.sketch_170429a, PID: 24972 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.sketch_170429a/processing.test.sketch_170429a.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3132) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7406) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.Instrumentation.newActivity(Instrumentation.java:1096) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122) ... 9 more Suppressed: java.io.IOException: Failed to open dex files from /data/app/processing.test.sketch_170429a-2/base.apk at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:295) at dalvik.system.DexFile.(DexFile.java:80) at dalvik.system.DexFile.(DexFile.java:59) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279) at dalvik.system.DexPathList.makePathElements(DexPathList.java:248) at dalvik.system.DexPathList.(DexPathList.java:120) at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48) at dalvik.system.PathClassLoader.(PathClassLoader.java:65) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:86) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:47) at android.app.LoadedApk.getClassLoader(LoadedApk.java:438) at android.app.LoadedApk.makeApplication(LoadedApk.java:663) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6469) at android.app.ActivityThread.access$1800(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887) ... 6 more Suppressed: java.lang.ClassNotFoundException: processing.test.sketch_170429a.MainActivity at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available FATAL EXCEPTION: main Process: processing.test.sketch_170429a, PID: 24993 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.sketch_170429a/processing.test.sketch_170429a.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3132) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7406) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.ClassNotFoundException: Didn't find class "processing.test.sketch_170429a.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.sketch_170429a-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.sketch_170429a-2/lib/arm, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.Instrumentation.newActivity(Instrumentation.java:1096) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122) ... 9 more Suppressed: java.io.IOException: Failed to open dex files from /data/app/processing.test.sketch_170429a-2/base.apk at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:295) at dalvik.system.DexFile.(DexFile.java:80) at dalvik.system.DexFile.(DexFile.java:59) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279) at dalvik.system.DexPathList.makePathElements(DexPathList.java:248) at dalvik.system.DexPathList.(DexPathList.java:120) at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48) at dalvik.system.PathClassLoader.(PathClassLoader.java:65) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:86) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:47) at android.app.LoadedApk.getClassLoader(LoadedApk.java:438) at android.app.LoadedApk.makeApplication(LoadedApk.java:663) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6469) at android.app.ActivityThread.access$1800(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887) ... 6 more Suppressed: java.lang.ClassNotFoundException: processing.test.sketch_170429a.MainActivity at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available


ketai setUpdateRate

$
0
0

Hello, I'm using the Ketai library to get my GPS coordinates. But the GPS updateRate is set by default to ~10 sec and I want to have faster update. On the Ketai reference I saw the command setUpdateRate who should increase the GPS updateRate, but I don't no how to use this command. So thank you by advance for your answer if you know how to use this. :)

Failure [INSTALL_FAILED_DEXOPT]

$
0
0

Hi there, I got this well-known (actually not by me) error message, and was surfing the forum in search of some fixes.. I initially thought that some incompatibility of Android versions (5 on phone, 6 or 7 on processing) would have explained that, but i'm in the same trouble with the avd emulator..Any suggest?Thanks guys

How to get battery percent on Android?

$
0
0

There's probably a library to get battery-related info and I've done a fair bit of research, but apparently this just isn't something people typically need...? I'm making a HUD-type app and I want the phone's battery to be displayed in it; any suggestions?

ketai keyboard does not work

$
0
0

hello! I'm using the ketai library to call the keyboard on android device. With this keyboard the system variable "key" work fine to get all the letters key and numbers but the ENTER or DELETE key doesn't work. This problem is apparently very old because this post of 2015 talk about this problem too but haven't answer for this. So is there any solution to solve this problem? Thanks you by advance :)

Lost connection with device while installing (I have not found solutions in previous questions)

$
0
0

With the update of processing i have problems to connect the device in android mode. Also the emulator didn't run. The errors:

Failure [INSTALL_FAILED_DEXOPT] Shutting down any existing adb server... Exception in thread "AndroidDevice: logcat process monitor" java.lang.IllegalStateException: I didn't know about device UBE0216329000293! at processing.mode.android.Devices.deviceRemoved(Devices.java:266) at processing.mode.android.Device.shutdown(Device.java:295) at processing.mode.android.Device$1.run(Device.java:278) at java.lang.Thread.run(Thread.java:748)

This also happens with a simple sketch with only the setup() so I think there are no code problems. The SDK was downloaded automatically and before the update all works correctly. Please, someone can help me? (Yes, usb debug is on)

Viewing all 941 articles
Browse latest View live