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

Is it possible to use Processing in Android mode with specific SDKs for specialist hardware?

$
0
0

I am trying to develop a simple Android App using Processing that will work with some specialist display technology that has its own SDK. I don't know how to use Android Studio but I can use Processing which is why I'm exploring this option. The hardware I am using and its API reference can be found here: https://developer.sony.com/reference/seg-sdk/packages


Android mode 4.0 not compatible with Processing 3.2.1

$
0
0

Hi, Just updated the Android Mode in Contribution Manager to 4.0. Each time I try to run a sketch in Android Mode Processing gives the error: Android Mode not compatible with this version of processing, try updating the mode (no option to update the mode). Tried in Processing 3.0 and same problem. Any help welcome.

Problem with Android mode build project.

How to use data folder in android mode?

$
0
0

Can someone explain to me how the data folder is used in Android Mode. I have: - Project Folder: - AndroidManifest.xml - code (folder) - data (folder created by me) - project.pde - sketch.properties

Is this OK? Because the console throw errors about the Data Folder because it cant read the archives. THX!

GSVideo and Processing 3 problem

$
0
0

hi all , i have found this library that offer video capture and playbacks and other operations , i wanted to test it in processing 3 ,but every example i try to run on my android phone it crashes at start !! the thing is i need to capture video from ip camera , i tried the IPcapture library and every thing worked fine , but the problem the processing app resolution should be the same as the camera resolution for the app to work , else it will crash , i can't show the video on my phone full screen !! i couldn't know why is that happening , so i tried the GSVideo library i thought that this would fix the problem so i added the library on my processing 3 open example , exported the apk , installed it ,but the app crashes at start always

this is the code i tried to run :

import codeanticode.gsvideo.*;

GSPipeline pipeline;

void setup() {
  size(640, 480);

  pipeline = new GSPipeline(this, "https://192.168.0.105:8080/video");
  pipeline.play();
}

void draw() {
  // When the GSPipeline.available() method returns true,
  // it means that a new frame is ready to be read.
  if (pipeline.available()) {
    pipeline.read();
    image(pipeline, 0, 0);
  }
}

Note : Processing is V3 , the phone is galaxy s6 edge with android 7.0 and i use the latest version of GSvideo library

i also tried to use apde on android to run the code , but no luck too , i got the following errors:

java.lang.nosuchfielderror: no field title of type i in class codeanticode.gsvideo.GSVideo. (Unknown source)

and many other errors !

so please anyone can help me to make the library works with me ?! or anyone can help me to find alternative library to get video and ip camera stream from url .

Kind regards

Problem with building in P3.3.6, android mode 4, possible Gradle issue?

$
0
0

Hi,

I ran the live wallpaper tutorial on the android mode 4.0 successfully but the next time I tried to build it the emulator returned an error in the resources merging part of the build, the part where it failed is pasted below:


:app:mergeDebugResources C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-mdpi\icon-48.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xhdpi\icon-96.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxhdpi\icon-144.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxxhdpi\icon-192.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore :app:mergeDebugResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'. > C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-mdpi\icon-48.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xhdpi\icon-96.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxhdpi\icon-144.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore C:\Users\jef3j\AppData\Local\Temp\android2378723889172103376sketch\app\src\main\res\mipmap-xxxhdpi\icon-192.png: Error: '-' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, or underscore

I should add that I am not using or adding my own icons, just trying to standard build using the default template icons supplied by processing. It appears that Gradle will not allow icon names with a hyphen (e.g. icon-48.png).

Does anyone have any ideas that might help? Thanks if possible,

poly

KetaiCamera extremely slow when compiled from Android Studio

$
0
0

I face an odd behaviour when I compile my sketch from within Android Studio (what I have to to because I am using a JNI library dependency):

The same app (namely the CameraGettingStarted example sketch from Ketai library examples) has about 15FPS when I compile from the processing app and only about 3-4 FPS when I use Android Studio.

I just imported the temporary build folder into Android Studio, so basically everything (manifest, build.gradle etc.) is untouched.

Does anyone have an idea???

EDIT: What I found out: This behaviour only happens when using the "embedded JDK" in Android Studio. (Project Structure/JDK Location...). After I manually pointed to JDK1.8.0_144, everything went just fine...

Using Game Control Plus with a 2 player game

$
0
0

Well, I have pretty much finished a great game on the PC that I will eventually port to Android. Currently it is single player against the computer. I would like to have it also be two player, using two trackballs, one for each player. It appears that GCP uses JInput, and that does not differentiate between two controllers of the same type, ie Mouse. It is happy to receive events from both devices to say, move the cursor, but does not care which device the event came from. Is there a solution for this?, I have a feeling "No".


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

How can I detect number of mice/fingers clicked at once?

$
0
0

Ok, so I'm making an Android application, which needs to detect number of fingers currently pressed, so it can use that number as different "buttons".

How would I go about doing that?

P.s: I don't want to use any prebuild libraries, because I want to learn how to do it "Vanilla" way.

Thanks!

Best way to test code performance? (on other devices)

$
0
0

Hi all!

What is the best way to check whether my code is compatible with most devices?

I can monitor the code in task manager but I'm not sure how to interpret all the numbers (the workings of the CPU and GPU are beyond me). I can see how much CPU my code is using (usually between 00 and 20). Is 20 a lot? How much CPU should I be aiming to limit my code to if I want to make it compatible for something like an Android phone? Is the CPU the only measure for a code's demand on the device it's ran in?

About Wallpapers.

$
0
0
PImage img;
float ratio;

void setup() {
  fullScreen();
  img = loadImage("landscape.jpg");
  ratio = float(img.width)/float(img.height);
}

