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

PShader on Android devices - works on my tablet, not on my phone

$
0
0

Hi I have this nice shader that I've got working on my Android tablet (it's a Hudl 2). But when I connect my Galaxy S6 and run the exact same sketch, it won't run - showing a 'unfortunately the app has stopped' error.

It's something to do with the shader code - as when I comment out all shader commands in my sketch, it runs fine, but just shows a blank screen obviously.

Here's the sketch

PShader wavelight;

float t =1.0;

void setup() {
  //fullScreen(P2D);
  size(800, 400, P2D);
  ////fullScreen(P3D);
  //background(0);
  //noStroke();
  //frameRate(60);

  wavelight = loadShader("wavefrag.glsl");
  wavelight.set("iResolution", 800, 400);
  //wavelight.set("test",10);
}

void draw() {
  //wavelight.set("iResolution", 800, 400);
  background(0);


  shader(wavelight);
  wavelight.set("iGlobalTime", t);
  beginShape(QUAD);
  vertex(0, 0, 0, 0);
  vertex(width, 0, 1, 0);
  vertex(width, height, 1, 1);
  vertex(0, height, 0, 1);
  endShape();
  t+=0.02;
}

and here's the shader

precision mediump float;
precision mediump int;

uniform ivec2 iResolution;// = ivec2 (800,600);
uniform float iGlobalTime;
// uniform int test;


void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = vec2(0.0);
    uv.x = fragCoord.x / float(iResolution.x);
    uv.y = fragCoord.y / float(iResolution.y);

    // uv.x = fragCoord.x / 800.0;
    // uv.y = fragCoord.y / 400.0;


    //fragCoord.xy / iResolution.xy;

    vec4 color = vec4(uv,
                      0.5f+0.5f*sin(iGlobalTime),
                      1.0f);

    vec4 color2 = vec4(1.0f - ((uv.x + uv.y) / 2.0f),
                       uv,
                       1.0f);

    vec2 pos = uv*2.0f-1.0f;

    color *= abs(1.0f/(sin(pos.y + sin(pos.x + iGlobalTime)*.7)*sin(iGlobalTime*.5)*20.));

    color += color2 * abs(1.0f/(sin(pos.y + cos(pos.x*0.5f + iGlobalTime)*.8f)*10.0f));

    fragColor = color;
  // fragColor = vec4(0.5);
}

void main() {
  // float fc = 0.0;
  mainImage(gl_FragColor, gl_FragCoord.st);

}

I've pasted the compile log below in case it offers up any clues, many thanks..

[mkdir] Created dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin
 [echo] org.eclipse.jdt.core.JDTCompilerAdapter

-set-mode-check:

-set-debug-files:

-check-env: Android SDK Tools Revision 25.1.7 Installed at /Users/glenn/Desktop/AmbiArt/modes/AndroidMode/sdk

-setup: [echo] Project Name: WavelightAnd Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup: Using latest Build Tools: 24.0.0 [echo] Resolving Build Target for WavelightAnd... Project Target: Android 6.0 API level: 23 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res [mkdir] Created dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/rsObj [mkdir] Created dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/rsLibs [mkdir] Created dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/gen [mkdir] Created dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/classes [mkdir] Created dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/dexedLibs [echo] ---------- [echo] Resolving Dependencies for WavelightAnd... Library dependencies: No Libraries


 [echo] ----------
 [echo] Building Libraries with 'debug'...

[subant] No sub-builds to iterate on

-code-gen: Merging AndroidManifest files into one. Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... Generating BuildConfig class.

-pre-compile:

-compile:

[javac] Compiling 4 source files to /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/classes

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 4) import processing.data.*; ^^^^^^^^^^^^^^^

The import processing.data is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 5) import processing.event.*; ^^^^^^^^^^^^^^^^

The import processing.event is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 8) import java.util.HashMap; ^^^^^^^^^^^^^^^^^

The import java.util.HashMap is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 9) import java.util.ArrayList; ^^^^^^^^^^^^^^^^^^^

