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

Processing program for development and import (I think)

$
0
0

I like the Processing program, and I use it a lot in the business.

 However, I think you need a sample program and library.

 My thoughts are: What do you need to do in the future of processing and development?

  1. Diversify the library and examples.

  2. Earn money by monetizing some libraries or examples.

  3. I hope to provide a lot of material about Android mode.

The current trend is in building IoT systems. Application development is therefore important. Therefore, it would be nice if processing could provide examples and libraries for Android mode.

Required libraries and examples:

  1. UI (User Interface)
  2. Network (Internet / UDP / TCP)
  3. Bluetooth
  4. NFC TAG
  5. Message
  6. Alarm

(In this version of Android 4, there are no examples or libraries.)


Close connection ocsP5

$
0
0

Hello!

For my android sketch I need to disconnect from my server once the app is put in the background, but I cant find documentation on a disconnect function for ocsP5. Does anybody know of something I could use?

NOTE: I tried changing the server ip to null once I want to disconnect but that doesn't seem to be working

Google TTS, Help me

$
0
0
import ddf.minim.spi.*;
import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.ugens.*;
import ddf.minim.effects.*;


AudioPlayer player;
Minim minim;
String MP3_Link = "";

void setup()
{

  MP3_Link = doStuff();
  println(MP3_Link);
  player = minim.loadFile( MP3_Link + ".mp3", 2048);
  player.loop();
}

String doStuff()
{
  String language = "ko-KR";
  String text = "Hello";
  String urlData = "http://"+"translate.google.com/translate_tts?tl=";
  urlData = urlData + language + "&q=" + encode(text);
  println(urlData);
  return urlData;
}

String encode(String text)
{
  try
  {
    return java.net.URLEncoder.encode(text, "UTF-8");
  }
  catch (Exception e)
  {
    return "";
  }
}

Good morning. nice to meet you.

I found the source code in the forum, but it does not work.

image

Is there a way to solve this? (I want to work in Android mode.)

Android 'back-button' behaviour

$
0
0

I couple of years ago I started a little project in Processing, just for the fun of it. Now, after learning masses amounts of coding and with help from a lot of you clever brains on this forum I have a little game running on my Android that I would like to publish. But there's one thing holding me off and bugging me: back button behaviour.

My game has a menu screen from where the player can pick a level, this will take him to the level. On screen I have a back button scripted to take the player back to the menu. But the default instinct of any Android user is to use the 'Back-Button' on the bottom of the device to step back in his navigation, expecting to navigate back to the menu. But with Processing this results in exiting or killing the application.

I know this topic has been discussed in the past, but it seems there have not been any decent solutions. People have suggested overriding or catching the behaviour and killing the buttons functionality before they get executed. I've tested these methods, but none of them work. At least not for me. And rightfully some of you have pointed out that this is the native behaviour of Android, which can't be changed (the back button either steps back in activity, if available, otherwise it kills the application).

I respect that, but I very much would like to find a solution in whatever form. I wouldn't want to launch a game that throws people off because it doesn't respond as they would expect.

Are there any clever ideas, any work-arounds, anything I've missed? Anyone that encountered the same issue and managed to resolve it in whatever way.

I'm on currently on Processing 3.3.6 And unfortunately I have little to no experience with Android Studio or Eclipse (yet).

Thanks!

getting "Parse Error: there was a problem parsing the package" trying to install.

$
0
0

Processing version 3.3.6

Android mode 4.0

android version on phone: 6.0

everything I changed on the manifest:

android:versionCode="1" android:versionName="1.0" package="Introscopia.testotesto123minus4haha">
    <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="23"/>
    <application android:icon="@drawable/icon" android:label="testotesto123minus4haha">
        <activity android:name=".balls"

I have the icon files in the folder, I try to export a signed package, it gives me BUILD SUCCESSFUL.

click the .apk on the phone, it gives me "Parse Error: there was a problem parsing the package"

Receive OSC using OscP5 library, Android Mode 4.0-beta2

$
0
0

Hey, how is it going?

Im trying to receive osc on my mobile, using OscP5 library and android mode 4.0-beta2. Codes:

Android app

import oscP5.*;
import netP5.*;

OscP5 oscP5;
NetAddress endereco;

float x = 1.0;
float y = 2.0;
float z = 3.0;

void setup() {
  fullScreen();
  orientation(LANDSCAPE);
  textSize(100);
  oscP5 = new OscP5(this, 9000);
  endereco = new NetAddress("localhost", 10000); // not sure if i even need to import netP5
}

void draw() {
  background(0);
  fill(255);
  text("x = " + x, 20, 200);
  text("y = " + y, 20, 400);
  text("z = " + z, 20, 600);
}

void oscEvent(OscMessage mensagem) {
  // tests if any message is being received at all
  fill(255);
  rect(50, 30, 100, 100);

  if (mensagem.checkAddrPattern("/x")) x = mensagem.get(0).floatValue();
  else if (mensagem.checkAddrPattern("/y")) y = mensagem.get(0).floatValue();
  else if (mensagem.checkAddrPattern("/z")) z = mensagem.get(0).floatValue();
}

