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

Ketai sqlite can't locate database?

$
0
0

I'm using this example on how to load an external SQLite db. with ketai: http://ketai.org/examples/externalsqliteloading/

I've put the to databases (sample.sqlite & large.sqlite) in almost every path I could imagine it would load from:

Dir's where the databases are

  • /data/data/
  • /data/data/processing.test.externalsqliteloading/
  • /data/data/processing.test.externalsqliteloading/data/ (created that dir myself)
  • /data/data/processing.test.externalsqliteloading/files/

But I still get errors saying, "Failed to load SQLite file(not found): large.sqlite/sample.sqlite Any ideas why? Is it because of permissions, wrong path or bug in library?

The main goal is to download a SQLite db using saveStream("url/db.sqlite") and load it using ketaisqlite. saveStream works and puts the files in the /data/data/processing.test.externalsqliteloading/files/ dir which loadStrings also reads from by default.


G4P Library

$
0
0

Is there library like G4P to android mode? If there is, What's its name?

Actual, real world applications & games using Processing

$
0
0

Hello

I am looking at what can be done in terms of actual, real world applications & games using Processing.

This includes both application coming out of the Processing Android IDE and application made with other IDE and using android-core.zip

I have the feeling that there is some kind of a glass door between the artist/designer world of Processing and the Android app / Game Developer world out there

I don't know if this is just a feeling or if it really exists and if yes, if this is based on technical limitations of Processing or on Cultural frontier between the 2 worlds.

And another thing: Can someone show me a Processing based **paid **app or game available on Google play ?

I'd love to have your thoughts on that, and Google play links are very welcome

Problem with setting dynamic width of buttons

$
0
0

Hey,

I'm adding buttons to control a KetaiCamera object. I've tried basing their sizes on the camera size, but whenever I run the sketch, the camera rescales to the next supported size. How could I get the largest supported preview size before I define the buttons?

Fonts behaving unpredictably (Android)

$
0
0

Mode: Android Mode 0232 Renderer: P3D TextMode: PConstants.SHAPE


Issue 1: Some letters not displaying at all

The issue is shown here:

http://imgur.com/a/8iVjy

I am using createFont() in setup with smooth turned on and textFont(), then using textSize() at different points.

The problem appears on some Android devices, on some not. I have tried to look for the problem. I created the following table:

http://imgur.com/8RQNQlA

Could not draw conclusions from it apart from the observation that most vowels display and most consonants don't. Most signs display.


Issue 2: Some letters displayed with stroke

The issue is shown here:

http://imgur.com/uCC54D1

On devices on which the font actually displays, some letters are rendered with stroke, some not. In the picture above, notice how "b" and "d" display differently than the rest. I tried calling noStroke() before text(), but to no avail. Switching from P3D to OPENGL does not solve the problem. Changing the font did not solve the issue either.


Issue 3: textFont not changing the font when called second and all consecutive times.

Since in P3D and OPENGL the fonts are generated as bitmaps in the setup(), different fonts must be instantiated to accomodate for different font sizes. Then, in draw(), textFont() should be used depending on the dimensions of the text which needs to be displayed. That is the way it should work in theory. In practice, however, in my case, calling textFont() works only once, at the beginning. Consecutive calls bear no effect.


Neither issue is, to my knowledge, present with the JAVA2D renderer.

Could anybody point me to the right direction to solve any of the problems?

Thank you in advance.

Any solution for textFont() bug in Android mode?

$
0
0

Any solution for this bug?

In android when you use a text font fail all transparencies of the images and the screen becomes corrupted, you can not use text in android? a temporary solution for working with text in android?

Help With Immersive Fullscreen Mode with Processing 3.0.2 (latest)

$
0
0

Hi all, first of all, sorry for my bad english, i'll try to make mysef understandable. I'm a newbie with app programming and i'm trying to write the code for a little game in Android. I want to implement the Immersive Fullscreen Mode in my project, so i looked for some code to try and i found things like :

paste.ubuntu.com/15299346/

With the first piece of code Processing tells me --> the class View.SYSTEM_UI_FLAG_HIDE_NAVIGATION does not exist """" Bundle """" View

With the second one ---> the method onWindowFocusChanged must override or extend a supertype method and it can't find Bundle, Window and Bundle classes.

Pls, help me

How to take screenshot with processing on Android

$
0
0