The import java.util.ArrayList is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 10) import java.io.File; ^^^^^^^^^^^^

The import java.io.File is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 11) import java.io.BufferedReader; ^^^^^^^^^^^^^^^^^^^^^^

The import java.io.BufferedReader is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 12) import java.io.PrintWriter; ^^^^^^^^^^^^^^^^^^^

The import java.io.PrintWriter is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 13) import java.io.InputStream; ^^^^^^^^^^^^^^^^^^^

The import java.io.InputStream is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 14) import java.io.OutputStream; ^^^^^^^^^^^^^^^^^^^^

The import java.io.OutputStream is never used

  1. WARNING in /private/var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/src/processing/test/wavelightand/WavelightAnd.java (at line 15) import java.io.IOException; ^^^^^^^^^^^^^^^^^^^

The import java.io.IOException is never used

10 problems (10 warnings)

-post-compile:

-obfuscate:

-dex: input: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/classes input: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/libs/processing-core.jar Pre-Dexing /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/libs/processing-core.jar -> processing-core-0a0bc9b329456db55de7f57883eb70ba.jar Converting compiled files and external libraries into /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/classes.dex... [dx] Merged dex #1 (8 defs/4.6KiB) [dx] Merged dex #2 (160 defs/685.1KiB) [dx] Result is 168 defs/822.5KiB. Took 0.5s

-crunch: [crunch] Crunching PNG Files in source dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/res [crunch] To destination dir: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res [crunch] Processing image to cache: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/res/drawable-hdpi/icon.png => /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-hdpi/icon.png [crunch] (processed image to cache entry /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-hdpi/icon.png: 52% size of source) [crunch] Processing image to cache: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/res/drawable-ldpi/icon.png => /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-ldpi/icon.png [crunch] (processed image to cache entry /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-ldpi/icon.png: 0% size of source) [crunch] Processing image to cache: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/res/drawable-xhdpi/icon.png => /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-xhdpi/icon.png [crunch] (processed image to cache entry /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-xhdpi/icon.png: 74% size of source) [crunch] Processing image to cache: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/res/drawable-xxhdpi/icon.png => /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-xxhdpi/icon.png [crunch] (processed image to cache entry /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-xxhdpi/icon.png: 80% size of source) [crunch] Processing image to cache: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/res/drawable-xxxhdpi/icon.png => /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-xxxhdpi/icon.png [crunch] (processed image to cache entry /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable-xxxhdpi/icon.png: 95% size of source) [crunch] Processing image to cache: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/res/drawable/icon.png => /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable/icon.png [crunch] (processed image to cache entry /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/res/drawable/icon.png: 84% size of source) [crunch] Crunched 6 PNG files to update cache

-package-resources: Creating full resource package... [aapt] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.

-package: Current build type is different than previous build: forced apkbuilder run. Creating WavelightAnd-debug-unaligned.apk and signing it with a debug key...

-post-package:

-do-debug: Running zip align on final apk... [echo] Debug Package: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/WavelightAnd-debug.apk [propertyfile] Creating new property file: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/build.prop [propertyfile] Updating property file: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/build.prop [propertyfile] Updating property file: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/build.prop [propertyfile] Updating property file: /var/folders/1m/0lm790_17_xcsbjk5wtxs03r0000gn/T/android2114381809080553900sketch/bin/build.prop

-post-build:

debug:


how can I use gif's in android mode?

$
0
0

Hi everyone !!

I need with the gif's in android mode. GifAnimation library is not working on adroid mode. I have tried running my on android. It works on PC but crashes at start on android. Here's an example :

import gifAnimation.*;

Gif loopingGif;

public void setup() {
  size(400, 200);

  loopingGif = new Gif(this, "lavalamp.gif");
  loopingGif.loop();
}

void draw() {
  background(255);
  image(loopingGif, 10, 10);
}

I have coded the entire thing but it dosent works on android.. Need some suggetions.

Thanks a lot !

Randomly getting NullpointerException android.graphics.Canvas.drawColor(int)

