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

Connecting Android with PC using bluetooth with proximity detection

$
0
0

Hey guys, I am back! And with a question: Can I run a processing program in my PC that detects the proximity of my android smartphone? And use this proximity data to run a sketch in my android? I mean probably both should be running, like: (PC) proximity>5, runs video/ (Android) Proximity<5, runs video. Well, like a program that runs in PC and android using the same data (Bluetooth). I read about Ketai, and I think it's a good start....


Getting ready stable release of Android mode

$
0
0

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

HTTP-Requests library on Android, FATAL EXCEPTION issue

$
0
0

i'm testing with really simple android app which save the captured image then upload to the server on each time during the http post session the app got crashed,reported as following:

FATAL EXCEPTION: Animation Thread java.lang.NoSuchMethodError: org.apache.http.util.EntityUtils.consume at http.requests.PostRequest.send(Unknown Source) at processing.test.android_image.android_image.postImg(android_image.java:145) at processing.test.android_image.android_image.draw(android_image.java:56) 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)

but without any issue running on desktop. any ideas?

Picture Server/Sender

$
0
0

For my design project I need to make an application that can make pictures and from there send them to a server (a map or something on a computer). From there it needs to be** sended to a tablet** that displays all the pictures that are stored in the server in a** slideshow**. I'm not even sure if this is possible in processing. I can really use some of your guys help.

Thanks!

example program is not runing on my android mobile?

$
0
0

I m new to processing android mode. I have downloaded processing 3.0.1 and android mode. The issue is a simple example program is not running on my phone. The program is an animation which is running in java mode. how to run it on my phone?

how can i activate android Mode?

$
0
0

스크린샷 2016-03-28 오후 9.43.07

from this image, the click on the either box(locate sdk path& download sdk auto) doesn't work.

Low frame rate on Android

$
0
0

Hello

I run a sketch that makes 180 ellipses rotating around a point. each of those ellipses are instances of a Satellite Class that render the ellipse using pushMatrix(), translate(...), rotate(...) and ellipse(...)

Running this sketch on my pc , the FPS is stuck at 60, but running it on my Nvidia Shield K1, I get around 30 FPS

-1- is it that demanding to run 180 objects using primitive shapes ?

I tried with a little more complicated shapes, using 4 primitives, it gets to 22 FPS

I tried using PShape to build Shapes of 4 primitives and it gets to 18 FPS

-2- Am I facing a weakness in Processing for android ?

-3- Is there a way to solve that ?

(I tried using P2D and it crashes with "A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x9e5ad000 in tid 17144 (GLThread 46915)" message)

cheers

update: using a 50x50 PGraphics instead of PShape gets me 11 FPS