I was able to save an image(loaded into processing from it's default "data" folder in computer) to a custom folder in SD card and load it back from there(from where I saved it in the phone). Here's the code(don't smear about it, it's just test code)

What I want to do is, save a screen shot and load it back .

Now I know how to save an image from my computer to a specific folder in Phone and load it back to processing app. But I don't know how to take a screen shot of a certain area or the whole screen in processing Android and save it to a particular folder in the SDcard of the phone.

Can anyone help me here? I took help from this post previously.


saveFrame("/sdcard/img-###.png") fails to be executed at Android Application

$
0
0

Hello dudes,

I am a newbie in using the Processing Language. I have developed a small application which displays randomly circles on the phone screen. Their radius is also one of the first 20 fibonacci numbers in magnitude. I have added a mousePressed() event in order to save my creations. However, my app closes instantly when I touch the screen with my finger. Can you help me in order to solve this problem?

My code:

void setup() {
 size(displayWidth,displayHeight);
 smooth();
 background(random(255),random(255),random(255));

}


void draw() {
  noFill();
  stroke(255);
  strokeWeight(4);
  for(int i=0; i<20; i++) {
    ellipse(random(width),random(height),fibonacci(i)/5,fibonacci(i)/5);
    delay(10);
  }


}

int fibonacci(int n) {
 if (n==0 || n==1) {
  return 1;
 }
 return fibonacci(n-1)+fibonacci(n-2);

}

void mousePressed() {
   saveFrame("/sdcard/img-####.png");
 }


void delay(int ms)
{
   try
  {
    Thread.sleep(ms);
  }
  catch(Exception e){}
}

The Android API I am using is the one recommended by the Processing Wiki.

Thanks in advance!

OSC simple example support using Ketai or not

$
0
0

Just tinkering around. Recently I'm trying to make a simple example where two processing apps talk to each other over OSC (One running in android phone and the other in my computer)..

Now I first tried two apps both running in my computer (Both on local network 127.0.0.1 and swapped their ports) Here are the codes: Message sender (which send a random number every-time you mouse click in the applet window)

import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;

float val;

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

  /* start oscP5, listening for incoming messages at port 12000 */
  oscP5 = new OscP5(this, 12000);

  /* myRemoteLocation is a NetAddress. a NetAddress takes 2 parameters,
   * an ip address and a port number. myRemoteLocation is used as parameter in
   * oscP5.send() when sending osc packets to another computer, device,
   * application. usage see below. for testing purposes the listening port
   * and the port of the remote location address are the same, hence you will
   * send messages back to this sketch.
   */
  myRemoteLocation = new NetAddress("127.0.0.1", 8000);
}


void draw() {
  background(255);
}

void mousePressed() {
  //constitute message:
  OscMessage myMessage = new OscMessage("/print");
  myMessage.add(random(10, 100));
  oscP5.send(myMessage, myRemoteLocation);
}

On the other hand the receiver processing app is kind of like this:

    import oscP5.*;
    import netP5.*;

    OscP5 oscP5;
    NetAddress myRemoteLocation;

    float val;

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

      /* start oscP5, listening for incoming messages at port 8000 */
      oscP5 = new OscP5(this, 8000);
      myRemoteLocation = new NetAddress("127.0.0.1", 12000);
    }


    void draw() {
      background(0);
    }

    void oscEvent(OscMessage theOscMessage) {
     val = theOscMessage.get(0).floatValue();
     println("Val: " + val);
    }

Now they seem to work on the computer ..

I imagined when porting it for android, I should just hardcode the ip-addresses .. But it doesn't work .. Tried to look at some help from the ketai library , but there's no direct example for a simple communication.. One example(wifi_direct_remote_cursor) explains but it's very scattered. I couldn't understand why I need to check if I was on the same network and get client addresses and all ..

Can someone help me establish a simple example like above below , The message sender is the Android app and the message receiver is the computer app ..

Thanks in advance ..

hiding the navigation bar in Android

$
0
0

Hi,

I'm trying to hide the navigation bar when my app is running in Processing for Android. What I mean is the Back, Home and App Switcher icons that appears at the bottom of the Android device. I have tried several methods found on the web but none have worked. Running on latest android 4.4.2.

Any suggestions will be greatly appreciated.

How to take screenshot with processing on Android

$
0
0