Java code running on my laptop

import oscP5.*;
import netP5.*;

OscP5 osc;
NetAddress endereco;

float x = 0;
float y = 0;
float z = 0;

OscMessage mx = new OscMessage("/x");
OscMessage my = new OscMessage("/y");
OscMessage mz = new OscMessage("/z");

void setup() {
  osc = new OscP5(this, 12000);
  endereco = new NetAddress("192.168.25.2", 9000);

}

void draw() {
}

void keyPressed() {
  if (key == 'q') {
    x += 10.4;
    mx.add(x);
    osc.send(mx, endereco);
    mx.clearArguments();
  } else if (key == 'w') {
    x -= 10.5;
    mx.add(x);
    osc.send(mx, endereco);
    mx.clearArguments();
  } else if (key == 'a') {
    y += 10.4;
    my.add(y);
    osc.send(my, endereco);
    my.clearArguments();
  } else if (key == 's') {
    y -= 10.5;
    my.add(y);
    osc.send(my, endereco);
    my.clearArguments();
  } else if (key == 'z') {
    z += 10.4;
    mz.add(z);
    osc.send(mz, endereco);
    mz.clearArguments();
  } else if (key == 'x') {
    z -= 10.5;
    mz.add(z);
    osc.send(mz, endereco);
    mz.clearArguments();
  }
}

They are both connected to the same Wifi network, im pretty sure the IP address is correct, but it just does not receive the message sent, the INTERNET permission is checked for the app. What can I be missing?

Using Processing 3.2.1, Android Mode 4.0-beta2, Android 6.0 (API 23), Zenphone 2 Laser Android 5.0.2.

All best Thanks in advance

Problem setting "available" OSC port

$
0
0

Hi,

I'm trying to send OSC message to my android device but I'm getting each time BindException EADDRINUSE (address already in use). I've tried several different port numbers but it always fails...

I made sure i have the right IP, that the Internet permission is checked, I'm currently using code from this post to make sure it was not a problem with a stupid mistake.

All clues I could find were more about using directly the android SDK . I've tried to restart my phone to make sure i didn't have other app running which would use all these ports, but nothing has changed.

In the mean time, sending OSC from the android device towards my laptop works like a charm...

Any idea what else I could try?

Thanks!

How to export/manage the private key of my android app ?

$
0
0

Hi, I made a little app and exported the signed package using the Processing IDE. The app is now distributed on the Play Store. I plan to change my computer soon. How do you recommend to proceed to keep my private key ? If I type the exact same information and password in the keystore manager of the new computer, will the private key be the same ? Or do I need to create a new key on the new computer and somehow inform Google that I'm still the developer of the app ? thanks in advance


QR Code - Android Application mode,

$
0
0

QR Code - Android Application mode,

Good morning. nice to meet you.  Please make a big hit all you do.

I would like to receive QR code at smartphone.

Are you know QR code examples and libraries for Android. If you know, please share it.

I cant build apk because of missing icons. What icon files to create and where to put them?

$
0
0

I am trying to build my Android apk but it is giving the prompt that I need to create the icons.

What the file names and where do I put them?

Android Wear 1.0 Watch Face: Failure [INSTALL_FAILED_OLDER_SDK]

$
0
0

I am trying to build a simple watch face for Android Wear 1.0 (Sony Smart Watch 3). The Android version of the watch is 6 (SDK 23). I already put SDK 23 in the SDK folder.

The sketch is building.But after installing i get this error: Failure [INSTALL_FAILED_OLDER_SDK]

Processing sets the targetSdkVersion to 26. Even if i am changing the version to 23 in the AndroidManifest.xml in the sketch folder and gradle.properties in the build folder. It changes the number back to 26.

Is there a way to build watch faces for SDK 23?

Is it possible to get input from the daydream/ other motion controllers in processing3?

$
0
0

Hi, I'm learning processing in my college program. I already understand java and c-sharp, so its fairly easy, but for our individual prototype assignment I decided to do something in vr. I was just wondering if it was possible to get input from the daydream controller or any other motion controllers for android.

Trying to make blepdroid to work

$
0
0

Hi, I am not very familiar with the android mode, but I need to use ble communication, so I was hoping to use the blepdroid library. I downloaded, and placed it in my library folder, opened the examples... and tried to run them. I don't have the rfduino that should be communicating with it, but was expecting it to just fail to connect.

However, the sketch can't run. It builds correctly, but I get a fatal exception java.lang.RuntimeException: Unable to start activity

I tried making a sketch with almost all the code stripped away to see if it works better. But it is enough that there is blepdroid = new Blepdroid(this); To make it not work (this time not finding the virtual method getFragmentManager())

