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

processing.net.* transformation to android

$
0
0

Hello everybody,

I have made a program with java that includes processing.net.* libary. When I wanted to transform this program to arduino it says that the libary is not available in andorid so the program doesn't work. I wonder if there are any libary compatible like processing.net.* or something that allow me to do this prorgam:

`

import processing.net.*;

Client myClient; //Definir variables String incomingMessage; int dato; int valin=0; int xin=0; int x=1; void setup() { size(1000,400); background(255);
// Connect to the local machine at port 5204. // This example will not run if you haven't // previously started a server on this port. myClient = new Client(this, "192.168.1.1", 81); myClient.write("start now"); } void newstart(){ size(1000,400); background(255); }

void draw() { // Recibir el mensaje incomingMessage = myClient.readStringUntil('\n'); //Eliminar los espazcios blancos if (incomingMessage!=null){ incomingMessage = incomingMessage.trim(); //Cambio de variable int dato = Integer.parseInt(incomingMessage); println(dato); // Guardar la variable

  //Graficar los datos
  dato=399 - dato/10;
  line(xin, valin, x, dato);  //Forma una linea del punto anterior al nuevo punto
  valin=dato;                 //Definición de la nueva y inicial
  //Si los datos son más grandes que la ventana, restart
  if (x>=1000){
    newstart();
    xin=0;
    x=1;

  }else{
  xin=x;                     // Definición de la nueva x inicial
  x++;
  dato=dato+1;
    }

} }

`

The programe is a client which sends a messatge to an arduino launchpad (server) and the launchpad starts sending a voltage value every second.

Thank you for your help!!!


Android Dev. Problems.

$
0
0

When ever I try to make anything in Android mode it gives me errors for instance: I copied and pasted the demo Android project from the tutorial and it says "the [xyz] does not exist". Also Processing can't find my tablet. But one problem at a time I guess. Any ideas?

Open a camera preview inside a custom Layout (Android)

$
0
0

Hi all, I'm creating a real time app when the user can freely draw on camera preview. But... i don't know how to open a camera preview in my app (for example inside a rect).

Please,help

Failure [INSTALL_FAILED_DEXOPT]

$
0
0

Hi, i'm not english so i'm sorry if it doesn't not easy to read my text. If you are french, speack french please, it will be better for me (or us). I'm a programmer with a medium level. I use Processing and his Android Mode. My program is a long, simple for me, it's just for write text in english, french and spanish. When i will finish my party, i will give my code at my friends, who will put in his application. I hope you understand me. So, i want to work at home but i can't because i have again a problem. I'm on Linux, because Processing doesn't working in Windows (for me).

Here is my problem : (just the error)

debug: Failure [INSTALL_FAILED_DEXOPT] Shutting down any existing adb server...

On Android Device Animation too slow! (on PC its normal) GPU? OpenGL?

$
0
0

I followed a tutorial from image

And the Code runs very well in PC(Laptop).(It runs fluently)

But when I tried to run it on Android Device it became very slow. (i guess one frame / 2 Seconds) The Core Code is here

void draw() {
  background(51);

  loadPixels();
  for (int x = 0; x < width; x++) {
    for (int y = 0; y < height; y++) {
      int index = x + y * width;
      float sum = 0;
      for (Blob b : blobs) {
        float d = dist(x, y, b.pos.x, b.pos.y);
        sum += 10 * b.r / d;
      }
      pixels[index] = color(sum, 255, 255);
    }
  }

  updatePixels();

  for (Blob b : blobs) {
    b.update();
  }
}

Can anyone help me, what is the problem here?

Because it loads every pixel and does pixel processing, so it uses CPU? How can I do pixel Processing using GPU?(I am not sure, if i express this correctly, i have no experience in computer graphics)

Thanks

How to connect to android device with Bluetooth

$
0
0

Hi ! I want to connect two android device for send information from a game like a pong with two players or a tic tac toe. Thanks in advance !

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

Layout Problem

$
0
0

I'm developing an App with Android Studio and I included ads. For this I made a frame layout and added an ad banner below. In the emulator everything works as intended at I'm able to display test ads. However, when I'm running it on the phone the frame with the processing sketch fills up the whole screen. I don't get why it works on the emulator (I tried different Android versions.), but not on the real device.

