Cannot Find Symbol

edited November 2013 in Android Mode

Hey guys,

I was hoping that someone may be able to help me figure out this code. Pulling up different images on an android tablet using processing (there are more tabs with the rest of the button code, but that is not where the error is located). Where I start listing my image files is where the "error, cannot find symbol" is written (made a note in the code below). The bluetooth is then connecting to arduino to dim lights via a slider on the tablet (coded with processing).

Any help would be appreciated, as I am in a bit of a time crunch. Thanks!


import android.content.Intent;
import android.os.Bundle;

import ketai.net.bluetooth.*;
import ketai.ui.*;
import ketai.net.*;

import controlP5.*;

ControlP5 cp5;

//int bVal;
int heart;
PFont fontMy;
boolean bReleased = true; //no permament sending when finger is tap

KetaiBluetooth bt;
boolean isConfiguring = true;
byte info;
KetaiList klist;
ArrayList<String> devicesDiscovered = new ArrayList();
//********************************************************************
// The following code is required to enable bluetooth at startup.
//********************************************************************
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
bt = new KetaiBluetooth(this);
}

void onActivityResult(int requestCode, int resultCode, Intent data) {
bt.onActivityResult(requestCode, resultCode, data);


PImage imgA;
PImage imgB;
PImage imgC;
PImage imgD;
PImage imgE;
PImage imgF;
PImage imgG;
PImage imgH;
PImage imgI;
PImage imgJ;
PImage imgK;
PImage imgL;
PImage imgM;
PImage imgN;
PImage imgO;
PImage imgP;
PImage imgQ;
PImage imgR;
PImage imgS;
PImage imgT;
PImage imgU;
PImage imgV;
PImage imgW;
PImage imgX;
PImage imgY;
PImage imgZ;
PImage imgAll;
//PImage imgBack;
PImage imgLullaby;

int buttonX=147;
int buttonY=133;

PFont font;

int currentPage=0;

}

void setup()
{

  //just added
 // println(Serial.list());
  //port = new Serial(this, Serial.list()[8], 9600); 

size(displayWidth, displayHeight);
frameRate(10);
orientation(PORTRAIT);
//background(0);

     //start listening for BT connections
bt.start();
//at app start select device...
isConfiguring = true;
//font size
//fontMy = createFont("SansSerif", 40);
//textFont(fontMy);


 cp5 = new ControlP5(this);
   //PFont p = createFont("Arial",18); 
  cp5.setControlFont(fontMy,30);
  cp5.setColorLabel(color(255,0,0));
 cp5.addSlider("heart")
     .setPosition(720,400)
    // .setSize(255,400)
    .setSize(50,600)
     .setRange(0,255)
     //.setColorValueLabel(color(100))
     //.setColorCaptionLabel(color(255))
     .setDecimalPrecision(2) 
     .setValue(100)
     .setColorActive(color(255))
     .setLabelVisible(false) 
     .setColorForeground(color(255))
    // .setColorBackground(color(100));
     ;

//error here - cannot find symbol. why?

 imgA = loadImage("A.jpg");
imgB = loadImage("B.jpg"); 
imgC = loadImage("C.jpg");
imgD = loadImage("D.jpg");
imgE = loadImage("E.jpg");
imgF = loadImage("F.jpg");
  imgG = loadImage("G.jpg");
  imgH = loadImage("H.jpg");
  imgI = loadImage("I.jpg");
  imgJ = loadImage("J.jpg");
  imgK = loadImage("K.jpg");
  imgL = loadImage("L.jpg");
  imgM = loadImage("M.jpg");
  imgN = loadImage("N.jpg");
  imgO = loadImage("O.jpg");
  imgP = loadImage("P.jpg");
  imgQ = loadImage("Q.jpg");
  imgR = loadImage("R.jpg");
  imgS = loadImage("S.jpg");
  imgT = loadImage("T.jpg");
  imgU = loadImage("U.jpg");
  imgV = loadImage("V.jpg");
  imgW = loadImage("W.jpg");
  imgX = loadImage("X.jpg");
  imgY = loadImage("Y.jpg");
  imgZ = loadImage("Z.jpg");
  imgAll = loadImage("AllLullaby.jpg");
  imgLullaby = loadImage("Lullaby.jpg");

image (imgAll,0,0,width,height); 
image (imgA,0,0,width,height);
image (imgB,0,0,width,height);
image (imgC,0,0,width,height);
image (imgD,0,0,width,height);
image (imgE,0,0,width,height);
image (imgF,0,0,width,height);
image (imgG,0,0,width,height);
image (imgH,0,0,width,height);
image (imgI,0,0,width,height);
image (imgJ,0,0,width,height);
image (imgK,0,0,width,height);
image (imgL,0,0,width,height);
image (imgM,0,0,width,height);
image (imgN,0,0,width,height);
image (imgO,0,0,width,height);
image (imgP,0,0,width,height);
image (imgQ,0,0,width,height);
image (imgR,0,0,width,height);
image (imgS,0,0,width,height);
image (imgT,0,0,width,height);
image (imgU,0,0,width,height);
image (imgV,0,0,width,height);
image (imgW,0,0,width,height);
image (imgX,0,0,width,height);
image (imgY,0,0,width,height);
image (imgZ,0,0,width,height);
image (imgLullaby,0,0,width,height);

}