$
0
0

The app crashes right on start, 80% of the time. Well, for the rest 20% of the time, it runs fine....

I get this on logcat:

07-09 19:29:02.437: E/AndroidRuntime(22753): FATAL EXCEPTION: Animation Thread 07-09 19:29:02.437: E/AndroidRuntime(22753): Process: processing.test.myHeart, PID: 22753 07-09 19:29:02.437: E/AndroidRuntime(22753): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Canvas.drawColor(int)' on a null object reference 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PGraphicsAndroid2D.backgroundImpl(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PGraphicsAndroid2D.backgroundImpl(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PGraphics.background(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PGraphics.defaultSettings(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PGraphics.checkSettings(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PGraphicsAndroid2D.beginDraw(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PApplet.handleDraw(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at processing.core.PApplet.run(Unknown Source) 07-09 19:29:02.437: E/AndroidRuntime(22753): at java.lang.Thread.run(Thread.java:818)

I dont remember calling any of these functions directly....

import java.io.InputStream etc warning errors; println does not print to console

$
0
0

Hello All,

I am having difficulties using loadStrings() and saveStrings in Processing 3.0. I'm not sure that I have Processing configured correctly, as I am receiving a large number of warning errors (see below). Also, simple functions like println do not write to the console from my android device in debug mode. In some locations of my code, "PApplet.println" is not underlined in red, in others it is. However, in no instances do I see output to the console.

My environment is a Windows 7 machine, Android Nexus 7 (Android Version 6.0.1) and a Motorola Maxx (Android Level 4.4.4). The selected Development level is 4.4.2 (API 19). Only library included is Ketai v 12.

Does this suggest anything to anyone?

Thank you for the assistance.


  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 4) import processing.data.*; ^^^^^^^^^^^^^^^

The import processing.data is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 5) import processing.event.*; ^^^^^^^^^^^^^^^^

The import processing.event is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 6) import processing.opengl.*; ^^^^^^^^^^^^^^^^^

The import processing.opengl is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 9) import java.lang.Math.*; ^^^^^^^^^^^^^^

The import java.lang.Math is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 11) import java.util.HashMap; ^^^^^^^^^^^^^^^^^

The import java.util.HashMap is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 12) import java.util.ArrayList; ^^^^^^^^^^^^^^^^^^^

The import java.util.ArrayList is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 13) import java.io.File; ^^^^^^^^^^^^

The import java.io.File is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 14) import java.io.BufferedReader; ^^^^^^^^^^^^^^^^^^^^^^

The import java.io.BufferedReader is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 15) import java.io.PrintWriter; ^^^^^^^^^^^^^^^^^^^

The import java.io.PrintWriter is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 16) import java.io.InputStream; ^^^^^^^^^^^^^^^^^^^

The import java.io.InputStream is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 17) import java.io.OutputStream; ^^^^^^^^^^^^^^^^^^^^

The import java.io.OutputStream is never used

  1. WARNING in C:\Users\jmiller\AppData\Local\Temp\android2252357659484786681sketch\src\processing\test\playagps\PlayaGPS.java (at line 18) import java.io.IOException; ^^^^^^^^^^^^^^^^^^^

The import java.io.IOException is never used

12 problems (12 warnings)

Broadcast receiver

$
0
0

Hi all,

It seems it was different way to create and register BroadcastReceiver in former times. Could you please advice how to create and register BroadcastReceiver today (Processing v3).

before it was like this (I am using famous example from interent space):

BroadcastReceiver myDiscoverer = new myOwnBroadcastReceiver();

within setup

registerReceiver(myDiscoverer, new IntentFilter(BluetoothDevice.ACTION_FOUND));

public class myOwnBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String discoveredDeviceName = intent.getStringExtra(BluetoothDevice.EXTRA_NAME);

There are problems which blocks the compilation

The class myDiscoverer does not exist

>

Illegal modifier for local class myOwnBroadcastReceiver; only abstract of final is permitted

Please advice how to deal with that? Thanks in advance.