I was able to save an image(loaded into processing from it's default "data" folder in computer) to a custom folder in SD card and load it back from there(from where I saved it in the phone). Here's the code(don't smear about it, it's just test code)

What I want to do is, save a screen shot and load it back .

Now I know how to save an image from my computer to a specific folder in Phone and load it back to processing app. But I don't know how to take a screen shot of a certain area or the whole screen in processing Android and save it to a particular folder in the SDcard of the phone.

Can anyone help me here? I took help from this post previously.

OSC simple example support using Ketai or not

$
0
0

Just tinkering around. Recently I'm trying to make a simple example where two processing apps talk to each other over OSC (One running in android phone and the other in my computer)..

Now I first tried two apps both running in my computer (Both on local network 127.0.0.1 and swapped their ports) Here are the codes: Message sender (which send a random number every-time you mouse click in the applet window)

import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;

float val;

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

  /* start oscP5, listening for incoming messages at port 12000 */
  oscP5 = new OscP5(this, 12000);

  /* myRemoteLocation is a NetAddress. a NetAddress takes 2 parameters,
   * an ip address and a port number. myRemoteLocation is used as parameter in
   * oscP5.send() when sending osc packets to another computer, device,
   * application. usage see below. for testing purposes the listening port
   * and the port of the remote location address are the same, hence you will
   * send messages back to this sketch.
   */
  myRemoteLocation = new NetAddress("127.0.0.1", 8000);
}


void draw() {
  background(255);
}

void mousePressed() {
  //constitute message:
  OscMessage myMessage = new OscMessage("/print");
  myMessage.add(random(10, 100));
  oscP5.send(myMessage, myRemoteLocation);
}

On the other hand the receiver processing app is kind of like this:

import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress myRemoteLocation;

float val;

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

  /* start oscP5, listening for incoming messages at port 8000 */
  oscP5 = new OscP5(this, 8000);
  myRemoteLocation = new NetAddress("127.0.0.1", 12000);
}


void draw() {
  background(0);
}

void oscEvent(OscMessage theOscMessage) {
 val = theOscMessage.get(0).floatValue();
 println("Val: " + val);
}

Now they seem to work on the computer ..

I imagined when porting it for android, I should just hardcode the ip-addresses .. But it doesn't work .. Tried to look at some help from the ketai library , but there's no direct example for a simple communication.. One example(wifi_direct_remote_cursor) explains but it's very scattered. I couldn't understand why I need to check if I was on the same network and get client addresses and all ..

Can someone help me establish a simple example like above below , The message sender is the Android app and the message receiver is the computer app ..

Thanks in advance ..

access Global variable from inner Class in android studio

$
0
0

Hi

When I use android in eclipse, I can easily use a global variable (a variable that I have simply declare on the upper part of the Main Class) in an inner class. I just add the name I gave to the parent class to the name of the variable : parent.myVariable

I try to do the same in android studio and I cannot get it to work

Any idea on why it is so ?

cheers

Sketch freezes after running for about one minute

$
0
0

Hi all,

My sketch freezes (image shows last frame rendered, but frozen), then after a while a popup appears telling me the app is not responding and if I want to wait or close it. There are no errors reported on the Processing console on my PC. Any idea where I can look to find the issue?

Regards, XM


Error from inside the Android Tools

$
0
0

Hi,

I am getting a strange errors when compiling sketches for Android. Because if I compile very simple sketches,like the one underneath ,everything works well:

void setup() { size(400, 400, P2D); background(255, 0, 0); fill(255, 150); }

void draw() { ellipse(mouseX, mouseY, 100, 100);
}

But, if I try to compile any sketch that has more elements I get the "Error from inside the Android Tools".

xml:892: The following error occurred while executing this line: /development/android-sdk-macosx/tools/ant/build.xml:894: The following error occurred while executing this line: /development/android-sdk-macosx/tools/ant/build.xml:906: The following error occurred while executing this line: /development/android-sdk-macosx/tools/ant/build.xml:284: null returned: 2

The same SDK I am sing in Processing is working perfectly on Eclipse.

Any clues?

Thank you,

How to make simple Andriod app using processing?

$
0
0

dear friends I m interested in making andriod apps. can anyone explain me how to start? I m a beginner level student. I have made automatic number plate recognition system on windows operating system. If anyone can explain with an example program, I will be very thankful.

Any Qr code library works in Android?

$
0
0

All qr code libs report same error: BufferedImage error class.. Any lib for Android/Processign to process qr codes?

How to hide the bottom menu of Android?

$
0
0

Hi everyone!!

When I run the aplication, in the screen of the smartphone appears the navigation bar (return, home, settings buttons and black background). I modified the manifest.xml, use the sketch permissions, and other code with onCreate() functions, but nothing works. there any way to hide the navigation bar?

I read this: https://developer.android.com/training/system-ui/navigation.html But I don't understand how it works because it's my first time, programing with android. I'm using Android 5.1.1, and Processing 3.0 and the last version of android mode. Sorry for my bad English.

Thanks a lot!

USB communication Arduino Pro Micro / Leonardo and Android

Viewing all 941 articles
Browse latest View live