We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Dear Processing Forum,
I am trying to develop my own art related wearable technology projects for experimenting with collective experience. I am keen to integrate Arduino based custom circuit boards, Android phone handsets running sketches coded in Processing, and The Web to store view data.
I m using Processing 2.0
My first step towards this has been to go through the Making Things Talk 2 tutorial: Mobile Phone Networks and The Physical World Page 401 : Project 31 - Personal Mobile Datalogger
I m having trouble running the Processing for Android sketch on page 408
P4ADatalogger.pde
This code can be found online here:
https://github.com/tigoe/MakingThingsTalk2/archive/master.zip
Then Chapter10.... P4ADatalogger..... P4ADatalogger.pde
I have rewritten part of the code as it used screenWidth and screenHeight (I replaced these with displayWidth and displayHeight - these parts of the code are now compiling)
However, when i try to run the code on my device (Android Nexus 4) i get the following error:
compile:
[javac] Compiling 3 source files to /var/folders/b6/k9d93zl514d735ngymcnl79c0000gn/T/android8689530784054544998sketch/bin/classes
[javac] /var/folders/b6/k9d93zl514d735ngymcnl79c0000gn/T/android8689530784054544998sketch/src/processing/test/p4adatalogger/P4ADatalogger.java:85: cannot find symbol
[javac] symbol : method getTime()
[javac] location: class processing.test.p4adatalogger.P4ADatalogger
[javac] text(getTime(), 10, displayHeight/4 + 60);
[javac] ^
[javac] /var/folders/b6/k9d93zl514d735ngymcnl79c0000gn/T/android8689530784054544998sketch/src/processing/test/p4adatalogger/P4ADatalogger.java:105: cannot find symbol
[javac] symbol : method getTime()
[javac] location: class processing.test.p4adatalogger.P4ADatalogger
[javac] currentReadings += getTime() +"," + thisReading;
[javac] ^
[javac] /var/folders/b6/k9d93zl514d735ngymcnl79c0000gn/T/android8689530784054544998sketch/src/processing/test/p4adatalogger/P4ADatalogger.java:118: cannot find symbol
[javac] symbol : method getTime()
[javac] location: class processing.test.p4adatalogger.P4ADatalogger
[javac] lastSendTime = getTime(); // a String to print on the screen
[javac] ^
[javac] 3 errors
BUILD FAILED
/Users/dm-shoes/Downloads/adt-bundle-mac-x86_64-20130522/sdk/tools/ant/build.xml:713: The following error occurred while executing this line:
/Users/dm-shoes/Downloads/adt-bundle-mac-x86_64-20130522/sdk/tools/ant/build.xml:727: Compile failed; see the compiler error output for details.
Total time: 3 seconds
It seems there is a problem finding the symbol:
[javac] symbol : method getTime()
can i replace
getTime()
with another method that will compile?
Can anyone please help to get this sketch working?
Thanks in advance
Answers
I am unaware of any method
getTime()
. Perhaps this is part of the example and was left out? A possible alternative isSystem.currentTimeMillis()
, which returns along
value that respresents the current system time in milliseconds.Thanks for taking a look at this Calsign i ll try using
System.currentTimeMillis()
instead. I ll let you know how i get on. Here is the full example code incase it helps:There is indeed a method
getTime()
at line 201:I don't know why you get such an error when compiling...
I tried using
System.currentTimeMillis()
instead ofgetTime
The sketch now compiles and runs on my Nexus4 handset!! I need to change a few things to get it running correctly but i feel like it's nearly there!! Thanks for this help Calsign. Here is the altered code:My next step is to check that the new code beginning line 199:
Will be found by line 63 in
void draw() {
text(getTime(), 10, displayHeight/4 + 60);
I ll let you know how i get on!!