logcat does not mention any ad related errors, just "Ad finished loading." Here is the layout xml file (without my app unit id).

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:ads="http://schemas.android.com/apk/res-auto"
        android:name=".rhythm_soundpool_final_2"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

    <FrameLayout android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_above="@+id/adView">
    </FrameLayout>

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="ca-app-pub-xxxxxxxxxxxxxxxxxx/xxxxxxxxxxx"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true">
    </com.google.android.gms.ads.AdView>

</RelativeLayout>

And here is the part of MainActivity, that actually matters for the ads.

public class MainActivity extends Activity {
    PApplet fragment;
    private static final String MAIN_FRAGMENT_TAG = "main_fragment";
    private static final int REQUEST_PERMISSIONS = 1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        if (savedInstanceState == null) {
          fragment = new rhythm_soundpool_final_2();
          FragmentTransaction ft = getFragmentManager().beginTransaction();
            ft.replace(R.id.container, fragment).commit();
            } else {
            fragment = (PApplet) getFragmentManager().findFragmentByTag(MAIN_FRAGMENT_TAG);
        }

       MobileAds.initialize(getApplicationContext(), "ca-app-pub-4464966848174171~2518304649");
       AdView mAdView = (AdView) findViewById(R.id.adView);
       //AdRequest request = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).build();
       AdRequest request = new AdRequest.Builder().addTestDevice("8258EDD0C06FE07322AE476AAD7S83A7").build();

       mAdView.loadAd(request);
    }

}

build android apps

$
0
0

hai forum. anyone can help me or suggestme how to build android apps. stream the image from webcam attached via usb to android phone and display the image on the phone screen. thanks

Get an ERROR when select 'Run ond device' (android)

$
0
0

Hi all,

I'm absolutely new with android development, but I'm a fan of Processing. I try to get a app running on my device (Galaxy S3 or HUAWEI Ascend Y210).

When I select the 'Run on Device' menu I get at the end the message:

...
_debug:
Failure [INSTALL_FAILED_UID_CHANGED]
Shutting down any existing adb server..._

I searched in the forum with this error, but I didn't find something. The points I got with a web search weren't helpfull as well. :(

I use the API 4.3.1, but I think thats not the point, why I' getting this error.

Does anybody have an idea what went wrong here with my configuration?

With the 'Android Studio' I got a very simple example running. (Just to see if drivers are installed propperly)

Thanx in advance and happy coding Michi

Speech to Text & Voice Recognition by Android mode(at Processing Tool)

build android apps android mode

$
0
0

hi forum advise me where to start to build android app in processing android mode. from create manifests, activity.mainxml and main java code. thank you

the BACK key ?

$
0
0

I know this has been discussed elsewhere and I have read and tried code ideas from several threads and also some from Stack Overflow but with no luck. So how can the the BACK key behaviour be controlled in the new version of Processing. In P2 and early versions of P3 (before android mode started putting us in a Fragment - why?) I was able to use the function boolean surfaceKeyDown(int code, KeyEvent event) but that has now for some reason become void surfaceKeyDown(int code, KeyEvent event) and doesn't work any longer.

So back to basics .... the following code makes use of keyPressed() as described in the Android Mode Wiki. The code runs when the BACK key is pressed, but the app quits.... setting keyCode = 0 doesn't prevent quitting. This is presumably dated info in the wiki??

So what to try next .... any ideas please?

Thanks, Mark

void setup() {
  fullScreen(P2D);
  rectMode(CENTER) ;
}

// draw() ... just to have somethng happening ...

void draw() {
  background(0) ;
  rect(mouseX, mouseY, width/8, width/8) ;
}


// keyPressed() ... copied from Processing's Android Mode WIKI ...

void keyPressed() {
  // doing other things here, and then:
  if (key == CODED && keyCode == android.view.KeyEvent.KEYCODE_BACK) {
    keyCode = 0;  // don't quit by default
    println("BACK key pressed") ; // to prove the code ran to here ...
  }
}

Converting processing code to Android

$
0
0

Hello. I've written a code in processing that uses arduino inputs (more specifically a sensor that combines gyroscope and accelerometer). I would like to make this more portable so instead of my laptop screen I would be using an external one. I thought of an android tablet and discovered the android mode. The problem is that i'm using libraries like controlp5 and opengl which are not accepted in android mode. What are my best options here for modifying just a little of my code and get it working? is the android a viable solution? I know I'm being very vague but I hope some one had the same problem and more experience and can direct me to a nice solution. Thank you

New beta of the Android mode

$
0
0

The 4.0-beta7 release of the Android mode has a finalized API for wallpapers, wear and VR. Download from here (still not available through the CM yet, hopefully soon). The website will be updated in the coming days to reflect the API changes and improvements.


Apks compiled in android mode not working.

$
0
0

So I´ve been tryng to compile and run a simple apk in different devices without any succes.

I´ve tryed the simplest of the codes .

void setup(){
  fullScreen();

}

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

I´ve already tryed in 3 different computers with 3 different devices without any success.

This de logcat :

Shutting down VM
04-12 15:42:47.788 7019 7019 E AndroidRuntime: FATAL EXCEPTION: main
04-12 15:42:47.788 7019 7019 E AndroidRuntime: Process: processing.test.mierda, PID: 7019
04-12 15:42:47.788 7019 7019 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.mierda/processing.test.mierda.MainActivity}: java.lang.ClassNotFoundException: Didn't find class ?