void draw()

{
//at app start select device
if (isConfiguring)
{
ArrayList<String> names;
//background(78, 93, 75);
klist = new KetaiList(this, bt.getPairedDeviceNames());
isConfiguring = false;
}
else
{
//background(255);
//fill(0);
//text(info,100,500);

byte sendheart = (byte) heart;

byte[] send = { '\n', sendheart};
bt.broadcast(send);

}
}


void onKetaiListSelection(KetaiList klist)
{
String selection = klist.getSelection();
bt.connectToDeviceByName(selection);

//dispose of list for now
klist = null;

buttonA(93,88,buttonX,buttonY);
buttonB(252,88,buttonX,buttonY);
buttonC(387,88,buttonX,buttonY);
buttonD(534,88,buttonX,buttonY);
buttonE(93,238,buttonX,buttonY);
buttonF(252,238,buttonX,buttonY);
buttonG(417,238,buttonX,buttonY);
buttonH(572,238,buttonX,buttonY);
buttonI(93,387,buttonX,buttonY);
buttonJ(252,387,buttonX,buttonY);
buttonK(417,387,buttonX,buttonY);
buttonL(572,387,buttonX,buttonY);
buttonM(93,540,buttonX,buttonY);
buttonN(252,540,buttonX,buttonY);
buttonO(417,540,buttonX,buttonY);
buttonP(572,540,buttonX,buttonY);
buttonQ(93,685,buttonX,buttonY);
buttonR(252,685,buttonX,buttonY);
buttonS(417,685,buttonX,buttonY);
buttonT(572,685,buttonX,buttonY);
buttonU(93,838,buttonX,buttonY);
buttonV(252,838,buttonX,buttonY);
buttonW(417,838,buttonX,buttonY);
buttonX(572,838,buttonX,buttonY);
buttonY(93,990,buttonX,buttonY);
buttonZ(252,990,buttonX,buttonY);

buttonMain(700,1100,50,50);

buttonSound(40,50,250,250);

buttonErase(20,1100,60,60);

buttonLullaby(417,990,buttonX,buttonY);

text("Alphabet",700,1100,60,60);
text("Erase",20,1100,60,60);

 strokeWeight(15);
 fill(225,0,0);
 line(mouseX,mouseY,pmouseX,pmouseY);

}

Answers

  • Nevermind. I got it to work. Now that I have changed the code and tried to upload to android....it just crashes and says that my file has stopped working

  • Any ideas on how to fix this?

  • Just two remarks:

    1. This is a question about the Android mode (so, I fear I cannot answer it). So:

      • This belongs to the Android mode category of the forum. I moved it.
      • I cannot run this code, so your question is too vague. What symbol cannot be found? When reporting an error, paste the full text of the reported error.
    2. I suggest to take a look at the From several variables to arrays article...

  • Also, you should perform an Edit > Auto Format on the code (in the PDE) to make it easier tor read. You have many { and }s in various places that may be causing errors...

  • CTRL+T is much faster than going to Edit -> Auto Format! I use it as much as CTRL+S! :bz

  • @GoToLoop I guess there is a shortcut for it... I don't use it that much, then.

Sign In or Register to comment.