update 2: I finally got it to run on P2D (I don't know why, I just copied my whole code, classes and all, to a blank app that was running P2D just fine) and here is the result:

with my 180 satellites being mere ellipses my FPS is 25 :(

is anybody here ?

Can't use the method lights() or directionalLight() in my drawing.

$
0
0

All the time I try to use some light releted method like lights() or directionalLight() the console is returning to me the error FATAL EXCEPTION: GLThread 10295 java.lang.NullPointerException. Can someone tell me what could it be?

the drawing method:

void draw(){

    background(0);

    lights(); //because of the method the error happens...

    float tempOrientation = (float) ((int) (accelerometerY * 1000)) / 1000;

    camera(width/2.0 + tempOrientation * width/10, height/2.0, (height/2.0) / tan(PI*30.0 / 180.0), width/2.0, height/2.0, 0, 0, 1, 0);

    pointLight(200, 200, 200, width/2, height/2, 200);

    centerLine();
    drawBall();
    drawPlayer();
    drawEnemy();
    scoreText();

    println("-------");
    println("X: " + accelerometerX);
    println("Y: " + accelerometerY);
    println("Z: " + accelerometerZ);
    println("-------");
}

the error in console:

FATAL EXCEPTION: GLThread 10295
java.lang.NullPointerException
FATAL EXCEPTION: GLThread 10295
java.lang.NullPointerException
    at processing.opengl.PGL.loadVertexShader(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.getPolyShader(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.flushPolys(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.flush(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.endDraw(Unknown Source)
    at processing.core.PApplet.handleDraw(Unknown Source)
    at processing.opengl.PGLES$AndroidRenderer.onDrawFrame(Unknown Source)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1524)
    at processing.opengl.PGL.loadVertexShader(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.getPolyShader(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.flushPolys(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.flush(Unknown Source)
    at processing.opengl.PGraphicsOpenGL.endDraw(Unknown Source)
    at processing.core.PApplet.handleDraw(Unknown Source)
    at processing.opengl.PGLES$AndroidRenderer.onDrawFrame(Unknown Source)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1524)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)

How to send HTTP POST containing JSON body

$
0
0

I'm trying to use the 'HTTP Requests for Processing' library, but it seems to be specifically tailored to sending form-encoded requests. Is anyone able to use this to make calls against a REST API with JSON content?

FX2D & Android

$
0
0

Testing my sketch on PC, I see that the FX2D render just blows everything in terms of performance

So I spontaneously think that this is the renderer I need to use for the Android version of my sketch... but FX2D is not available on Android.

Yet I see links ( 1 and 2 ) explaining that javaFX can work good in Android.

Wouldn't it make sens to try that ?

Anyone with experience in that ?

Error 2 -> Ubuntu 14.04 + Processing 3.0b5

$
0
0

Hi there,

I have a problem running processing in linux. Ubuntu is my only OS, so no other systems installed (Winodws or similar). I belive I have Java correctly installed. If I enter echo $JAVA_HOME, I get the right answer -> /usr/lib/jvm/.

If I check in console the java version I get this java version "1.7.0_95" OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.2) OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

If I check javac version -> javac 1.7.0_95

If I try to compile a simple sketch in processing, I get Error 2 -> JAVA_HOME is set to: /home/gorazd/Dokumenti/processing-3.0b5/java

I'm trying to figure it out why is Processing trying to get java from other location ?

Update it if necessary, or manually execute the following command: /home/gorazd/Dokumenti/processing-3.0b5/java/bin/keytool -genkey -alias AndroidDebugKey -keyalg RSA -dname "CN=Android Debug,O=Android,C=US" -validity 10950 -keypass android -keystore

This statement fails miserably, there is no keytool in this directory.

I have to state, that I'm not a Linux power user - I'm still a rookie and my linux knowledge is very limited. So If there is anyone kind enough to give me some step by step answer / help I would very appreciate.

Regards.

RFID USB Device link with Android Processing mode

$
0
0

I am newbie in android mode processing. I would like to seek help for RFID USB Device, which I would like to use to tap a card to retrieve the value from card to my processing android app. I am unable to use the serial connection in Android Mode. Can anyone help me in this? How else can I connect my RFID USB Tag reader in processing? Hope someone could help. Thank you.

pixelDensity() in Android

$
0
0

is it me or is it that pixelDensity() is not available in Android Mode ?

Android programming laggy on phone

$
0
0

I made this casino app and when I run it on my phone it's quite laggy, I ran it on my brothers better phone and it still lagged. When I switched it to normal java mode and ran it, it was fine. Will it lag to user when I export it and post it or is there anyway I can stop the lag .

Android game lagging

$
0
0

Hello im making a game in processing for android.. When i run my project using Java in pc it runs smooth.. But when i choose Android mode to run it on my phone (xiaomi mi2s) its laggy when moving with my "player" Player uses 3 states - jump,run,walk. I think there is problem with the Animation . Is there iny "thread" like in Java ? Or any sugestions? Thank you


Does Anybody Need A Keyboard For Android Mode?

$
0
0

Hi,

I needed to bet text input for a sketch on a mobile device that I'm making and ended up making my own keyboard that adjusts to whatever resolution it's displayed on (including when the user changes orientation of course). Is anybody else interested in obtaining this at all? (if there is interest I'll post the code) Screenshots below:

laptop Screenshot_2016-04-18-13-38-49 Screenshot_2016-04-18-13-39-01 Screenshot_2016-04-18-13-39-37

Usage of library code sample for face recognition not work

$
0
0

Hello I Have found this library for processing for face recognition on google code p-eingenfaces. I have create a skecth for android mode from this sample: [code] // This example is based on a subset of the Face94 data set from Math-Intersect-Programming // The original data can be found here: http://code.google.com/p/math-intersect-programming/downloads/list // M-I-P's blog post on the topic can be found here: http://jeremykun.wordpress.com/2011/07/27/eigenfaces/ // Download the P-Eigenface library for Processing here: https://code.google.com/p/p-eigenface/

import cern.colt.*; import peigenface.*; import java.lang.reflect.Field;

PEigenface face;

int imgW = 180; int imgH = 200;

String[] testFilenames; String[] trainingFilenames;

PImage[] trainingImages; PImage[] eigenfaces;

PImage matchingImage; String matchingImageFilename; PImage testImage; String testImageFilename;

int mostInfluentialEigenface; PImage currentEigenface;

public void setup() { size(540, 762);

// load all the sample face images for training java.io.File trainingFolder = new java.io.File(dataPath("data/faces94/samples")); trainingFilenames = trainingFolder.list(); trainingImages = new PImage[trainingFilenames.length];

for (int i = 0; i < trainingFilenames.length; i++) { println("faces94/samples/" + trainingFilenames[i]); trainingImages[i] = loadImage("data/faces94/samples/" + trainingFilenames[i]); }

println(trainingImages.length + " training Images");

// initialize our eigenface recognizer with the training images face = new PEigenface(this); face.initEigenfaces(trainingImages);

// get our actual eigenface images // (these are the visual representation of what // is unique about each face relative to the others.) eigenfaces = getEigenfaces();

// load up our test images java.io.File folder = new java.io.File(dataPath("data/faces94/tests")); testFilenames = folder.list();

// test a new image testNewImage(); } public void draw() { image(currentEigenface, 0, 0);

image(testImage, imgW, 0); text("TEST:\n" + testImageFilename, imgW, imgH - 25);

image(matchingImage, imgW * 2, 0); text("MATCH:\n" + matchingImageFilename, imgW * 2, imgH - 25);

drawAllEigenfaces(); }

// draw the eigenfaces in a grid // with a red rectangle around the // one that makes up the principle component // for the current test image void drawAllEigenfaces() { int i = 0; int col = 0; int row = 0; while (i < eigenfaces.length) { image(eigenfaces[i], col54, imgH + row54, 54, 54);

if (i == mostInfluentialEigenface) {
  stroke(255, 0, 0);
  noFill();
  rect(col*54, imgH + row*54, 54, 54);
}

i++;
col++;
if (col > 9) {
  col = 0;
  row++;
}

} }

void testNewImage() { // load a random image from the test folder int testImageNum = int(random(0, testFilenames.length-1)); testImage = loadImage("data/faces94/tests/" + testFilenames[testImageNum]); testImageFilename = testFilenames[testImageNum];

// find the matching image for our test image from the training images int resultImageNum = face.findMatchResult(testImage, trainingImages.length); matchingImage = trainingImages[resultImageNum]; matchingImageFilename = trainingFilenames[resultImageNum];

// measure the weights: how much did each eigenface // contribute to the current test image double[] weights = face.getWeights(face.getBrightnessArray(testImage), trainingImages.length);

// find the index of the one that contributed the most // (i.e. with the max weight) double maxWeight = -10000; for(int i = 0; i < weights.length; i++){ if(weights[i] > maxWeight){ mostInfluentialEigenface = i; maxWeight = weights[i]; } } currentEigenface = eigenfaces[mostInfluentialEigenface];

}

void keyPressed() { testNewImage(); }

// This funciton gets the array of eigenface images // out of PEigenface. It is ugly because it uses some java // magic to extract a non-public variable. PImage[] getEigenfaces() { PImage[] result = new PImage[trainingImages.length]; try { Class c = face.getClass(); Field field = c.getDeclaredField("imagesEigen"); field.setAccessible(true); result = (PImage[])field.get(face); } catch(Exception e) { println(e.toString()); } return result; } [/code]

compiled for android is ok but when run i have this:

FATAL EXCEPTION: Animation Thread Process: processing.test.eigenfaces, PID: 1898 java.lang.NullPointerException: Attempt to get length of null array at processing.test.eigenfaces.eigenfaces.setup(eigenfaces.java:58) 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:818)

Can some one help me ? Thanks

How to deal with "error from inside the android tools check the console"

$
0
0

Hello guys, I am new here, and recently I've been trying to use the Ketai library to make some android apps, most examples in the Ketai Library work well, except the bluetooth and wife which are the most important parts in my project. And it just shows "error from inside the android tools check the console" when I ran the program. I mean the camera accelerator and locations all work perfectly. I really confusing and hope anyone could give me some help. Thanks

-

Slow down each draw

$
0
0

Hello... I have main class. It ofcourse containse Draw(fps 24),setup... in Main draw i call funtion enemy.draw(); Enemy draw i have animation which i need to slow down rapidly...Something around 4+/- fps (I want to slow it down , not to make it laggy). Can you guys help me please? Thnaks :)

Animation doesnt work...Urgent help

$
0
0

`void enemyMove(){

for(int i=0;i<World.WIDTH;i++) { for(int j=0;j<World.HEIGHT;j++) { if(newWorld.LEVEL[j][i]==World.ENEMY) { print(newWorld.LEVEL[j][i]); if(newWorld.LEVEL[j][i-1] == World.WALL){ print("Wall left"); smer = 1;

   }
   else if(newWorld.LEVEL[j][i+1] == World.WALL){
     print("Wall right");
     smer = -1;
   }
   newWorld.LEVEL[j][i+(smer)] = World.ENEMY;
   newWorld.LEVEL[j][i] = World.SPACE;


   }
 }

} }`

Viewing all 941 articles
Browse latest View live