I´ve been searching in stackoverflow and it´s says that this is something that happens when it can´t find the class :

http://stackoverflow.com/questions/16102232/java-lang-runtimeexception-unable-to-instantiate-activity-componentinfo-classn

But my android manifest is the one that automatically generates processing :

    <?xml version="1.0" encoding="UTF-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="">
      <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23"/>
      <application android:debuggable="true" android:icon="@drawable/icon" android:label="">
        <activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitleBar">
          <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
          </intent-filter>
        </activity>
      </application>
    </manifest>

Tryed using void settings, wont work.

Ive tryed : Sdk version Api 6.0(23),5.0,4.0 PC OS windows.

Android devices that I´ve tryed :

Moto X android version 5.1, Moto E (2 generation) with 4G LTE android version 5.1, Moto G android version 6,

Ideas? Suggestions?

There is a bug, a nullpointerException was thrown out, and the app kept running.

$
0
0

Can anyone help me to find out where is the problem? I programmed a liveWallpaper, and I rotated the screen on the "set wallpaper" interface (this is a tablet with a big screen size). And the live wallpaper restarted, and sometimes the app crashed(not always) with a nullPointerException. The LiveWallpaper kept running on the background.

E/AndroidRuntime: FATAL EXCEPTION: Animation Thread
           Process: tianranwang.livewallpaper, PID: 8381
           java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.SurfaceHolder.unlockCanvasAndPost(android.graphics.Canvas)' on a null object reference
           at processing.a2d.PGraphicsAndroid2D.endDraw(Unknown Source)
           at processing.core.PApplet.handleDraw(Unknown Source)
           at processing.core.PSurfaceNone.callDraw(Unknown Source)
           at processing.core.PSurfaceNone$AnimationThread.run(Unknown Source)

surface.setSize() and setResizable() do not exist in Android mode. How to resize the sketch dynamic?

$
0
0

In Android mode . surface.setSize()and surface.setResizable(true) do not exist..

How can I resize the sketch dynamically (Android mode)?

Thanks in advance

Unbenannt Wenn I rotate the screen, the live wallpaper does not update its size. like the pic above

Receive sms on APDE

$
0
0

Hello! I'm want to receive sms using APDE but the library smsP5 doesn't work on :(( . And I've also tried the code find here but he is too old ~X( . So, if you have some idea I'm will accept it with pleasure. Ps : Excuse me for grammar but i'm French...

Export signed application package

$
0
0

I've built an android game application with processing, and now i want to publish it in the google play store, but when i click on "export signed application package" , after that i insert the keystore, processing never end to export the signed package. What can i do to fix the problem?

Viewing all 941 articles
Browse latest View live