Ketai into eclipse

$
0
0

Does anybody know if I can use the ketai lib in eclipse? Or how do you manage gesture in Eclipse or the Android SDK?

Thanks,

Kf

Android & Processing website

Copy from/to clipboard android mode

$
0
0

I want to just copy and paste simple text from clipboard to my android app in android mode in processing. I have tried all code of processing but it didn't work in android mode. Is there any way to do that in android mode.


Can't get tables demo to run in Processing 3.0 using example from reference

$
0
0

https://processing.org/reference/Table.html

...provides an example of how to create a table in Processing. In Processing 2.0, I was able to successfully have data persist in an android application area, not requiring external storage permission, within the Data folder. However, with Processing 3.0, I cannot get anything to save and reload and cannot test my old code against android 2.x because the current version of 2.x available for download (2.2.1 I believe) has android mode disabled.

Here is an example. I took the example code from the reference, and reduced it further in an attempt to figure out what is going in in 3.0. No Joy despite over a week of futzing with this and loadStrings, saveStrings, loadTable, saveTable, and a seemingly infinite number of possible locations for data files.

I have come to conclude that load and save of strings and tables needs updated documentation, or there is a bug.

Common themes of the errors I have encountered: if saveTable

1) example documentation that includes file names with prefix of "data/" but error message that says "invalid; path separator cannot be used".

2) crash in animation string.

Here is an example: If saveTable is not commented out, the stacktrace at the bottom is generated.

****Can anyone provide a working example of loadString / saveString, or loadTable / saveTable, along with associated directory structure and example file?****

Thank you Joe Miller Tucson

Table table; int xint=0; String xstring;

void setup() {

table = new Table(); xstring = "0"; xint = int(xstring);

table.addColumn("id"); table.addColumn("x");

TableRow newRow = table.addRow(); newRow.setInt("id", table.lastRowIndex()); newRow.setString("x", xstring);

saveTable(table, "data/tabledemo.csv"); }

void draw() { println(xint); xint=xint+1; }

/* FATAL EXCEPTION: Animation Thread Process: processing.test.tabledemo, PID: 4624 java.lang.IllegalArgumentException: File data/tabledemo.csv contains a path separator at android.app.ContextImpl.makeFilename(ContextImpl.java:2288) at android.app.ContextImpl.getFileStreamPath(ContextImpl.java:1079) at android.content.ContextWrapper.getFileStreamPath(ContextWrapper.java:195) at processing.core.PApplet.sketchPath(Unknown Source) at processing.core.PApplet.savePath(Unknown Source) at processing.core.PApplet.saveFile(Unknown Source) at processing.core.PApplet.saveTable(Unknown Source) at processing.core.PApplet.saveTable(Unknown Source) at processing.test.tabledemo.tabledemo.setup(tabledemo.java:36) 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) */

Error after starting IDE: Problem inside Devices.list()

$
0
0

I could not find anything on this. But I do not get anything running.

this error message starts to pop up in the console 2 seconds after starting the processing IDE in Android Mode. No difference with or without device attached.

Mac OS 10.11.5 processing 3.1.1 Android 3.0

Error Message:

Problem inside Devices.list() java.io.IOException: Cannot run program "adb": error=13, Permission denied 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:445) 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: error=13, Permission denied at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:248) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 11 more

what could that be. adb is installed and works.

exposure value of android camera

$
0
0

hi guys. anyone can help how to set minimum exposure value of android camera programatically. thanks

Ketai Camera very small display

$
0
0

Hi everyone, I´m starting to use the ketai 'CameraGettingStarted' example. I can compile it well and run on my device, but the image display is a square very small. I only change the Image parameter this is the code. Thanks in advance:

/** *

Ketai Sensor Library for Android: http://KetaiProject.org

* *

<

p>Ketai Camera Features: *

    *
  • Interface for built-in camera
  • *
  • TODO: fix HACK of camera registration that currently exceptions in setup() at the moment.
  • *
  • Updated: 2012-10-21 Daniel Sauter/j.duran

    */

