with trying to compile and ran the Sketch on the Device itself using the APDE App ?
has anyone got success using the ketai library?...
Text renders behind lines
Hello, I try to show text and lines, but the text should be in the foreground. This does not work. The text is always drawn behind the lines.
I use the OPENGL renderer, because of the fast performance and I have Android 4.4.2.
Here is the code:
void setup()
{
size(720, 1280, OPENGL);
}
void draw()
{
# First draw the line
stroke(#FF0000);
strokeWeight(10.0);
line(0, 0, 500, 500);
# Then draw the text
textSize(37);
text("Hello", 80, 100);
}
Does anyone know, how to change this? I want to have the text in the foreground and not in the background.
Thanks in advance, SimpleProgrammer.
Displaying Paragraph in Android Mode
Hi, I was wondering if anyone could help me with displaying a paragraph in Android Mode. All I want my app to do is display 2 paragraphs, that fill the screen. I believe that I have to put my text in a .txt file, but I do not know what do next. Thanks, in advance
How to search image in android device then loadImage to screen?
- application that you can search every image in your android mobile device
- select image you want
- application show image that you selected
Performance drop when using arc() in android mode
I'm tying to create a HUD for a game, and as part of that, I would like to have arcs representing shields, armor etc. However when I attempt to use arc(), the frame rate drops to around 10, but when I disable them, I get around 35. Has anyone else experienced this or found a fix? I've thought about using curves, but they seem to be a lot of trouble and would make the coding much more complex as they are not meant to be circular sections like arcs. Any suggestions or help would be greatly appreciated! --My phone is running Marshmallow 6.0.1 and I'm using Processing 3.1.1--
Setting Highscore in Android Mode
Hey so I am making an android game and it is complete except I can't figure out how to set a highscore that save after you quit the app. This is my highscore code right now. int[] loadedScores;
void setup(){
String path = "sco.csv";
loadedScores = int(loadStrings(path));
}
void draw(){
if (score>highScore) {
highScore = score;
loadedScores[0] = highScore;
String[] s = str(loadedScores);
saveStrings("sco.csv", s);
}
}
It works if I am in java mode but not if I am Android mode. In Android mode sco.csv must be saved in the data folder to work but in java mode it doesn't just needs to be in the same folder as everything else. Sorry if this doesn't make sense but if someone could help me that would be great.
Getting ready stable release of Android mode
Hello everyone,
I'm aiming to release the stable 3.0 version of the Android mode sometime soon. Right now there is a "Release Candidate" version available, so if you want to try it out to see if there are any major issues, please get it either through the Contribution Manager, or download it manually from the GitHub releases page:
https://github.com/processing/processing-android/releases
Thank you!
Andres
Highscores after exiting
Hey so I am making an android game and it is complete except I can't figure out how to set a highscore that save after you quit the app. This is my highscore code right now. int[] loadedScores;
void setup(){
String path = "sco.csv";
loadedScores = int(loadStrings(path));
}
void draw(){
if (score>highScore) {
highScore = score;
loadedScores[0] = highScore;
String[] s = str(loadedScores);
saveStrings("sco.csv", s);
}
}
It works if I am in java mode but not if I am Android mode. In Android mode sco.csv must be saved in the data folder to work but in java mode it doesn't just needs to be in the same folder as everything else. Sorry if this doesn't make sense but if someone could help me that would be great.
I already asked this just didnt know how to format yet so reposting
Adding leader boards
I'm making a game for android but I'm having trouble putting together an online leader board system for it. It'd be great if I'm able to integrate Google Play Games leader boards but I unable to find any clear instructions on how to do so.
Any other method to create functional leader boards that you can give is also acceptable. I just need to be able to retrieve the list of scores in order to compare it to the player's score, be able to update the list of high scores with the player's score and display the top scores.
exporting an apk: differences in files created
Hi!
1) Problem: I need to give to another user my application "foo", so that he can install it on his Android tablet.
2) What I did: I pressed the button "Export package", that correctly created the folder "Android" inside my sketch folder. Inside "Android/bin" I could find 3 different apk files: foo_release_signed.apk; foo_release_signed_aligned.apk; foo_release_unsigned.apk. Then I sent the user the file foo_release_signed.apk. He was able to install it and run it (after disabling some security control).
3) Question: Please, can anyone explain me the differences between the 3 apk files? It is the first time I run an operation like this, I'm wondering if I sent the user the right file (it works, ok, but maybe it is better to share another file, I do not know).
Thanks a lot! Valerio
application icon: how to change the default one?
Hi. When I launch my sketch "Foo" in Android Mode (my tablet connected through USB), the sketch is correctly installed on my tablet as the app "Foo". I suppose that the icon automatically created for the application is a default one. How can I create a custom new icon for the app? Is it possible to tell to Processing to associate a custom icon to the sketch? Thanks.
PS: processing 3.0a5, Linux Debian
locationManager declaration broke from Processing2 to Processing3 using Ketai
Hi- I had an app that ran under processing 2.0 / ketai library / gps that I cannot get to run under processing 3.0.
The troublesome declaration is
import android.context.context; import android.location.Location; import android.location.LocationManager; import android.location.LocationListener; import android.location.GpsStatus.Listener; import andorid.os.Bundle;
locationManager LocationManager;
the above line generates "the class "LocationManager" does not exist" in processing 3.0.
I suspect that the error is related to a need to declare a system service context but I do not seem to be able to declare such; every time I do something like
locationManager = (locationManager) getSystemService(Context.LOCATION_SERVICE); something wonky happens and the last declaration above the imports has a semicolon underlined and the message "missing a semicolon ";" "appears.
Any thoughts?
would prefer to bring app up to speed on processing 3.0 - I love the editor!
Thanks for suggestions in advance.
compiling for api 19 btw, and yes, android manifest has proper decs.
Thanks in advance
73 de Joe KI7WV
The processing environment was used to complete this app and post it on the Google Play - so yes it is possible! www.playacompass.com
Bug in compilation in Android Mode 4
Hi. I'm building an application with music. I've imported libraries (I've tried some libraries) and when I run the application There is no error. However, the application crashes when I open it. Anyone knows why?
Smartwatch
Hey guys I am struggling with the moto360 v1 and android wear app.
I can get into debugging mode and get host and destination connected, but if I am starting processing, the host get disconnected. And if I am trying to connect it with the command this appears
Tuan-404-not-found:~ anhtuanha$ adb forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444
connected to localhost:4444
Tuan-404-not-found:~ anhtuanha$ adb forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444
adb server is out of date. killing...
* daemon started successfully *
error: device '(null)' not found
error: device '(null)' not found
unable to connect to localhost:4444
First part is when Processing is not started. After that the adb server is out of date....
Does someone experienced this before?
Would be very thankful if someone could help me.
cheers Twan
Android processing app crashes when using usb / processing serial library (Serial.list(this)) probs
hi - I'm having trouble debugging why my android app is crashing when trying to use processing android serial to talk via Processing android app to arduino. i can successfully install and launch the app on android, but the app keeps crashing. I'm using really simple code just to see if I can talk via an OTG cable via serial from Android to Arduino via processing app. But when I plug in the OTG USB cable that's plugged into arduino UNO, I can choose the android app to open up that I have installed from Processing to android, but right away it says "Unfortunately, this app has stopped".
I'm wondering how to go about debugging this. Is it the wrong port (Serial.list(this)[0]) that is doing this? or something else? I'm not sure how to debug why the app's crashing. I just recently started using Processing 0251 for Android. Even just the line "println(Serial.list(this));" triggers the app to shut down.
Thanks in advance!
I used this link to help getting set up:
Processing code in Android mode:
import com.yourinventit.processing.android.serial.*;
Serial SerialPort;
boolean Toggle;
void setup()
{fullScreen();
background(255,0,0);
println(Serial.list(this)); //this line alone makes the app crash even if i dont have any other code
SerialPort = new Serial(this, Serial.list(this)[0], 9600);
}
void draw()
{
}
void mousePressed() {
Toggle = !Toggle;
// while (SerialPort.available() > 0) {
SerialPort.write( Toggle?"1":"0");
// }
}
Arduino Code:
#define NUMBER_OF_CHANNELS 8
#define PINLED1 13
volatile char lastReceivedCharFromSerialIn = '\0';
void setup() {
pinMode(PINLED1, OUTPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite( PINLED1, lastReceivedCharFromSerialIn == '1');
}
void serialEvent() {
while (Serial.available()) {
// get the new byte:
lastReceivedCharFromSerialIn = (char)Serial.read();
}
}
Importing code into processing
Hi I am trying to use a color picker for my android application. I am borrowing some available code from the web however I failed at implementing the code. I am using the class ColorPickerDialog available in the following link:
[stackoverflow.com/questions/6980906/android-color-picker](Color Picker, 3rd post)
However, to implement this is not is not straight forward to me. I think I am failing at this because of the activity life cycle concepts working with this type of code. I have implemented (borrowed some code) successfully https://forum.processing.org/two/discussion/comment/69600/#Comment_69600 and toggle buttons before by adding them to the current view group during the OnCreate function call in the processing sktch. I have also implemented Toast messages through a Thread call associated to the current activity. For this code from the link I have few challenges:
First the main class, ColorPickerDialog extends from the dialog class. I have a feeling it behaves as toast messages except there is a need for user input before a dismiss() function is called and returns to the previous part of the program. Int he code, it defines the class ColorPickerView that extends from the View class. It is in the constructor of the main class (ColorPickerDialog) where it instantiates the view object and it is there when it gets associated to the ViewGroup. What changes should I implement to be able to re-use this class in processing?
Adding to my current state of confusion is the definition of OnColorChangedListener which is defined inside the main class ColorPickerDialog and the listener implemented in its constructor. However if I want to use it in processing then it needs to be defined in the processing sketch. This brings my last question. In the code from the aforementioned website, they define an OnCreate function call within the class. Should I scrap that method and implement it in processing (or should I override it?)
I have a feeling that this code have to be completely modified to be able to re-use it. An idea would be if I could make ColorPickerDialog extend from both Dialog and View classes but I am not sure if this would make sense. I still not sure how to address the listener class call. I think it could be as simple as what is presented in previous posts but I am not sure.
Thanks for your comments,
Kf
Cool Browser
I have heard cool Browser is the best and fastest browser till date.
Smartphone to PC Communication, Please resolved.
Good morning. Nice to meet you.
I am making an application through the process. Please refer to the pdf file.
- computers and mobile phones to communicate.
- UDP or TCP communication possible?
Please help me. request. I'll wait for quick answers. Thanks.
E-mail : myksj1105@hanmail.net

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");
}
No devices connected shown
Hi everybody!
I am new to processing and i want to start with android mode. I did it successfully in windows but not in xubuntu.
Already downloaded SDK and then adb. if i restart the server (adb kill/start-server) and close processing when i press adb devices it shows me
sudo adb devices
List of devices attached
adb server is out of date. killing...
* daemon started successfully *
0123456789ABCDEF device
ELSE
List of devices attached
adb server is out of date. killing...
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error:
error:
while my device never appears in connected devices.
Everything was just downloaded today so i think nothing out of date.
My phone is THL W200. I read that some phones such as HTC uses some adb different from other phones that is the cause of my problem.
But the problem remain like this: THL phones are not in google adb drives so i dont know how to configure them. I downloaded the universal usb adb driver when i were in windows but i cant find around anyone for linux.