Is there something fundamental that I need to set in this mode to make it work? Are the examples from this library supposed to work out of the box?

Thank you.

Osc5 getting blocked by firewall

$
0
0

My android app connects to my server through my domain. Most of the time my apps connect to the server without problems but when I use my school's network I cant connect (I assume the firewall blocked it since the firewall is quite 'sensitive' and blocks a lot of data), I'm using osc5 on port 5204, is there anyway to get trough the fire wall?

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


Custom frame size using Frame Differencing

$
0
0

Hiya there, I am currently trying to make an application that has half the screen displaying a 'motion capture' image using frame differencing, and the other half to be just a regular camera. I have a separate application capturing the screen so I only need to preview the image, I am currently using Ketai Cam as shown down below. The Frame differencing is using some code from the Coding Train (image) which works well on my PC but transferring it to Android seems problematic.

Currently the image wraps itself along the screen and will only allow size formats equal to the camera resolutions, it also seems impossible to resize or transform apart from making the screen size itself smaller. I have linked an image of the current output. It's a mix up of various ideas and pieces of code at the moment but if anyone has an advice or ideas on any part of it I would massively appreciate it.

import ketai.camera.*;
import processing.video.*;

KetaiCamera cam;

PImage prev;

float threshold = 25;

float motionX = 0;
float motionY = 0;

float lerpX = 0;
float lerpY = 0;

void setup() {
  //screen size of phone
  size(2560, 1440);
  imageMode(CENTER);
  orientation(LANDSCAPE);
  prev = createImage(1920, 1080, RGB);
  cam = new KetaiCamera(this, 1920, 1080, 24);

}



void draw()  {
  cam.loadPixels();
  prev.loadPixels();


  int count = 0;

  float avgX = 0;
  float avgY = 0;

  loadPixels();
  // Begin loop to walk through every pixel
  for (int x = 0; x < cam.width; x++ ) {
    for (int y = 0; y < cam.height; y++ ) {
      int loc = x + y * cam.width;
      // What is current color
      color currentColor = cam.pixels[loc];
      float r1 = red(currentColor);
      float g1 = green(currentColor);
      float b1 = blue(currentColor);
      color prevColor = prev.pixels[loc];
      float r2 = red(prevColor);
      float g2 = green(prevColor);
      float b2 = blue(prevColor);

      float d = distSq(r1, g1, b1, r2, g2, b2);

      if (d < threshold*threshold) {
        //stroke(255);
        //strokeWeight(1);
        //point(x, y);
        avgX += x;
        avgY += y;
        count++;
        pixels[loc] = color(255);
      } else {
        pixels[loc] = color(0);
      }
    }

  }

  updatePixels();

  //println(mouseX, threshold);
}

float distSq(float x1, float y1, float z1, float x2, float y2, float z2) {
  float d = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) +(z2-z1)*(z2-z1);
  return d;
}


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

// start/stop camera preview by tapping the screen
void mousePressed()
{
  if (cam.isStarted())
  {
    cam.stop();
  }
  else
    cam.start();
}
void keyPressed() {
  if (key == CODED) {
    if (keyCode == MENU) {
      if (cam.isFlashEnabled())
        cam.disableFlash();
      else
        cam.enableFlash();
    }
  }
}![Screenshot_20171030-222740](https://forum.processing.org/two/uploads/imageupload/158/Z5115UH13W6X.png "Screenshot_20171030-222740")

requestImage nomore works?

$
0
0

Hello! I just move to processing 3.3.6 and android mode 4. The instruction requestImage seems to give error during the sketch execution while it was OK with the previous version. Is it normal? Thanks in advance/Pascal

Setup executed twice when orientation(LANDSCAPE) is part of the setup

$
0
0

A little question: I just notice that the setup is executed twice when orientation(LANDSCAPE) is part of the setup. Is it a normal behaviour?

Ex: void setup(){ println("toto"); size(500, 650); }

=>toto writen in the console

void setup(){ println("toto"); orientation(LANDSCAPE); size(500, 650); }

=>toto writen in the console =>toto writen in the console

App randomly crashes when phone comes back from IDLE

$
0
0

Hello, My app is working fine on my phone (HTC 510 desire android 4.4.2) as long as the phone is UP, but when the phone goes to IDLE and next to ACTIVE, the app crash randomly.

The crash comes from an out of memory.

Here after the error message:

FATAL EXCEPTION: Thread-88714 Process: processing.test.sketch_171102a, PID: 24348 java.lang.OutOfMemoryError: (Heap Size=65536KB, Allocated=61546KB) at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:739)

Questions: 1>How can I log the amount of memory allocated? 2>What can be the problem?

Thanks in advance /Pascal

Able to programm complex apps?

$
0
0

Is it possible to programm more complex apps than just a cirle floating around? I mean game apps, not like clash of clans or something like this, more like color switch or similar apps? And is it possible to put monetization in the apps, connect to facebook etc.?

Viewing all 941 articles
Browse latest View live