import ketai.camera.*;

KetaiCamera cam;

void setup() { orientation(LANDSCAPE); imageMode(CENTER); textSize(45); }

void draw() {

if(cam != null && cam.isStarted()) image(cam, 0,0); else { background(128); text("touch to activate", 100, height/2); } }

void onCameraPreviewEvent() { cam.read(); }

// start/stop camera preview by tapping the screen void mousePressed() { //HACK: Instantiate camera once we are in the sketch itself if(cam == null) cam = new KetaiCamera(this, 640, 480, 24);

if (cam.isStarted()) { cam.stop(); } else cam.start(); } void keyPressed() { if(cam == null) return;

if (key == CODED) { if (keyCode == MENU) { if (cam.isFlashEnabled()) cam.disableFlash(); else cam.enableFlash(); } } }

Clean Exit - Question

$
0
0

Hi All, I have a gps app (github/pocojoe/playagps) that is processing 3.0 and ketai based. I need to stop listening to the GPS receiver when the app does not have focus (ie, activity is running, and processing owns the screen). In order to invoke the call to allow ketai location manager override to stop listening, I have overridden onStop(); and onDestroy() to a) buffer the state of the navigation function, and b) turn off the power supply to the reciever, to stop battery drain.

I did this because the back and home buttons, always displayed, are how the user exits a processing app.

In this manner, when home and back are pressed, the call to halt the gps occurs, and processing exits- but the OS complains with "Unfortunately, PlayaGPS has stopped".

My reading suggests that this is due to overriding onStop() and onDestroy(); resulting in Draw being interrupted, and when the activity changes state, the OS complains.

This may mean that to exit the user will just need to tap twice - once for either home or back, and again to close the "Unfortunately" dialog box. If this is the case, I am fine with it- it is just a cost of the convenience of having all the cool functionality that Processing affortds.

On the other hand, if I am missing some call that Processing ALWAYS INVOKES upon getting tapped on the shoulder with a back or home tap, please let me know. Perhaps there is a call (?exit()) where I should put my "turn off the reciever code".

Thanks to all the developers.

Joe

APDE on a chromebook thanks to recent changes to chromeOS?

$
0
0

Hi internet, There was a recent change to chromeOS to allow android apps to function on chromebooks. I was curious if you know of anyone who has tried to use processing for android to get the IDE working on a chromebook. Seems like that would be much simpler than the alternative. thanks in advance, Chris

Control P5 ListBox - how to view long string item

$
0
0

I am guessing that this is not possible but here goes: I am using Control P5 ListBox to list SMS in Android Mode. Everything works great and the ListBox is scrollable so I can scroll down to see older messages, the only problem is that the occasional SMS is too long for the screen (it just disappears like thi)

So my question is, can I make the ListBox horizontally scrollable somehow, or is there some other way to see the whole of each SMS in the ListBox? Like auto line feed? So far I can't see it.

By the way this is not a problem that is specific to Android, the ListBox example will exhibit the same issue if you make the ListBox the same size as the sketch size() and input some long strings. It is more of a problem on android because of the smaller screen (I am using a Tablet but still...)

If anyone has any ideas for me to try I would be grateful.


Device shows but does not not run on Android device

$
0
0

Hello I am using an ODYS 7 Connect Pro Tablet. I also have Android Studio and Processing. I wish to work with my tablet in Processing's Android Mode. I have used Android Studio to run a couple of test apps on my tablet which works perfect using the USB Connection. However in Processing the Tablet is listed as a device but fails to run. I believe I have installed the necessary USB Driver at least that is what the windows device manager says. Any tips on what I can do?

Android error: onRequestPermissionsResult (...) must override a superclass method

$
0
0

My very basic processing sketch runs fine in Java mode. When I switch to android mode and try to start it I get the following error:

---------- 2. ERROR in /tmp/android3694888906208887174sketch/src/processing/test/test/MainActivity.java (at line 58) public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The method onRequestPermissionsResult(int, String[], int[]) of type MainActivity must override a superclass method ----------

