How to vibrare my phone with vibration moter for mobilephones in android processing?
Vibrate your phone
Analyze audio in Ketai or cassette
I have an audio player working, an want a level meter graphic. Is there an analyze function to use with these libraries?
How to create notifications, even when the app is closed.
Okay I am new to android app development! I have been using ketai lib. to creat my apps so far and everything went super smooth.
But now when I searched how to create notifications using processing, I found things getting complicated. I thought I will have an another lib. to perfrom notification action. But I was wrong.
Can some one help me with a code on how to handle notifications in android. (OR) Suggest me where to start learning https://developer.android.com/guide/topics/ui/notifiers/notifications.html#CreateNotification I started here, but was not able to understand a line.
Its okay if it would take a lot of time for me to read and understand, I am ready to go trough it. I would be happy, if someone could show me the code also!!
Toast in processing
I want to use toast on a button click how can i do it in java mode and in android mode as well kindly do tell me the way
Notifications in Android Mode
Hi! I'd like to have notifications in my app, but I know that the way in which a processing sketch works on Android is a bit different; I've been able to include toast notifications (that we can see when the app is on the screen), using the Android constructors.
A piece of code for Toast Notifications:
// The Looper is necessary for displaying Toast Notifications
import android.os.Looper;
import android.widget.Toast;
class TOASTnotifications extends Thread {
// Text of the notification
String txt = t;
// Duration of the notification
int time = n;
public TOASTnotifications (String t, int n) {
txt= t;
time = n;
}
public void start() {
super.start();
}
//@Override
public void run() {
Looper.prepare();
Toast.makeText(this, txt, time).show();
Looper.loop();
}
}
But I'd like to see notifications in the android notification center, and then return to the app when I click on them.
Thanks in advance for any help
Android PShape and Draw Order
Hello
in my processing/android app I use P2D and a lot of PShapes. but the thing is that it seems to me impossible to draw anything other than a PShape UNDER those PShapes I made.
I need to draw lines (complicated/dynamic/cannot do with PShape) in the background but wherever in the code I draw my lines, there appear OVER the PShapes.
Any Idea on how to control this kind of z buzzer for 2D ?
cheers :)
(writing this after a good, long, research on google, forums for v1, 2 and 3 of processing, OpenProcessing etc...)
Exporting Error
createProject renameTo() failed, resorting to mv/move instead.
java.io.IOException: Cannot run program "mv": CreateProcess error=2, 지정된 파일을 찾을 수 없습니다
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at processing.app.exec.ProcessHelper.execute(ProcessHelper.java:84)
at processing.app.exec.ProcessHelper.execute(ProcessHelper.java:64)
at processing.mode.android.AndroidBuild.createExportFolder(AndroidBuild.java:247)
at processing.mode.android.AndroidBuild.exportPackage(AndroidBuild.java:304)
at processing.mode.android.AndroidEditor$18.run(AndroidEditor.java:618)
Caused by: java.io.IOException: CreateProcess error=2, 지정된 파일을 찾을 수 없습니다
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 7 more
"지정된 파일을 찾을 수 없습니다" means "cannot find appointed file"
Anyone know about this ERROR? The program works fine in "Run on device" but when I try to Export it the Error appears. Plz help me.
Error from inside the Android Tools Check the console. Please help tried everything I've found sofar
I've tried everything I can find and am still getting this error.
Please help.
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 4) import processing.data.*; ^^^^^^^^^^^^^^^
The import processing.data is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 5) import processing.event.*; ^^^^^^^^^^^^^^^^
The import processing.event is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 6) import processing.opengl.*; ^^^^^^^^^^^^^^^^^
The import processing.opengl is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 8) import java.util.HashMap; ^^^^^^^^^^^^^^^^^
The import java.util.HashMap is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 9) import java.util.ArrayList; ^^^^^^^^^^^^^^^^^^^
The import java.util.ArrayList is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 10) import java.io.File; ^^^^^^^^^^^^
The import java.io.File is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 11) import java.io.BufferedReader; ^^^^^^^^^^^^^^^^^^^^^^
The import java.io.BufferedReader is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 12) import java.io.PrintWriter; ^^^^^^^^^^^^^^^^^^^
The import java.io.PrintWriter is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 13) import java.io.InputStream; ^^^^^^^^^^^^^^^^^^^
The import java.io.InputStream is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 14) import java.io.OutputStream; ^^^^^^^^^^^^^^^^^^^^
The import java.io.OutputStream is never used
- WARNING in /private/var/folders/lx/dpnrq8313bn6ytpyy2bhmn980000gn/T/android7503043339350958716sketch/src/processing/test/androidtest/androidtest.java (at line 15) import java.io.IOException; ^^^^^^^^^^^^^^^^^^^
The import java.io.IOException is never used
11 problems (11 warnings)
I'm running OS X 10.11.4
Processing 3.1.1
How to get the telephone number of the device where the App is running?
Hi experts, I am new to Processing and I enjoy this very much already. Some solutions are shown here: http://stackoverflow.com/questions/18894080/get-my-phone-number-in-android I wonder if there is any library function available in Processing to get the telephone number.
Thanks in advance.
AR
Play Sound in android
`import processing.sound.*; SoundFile file;
void setup() { size(640, 360); background(255);
// Load a soundfile from the /data folder of the sketch and play it back file = new SoundFile(this, "sample.mp3"); file.play(); }
void draw() { }`
it doesn't work in android HELP! ASAP
Generate tones
Hello people,
I'm sketching an app that pick colour from the camera and turn it into a sound frequency. On the computer I used minim to generate my tone, where I also need to tune the decay, and release and stuff. I now know that minim doesn't work on android because of the javasound part.
Any idea how I could still make sounds happen there ?
I'd like to have simple AlertDialog in my Processing-Android sketch
Hi,
I'd like to have simple AlertDialog window with OK confirm button in my processing sketch for Android target...
I've found example code here : http://forum.processing.org/one/topic/android-pop-up-windows#25080000001725349.html
but it doesn't work. It seems that fix is not that hard but is beyond my newbie knowledge in Android field... There is a hint how to solve this but I don't know how to use it (it's commented)...
My code :
//Import required classes import android.app.AlertDialog; import android.content.DialogInterface;
// Activity activity;
void setup() {
// activity=(Activity) this.context;
// activity.runOnUiThread(Runnable r) ;
//Create the AlertDialog
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
//Set the title
alertDialog.setTitle("Alert");
//Set the message
alertDialog.setMessage("This is an AlertDialog!");
//Add the OK button
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//The OK button has been clicked
}});
//Display the AlertDialog
alertDialog.show();
}
void draw() {
}
I get this error :
FATAL EXCEPTION: Animation Thread java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() at android.os.Handler.(Handler.java:121) at android.app.Dialog.(Dialog.java:101) at android.app.AlertDialog.(AlertDialog.java:67) at android.app.AlertDialog$Builder.create(AlertDialog.java:800) at processing.test.popup_test.popup_test.setup(popup_test.java:35) 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:1019)
Would kindly ask for example code that works or any other help or pointer...
Thanks in advance, regards, Bulek.
preferences in android
i m using image pixels to save the preferences of player in game. m saving the image in data folder with pref.save("data/preferences.png"); but when i deploy this to android device it show me error of not finding the data folder. when i save the image directly to the sketch folder it is not deployed with the code to the device. i write the code to create the image when nt available in skecth folder it creates the image in android but can't be able to change the pixel values of the image the code is given below
if (loadImage("preferences.png")==null)
{
pref = createImage(6, 6, RGB);
pref.loadPixels();
for (int i = 0; i<36; i++)
{
pref.pixels[i] = color(1, 0, 0);
}
pref.updatePixels();
pref.save("preferences.png");
println("null");
}
else
{
pref=loadImage("preferences.png");
// println("preferences");
}
Processing on Android for GoogleCardboard
Hello,
I tried to adapt the initial code to my processing project but it triggered the following errors:
FATAL EXCEPTION: GLThread 1873 Process: processing.test.androidproj, PID: 14032 java.lang.NullPointerException at processing.opengl.PGLES.texParameterf(Unknown Source) at processing.opengl.Texture.allocate(Unknown Source) at processing.opengl.Texture.init(Unknown Source) at processing.opengl.Texture.(Unknown Source) at processing.opengl.FontTexture.addTexture(Unknown Source) at processing.opengl.FontTexture.initTexture(Unknown Source) at processing.opengl.FontTexture.(Unknown Source) at processing.opengl.PGraphicsOpenGL.textLineImpl(Unknown Source) at processing.core.PGraphics.textLineAlignImpl(Unknown Source) at processing.core.PGraphics.text(Unknown Source) at processing.core.PGraphics.text(Unknown Source) at processing.test.androidproj.androidproj.draw(androidproj.java:149) at processing.core.PApplet.handleDraw(Unknown Source) at processing.opengl.PGLES$AndroidRenderer.onDrawFrame(Unknown Source) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1532) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1249)
Do you know why this happened? How can I fix this?
Thank you for the help
Help with Fatal Exeption
Hello everybody,
I'm making an app at the moment, but I've got a little problem: 90% of the times I run the app, everything works fine. But sometimes, I get this error by starting the app:
FATAL EXCEPTION: Animation Thread
Process: processing.test.touchscreen, PID: 23581
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)
Does anyone knows what this means? I'm not using PGraphics, so I don't understand why it comes with an PGraphics error!
Regards, Daantje
Open android camera using APDE
hi. Anyone can help me how to open camera android with APDE, like Capture in processing. Many thanks
How to access android device camera?
I would like to know if I can somehow access the android phone or tablet camera with processing, take a picture and load it in the sketch.
Generating Audio in Android (by playing multiple short audio files concurrently)
Hi Everyone
I would like to generate sounds using Processing for Android. The way I would like to do that is by generating individual pulses and varying the timing between them (Shorter interval = higher pitch).
[I'm using this audio to generate haptic feedback - ultimately planning on running an experiment with it, that's why I need this type of low level control over the audio output - I'm essentially trying to recreate something that I have built in MAX/MSP a while ago]
I was hoping to prerecord an impulse and then play it say, every ~20 milliseconds. I just started tinkering with the cassette library for doing this (https://github.com/shlomihod/cassette) however, I am unable to play the same sound multiple times concurrently:
Lets say my audio file is 1 second long and I try to do this:
pulse = new SoundFile(this, "impulse.wav");
pulse.play();
delay(20);
pulse.play();
the second pulse does not play (because the first one is still playing)
I need to do this:
pulse = new SoundFile(this, "impulse.wav");
pulse1 = new SoundFile(this, "impulse.wav");
pulse.play();
delay(20);
pulse1.play();
now I hear both pulses.
Obviously loading the pulse thousends of times on program start is a clumsy way of doing this. Does anyone have any other suggestions on how to set this up? Please not that I need to be able to set the interval between two pulses individually for each interval.
Is this even feasible?
How would you approach this?
Android-Mode doesn't work
Hello all, I tried to get the android-mode working, but unfortunately it won't do it. I downloaded the Android-SDK and updated it with the SDK-Manager right out of processing, but everytime I'm starting processing the following error appears and is keeping being reprinted every few seconds:
Problem inside Devices.list()
java.io.IOException: Cannot run program "adb": CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at processing.app.exec.ProcessHelper.execute(ProcessHelper.java:84)
at processing.app.exec.ProcessHelper.execute(ProcessHelper.java:64)
at processing.mode.android.AndroidSDK.runADB(AndroidSDK.java:371)
at processing.mode.android.Devices.list(Devices.java:292)
at processing.mode.android.Devices.refresh(Devices.java:239)
at processing.mode.android.Devices.findMultiple(Devices.java:184)
at processing.mode.android.AndroidEditor$UpdateDeviceListTask.run(AndroidEditor.java:83)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.io.IOException: CreateProcess error=2, Das System kann die angegebene Datei nicht finden
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 11 more
I added the paths to ".../tools" and ".../platform-tools" manually to the System-variable "PATH" on my Windows-10-Machine, rebooted the machine, but the error keeps appearing. What to do?
Thanks for any helpful advice, Christian
Left and right rectangel
im making a doodle jump game and when a person clickswith a mouse the left side of the screen aPressed(Boolean variable) will be true and when someone presses the right dPressed(Boolean variable ) will be true Thanks so much