void draw() {
  background(0);
  float w = wallpaperHomeCount() * width;
  float h = w/ratio;
  float x = map(wallpaperOffset(), 0, 1, 0, -(wallpaperHomeCount()-1) * width);
  image(img, x, 0, w, h);
}

There is no response when you insert the source.

Anyone know why?

Trying to run in emulator.

$
0
0

Trying to run in emulator I get the following error:

BUILD SUCCESSFUL in 2m 27s 35 actionable tasks: 35 executed

Emulator process exited with status -1073741819. EmulatorController: Emulator never booted. NOT_RUNNING Error while starting the emulator. (NOT_RUNNING)**

Shutting down any existing adb server... Done.

What to do? Thanks

Icons needed in exporting signed package.

$
0
0

Hi

I want to make an apk, but when try to export, I get the message that the sketch does not include all required app icons. I searched on and outside the forum where I found the latest topic [https://forum.processing.org/two/discussion/comment/90084/#Comment_90084] Of course I read also the docs. I made my icons in all dimensions that I could find, that could be needed, and named them icon-36.png and so on, and put them in the sketch folder. But without success. Then I tried to put them in other folders like the lib folder too, with other names like 36pde.png. I tried to use the custom icon set also with, and without renaming, putting them into different folders. I am using 64b Windows 8.1and latest versions of java and processing in android mode.

I really need to make a ´standalone´apk so I really appreciate some help. Thanks in advance Emmanuel

Error message help please ?

$
0
0

Hi Have just updated to 3.3.6 and the new android 4 mode. Was a bit nervous but it worked first time with a simple getting started sketch. Quite impressed!

But now I wish to run a large project that was working fine with android mode 3, but it now throws this console message after successful build and installation ... it throws as the sketch starts on my phone. Can anyone tell me how to fix this ... what is a Theme.AppCompat theme (or descendant) ?

Many thanks Mark

BUILD SUCCESSFUL in 33s 35 actionable tasks: 35 executed FATAL EXCEPTION: main Process: processing.test.bigchangesandroid_copy3, PID: 405 java.lang.RuntimeException: Unable to start activity ComponentInfo{processing.test.bigchangesandroid_copy3/processing.test.bigchangesandroid_copy3.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6123) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:355) at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:324) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:294) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:150) at processing.test.bigchangesandroid_copy3.MainActivity.onCreate(MainActivity.java:21) at android.app.Activity.performCreate(Activity.java:6672) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612) ... 9 more


Processing 3.5.6 32bit downloads 64bit packages for android

$
0
0

Hi. Using 32-bits processing (3.3.6) downloads 64 bits packages for android mode (4.0). After downloading 32-bit adb from repository (fedora 26) managed to connect to device, but then found other packages also for 64-bits, like aapt and of course I can not export an apk (due to that icon problem another member posted and because package is for 64-bit) or run in device.

I think the android mode should check if the system is 32 or 64-bits and download the correct one. I do not know if the 32-bits package exists or not, but if it doesn't, then android mode for 32-bits shouldn't work.

Thanks in advance for any help or suggestion about this.

SALUDOS
ALVARO

Emulator always 800x480 8.0. How to change?

$
0
0

I'm thrilled that I was able to get sketches to run in the emulator easily. However, no matter what I do the emulator is always the virtual device "processing-phone" running 8.0 at 800x480. If I make any changes to the virtual device, at the next run, it reverts to those original settings. I've also tried getting another virtual device running in Android Studio, and changing the preferences entry android.emulator.port.phone to point to the port of the running virtual device, but Processing changes it back as soon as I click on "Run in Emulator". Is there any way to get Processing to run my sketch in the virtual device of my choosing?

Set library mode

$
0
0

Hello,

I am creating a library that only works on the Android mode. Is there a way to set the library to Android mode only? Because if people use it now it would give them errors.

The function “getWindowManager()” does not exist.

$
0
0

Hi all! I am working on an android app and need to get screen size in cm to make it compatible with all devices. For that, I found this function in another discussion:

import android.view.WindowManager;
import android.util.DisplayMetrics;

import android.os.Bundle;

DisplayMetrics metrics;

//code like setup and draw etc.

//@Override
void onCreate(Bundle bundle)
{
      super.onCreate(bundle);

      metrics = new DisplayMetrics();
      getWindowManager().getDefaultDisplay().getMetrics(metrics);
}

float getXdpi()
{
      return metrics.xdpi;
}

float getYdpi()
{
      return metrics.ydpi;
}

However, when I paste it to my code, the getWindowManager.getDefaultDisplay.getMetrics(metrics) gets underlined, specifically the getWindowManager part and it says that such a function does not exist.

What could be the problem?

Google Play Services in Processing

$
0
0

Hey guys,

After hours and hours of trying to import the "google play services" library I now honestly require your assistance.

Initially i just wanted to add ads to my sketch and therefore download the "Google Mobile Ads SDK". Sadly the SDK is now part of the "Google play services platform". I think I tried every suggesteion I could find. The last thing I did was to convert the .aar at

sdk\extras\google\m2repository\com\google\android\gms\play-services-ads

to a zip file to extract the classes.jar file and placed this file in the processing library folder.

Importing "com.google.android.gms.ads" just wont work.

Edit: more hours have passed and i got a little bit further, yet though the problem just seems bigger. import com.google.android.gms.ads.MobileAds does work by now since i have extracted the .jar file for play-services-ads-lite but calling MobileAds.initialize(this, "YOUR_ADMOB_APP_ID") gives me this error:

java.lang.NoClassDefFoundError: com.google.android.gms.internal.zziq...

I already tried MultiDex.install(this) in my sketch but it does not work. Any suggestions?

Viewing all 941 articles
Browse latest View live