I have tried reinstalling Processing, Java and Android-SDK. I couldn't find a similar issue on google. I have tried various target SDK's, and both emulator and real device. I get the same error each time. Any advice on solving this error is appreciated. Processing: 3.1.1 Android SDK: 25.1.7 Java: 1.8.0_101 All running on Linux Mint 17

Build Error. Please help

$
0
0

Hi everyone,

I am new to Processing for Android. I followed the instruction on the website to install the Android mode and let Processing installed the Android SDK automatically. Then I copied the code from the Getting Started tutorial into the IDE and clicked on Run. Instead of seeing the program run on the device, I got an error message which I shared below.


BUILD FAILED /Users/whoever/Documents/Processing/modes/AndroidMode/sdk/tools/ant/build.xml:483: The SDK Build Tools revision (17.0.0) is too low for project 'sketch_160727a'. Minimum required is 19.1.0

Total time: 0 seconds

Has anybody else run into the same issue? How do I fix it?

I am using Processing 3.1.1 on Mac. I have a first gen Moto X device that runs Android 5.1.

Thanks, unparadise

PImage (error)

$
0
0

HI,

I can not use the PImage in processing-android. gives me error.

how can I use an image ??

Has anyone here tried an Arduino connection to Android using Processing

$
0
0

Hello I have been having some struggles with displaying flowers on my Android. This is what my code does. I have two sensors on the Arduino, photoresistor and motion detector, they both work and what Processing does is to display different modes of a colored flower based on the state of the sensors. I want to create a sort of energy conscious display so people know what is wrong in a room based on the color of the flower. A connection between Processing and Android works(only a test of flower display), so does the connection between Processing and Arduino work(it runs and I see the flower states). How can I get the Android to display my flowers, it seems to me the problem might be from reading the Serial connections....any help?

Android Sketch

#define PIR 3
#define LED 2

int pirState;
int ldrValue;

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  pinMode(PIR, INPUT);
  digitalWrite(LED, LOW);

}

void loop(){
pirState = digitalRead(PIR);
ldrValue = analogRead(LDR)/4;
Serial.write(pirState);
Serial.write(ldrValue);
delay(1000);
}

Processing Sketch //

import processing.serial.*;

Serial port;  // Create object from Serial class

int pirState;
int ldrValue;

void setup(){
fullScreen();
noStroke();
frameRate(15);
printArray(Serial.list());
port= new Serial(this, Serial.list()[0],9600);

}

void draw(){
  if (port.available() > 0) {  // If data is available to read,
    pirState = port.read();
    ldrValue = port.read();            // read it and store it in val
    println(pirState, "and", ldrValue);
    delay(10);
  }
  background(255); // Clear background
    //set center point
    translate(width/2, height/2);
    //rotate canvas using frame count
   // rotate(radians(frameCount+mouseX));
    //draw 5 petals, rotating after each one
    for(int i=0; i<5; i++){
        if (pirState == 0 && ldrValue <= 128) { // no one is in and light is off
        fill(#00ff00);//green
        ellipse(0,-80,100,100);
        rotate(radians(72));
        println("no one is and light is off");
        }
        else if(pirState == 0 && ldrValue > 128){//no one is in and light is on
           fill(#FF0000);//red
        ellipse(0,-80,100,100);
        rotate(radians(72));
        println("no one is and light is on");
        }
         else if(pirState == 1 && ldrValue > 128) { // one is in and light is on
       fill(#FFAA0D);//orange
        ellipse(0,-80,100,100);
        rotate(radians(72));
        println("one is and light is on");
        }
        else if(pirState == 1 && ldrValue <= 128){ //if one is in and light is off
        fill(#00AAFF);//blue
        ellipse(0,-80,100,100);
        rotate(radians(72));
        println("one is and light is off");

    }
    //center circle
    fill(#fff9bb);
    ellipse(0,0,100,100);
 }

How can I connect my Processing output to the Android.

Viewing all 941 articles
Browse latest View live