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

wallpaperOffset() not updating

$
0
0

this is my Current Code:

void setup() {
  fullScreen();
}
void draw() {
  background(33);
  text(wallpaperHomeCount()+" "+wallpaperOffset()+" "+random(1),width/2,height/2);
}

I can't get it to output anything else than "1 0.5 random" did i understand something wrong? (i used the random number to prove that the frame is updating)

http://android.processing.org/reference/wallpapers/offset.html (Android Mode 4.0 & Android 4.4.3)


Can't get Processing to see the SDK

$
0
0

OS: Windows 10 64bit Every time I'm trying to switch to Android mode, I get this:

"Download SDK automatically" starts downloading, then at ~250MB the window suddenly dissapears and I get this:

Tried it about 5 or 6 times already.

And when I try to locate path manually after installing the thing from the link from the first message box, simply put, no folder works. I installed full Android Studio, went into settings, and in SDK Manager I downloaded SDK Platform "Android 8.0 Oreo" (SDK Level 26 because the popup wants that and not the 27)(neither 26 or 27 give any results): I noticed it downloaded it into SDK installation folder/platforms/android-26: I tried targeting this folder, aswell as any folders above or inside this one, none of them do a thing. I guess this also has something to do with the fact that practily every single Processing Android mode tutorial I could find has different SDK Manager and Android Studio GUI, aswell as that Processing asks for Android 26 SDK while 27 is the latest.

(sorry for the excessive image use, I just like documenting things as detailed as possible)

Errors when exporting signed package

$
0
0

When trying to export my app's signed package, I get this error:

The keystore could not be created, due to the following error:

Build folder: C:\Users\User\AppData\Local\Temp\android9025829233428918515sketch
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.

What is causing it?

WiFi Communication between PC and Android Problem

$
0
0

Hi all,

I am trying to establish bidirectional communication via Wifi between an Android device and a PC running Windows. I have followed the Daniel Sauter's book "Rapid Android Development", Chapter 6: Networking devices with Wifi. https://www.mobileprocessing.org/networking.html
I am trying the first example of the chapter.

On the Android side, the code can be found at:

https://github.com/danielsauter/rapid-android-development/blob/master/code/Networking/WiFiDataExchangeAndroid/WiFiDataExchangeAndroid.pde

On the PC side, the code can be found at:

https://github.com/danielsauter/rapid-android-development/blob/master/code/Networking/WiFiDataExchangePC/WiFiDataExchangePC.pde

When running both codes, the android device gets the messages from the PC but the PC doesn't get the messages sent by the Android device. Is there any solution? If not, Is there another approach to establish the communication using Processing?

I am using:

PC: Windows 10 v.1709, Processing 3.3.6, Android Mode 4.0, Ketai 14, oscP5 0.9.9

Android device: Samsung S5 Mini (SM-G800F), Android 6.0.1

Thanks in advance!

Como programar en adroid?

$
0
0

Buena noche,

he tratado de instalar el modo android para programar pero no he logrado instalar el sdk alguien me podria explicar paso a paso como se hace?

tengo la version 3 y bueno soy nevo en esto y no entiendo bien como se hace

de antemano muchas gracias

For the pop-up mic permissions prompt

$
0
0

In an app that I developed, it requires the mic permission of the user. I've added the RECORD_AUDIO permissions in the Manifest file. Will that result in the permissions prompt to pop up at run time or is there anything else I need to do like add the getPermissionToRecordAudio() and onRequestPermissionsResult() code to MainActivity.java , etc? If so, where is the MainActivity.java in the Processing sketch documents? Do I have to use Android Studio for that? Pl let me know. Thanks.

Keyboard height

$
0
0

Hi everyone, i'm having a issue, i'm ussing the android keyboard and when it pop's up it covers part of the app and data get's hidden, so there's a way to know the height of the keyboard so the app can "addapt" and show what is hidden (because on larger screens the keyboard occupy less screen space)

problem with interface

$
0
0

hello, first of all I apologize for my English, I created a project in the arduino that indicates the vacancies available of a parking lot and I created a supervisory system that shows the parking lots available through sensors, but I am in trouble at the beginning it was working and now it has a delay of more than one minute in response time in the supervisory system and I do not know what the problem is. Help me.


Force connect to wifi

$
0
0

Hi everyone, I would like to know if its possible to force connect the phone to a pre defined network using any existing wifi libraries? I made a small app that sends accelerometer data to the server through udp but works only if both devices are connected to the same network, on the app side I would like to pre define a network that application automatically connects. Thanks for your help already and Happy New Year! :)

How to export as APK? 3.0

$
0
0

How to i export my projekt as an APK? Can someone pls explain how to i export it? I tried to install the Android SDK but i always get an error (It couldn´t find the SDK). Please help

Move view on touch

$
0
0

Is there any inputmethodmanager to go to the next screen (featuring the main app) when a button named NEXT is touched on the first welcome page? Thanks.

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

Ketai library SQLite - can't insert into DB

$
0
0

I am following the example at Ketai to insert a new row into an existing SQLite database. I am using a simple SQL insert statement. The println statements at the bottom from a SELECT statement suggests that everything works - I can see new rows being added to the DB. However when I go into the database itself the rows are NOT being written. Is there something obvious I am missing?

I am running this via an Android Emulator from the Processing IDE. I am beginning to suspect something to do with the emulator (or some permission thing?) as the code seems fine .... ?

import ketai.data.*;

class DB {
  KetaiSQLite db;
  DB(PApplet p) {
    if (KetaiSQLite.load(p, "diaryDB.db", "diaryDB")) {
      println("loaded db file");
    }
    db = new KetaiSQLite(p,"diaryDB");
  }

  void write(String s) {
    if (db.connect()) {
      String query = "INSERT INTO DIARY VALUES(NULL,\""+s+"\",1)";
      if (!db.execute(query)) {
        println("error w/sql insert");
      }
      println("data count for data table after insert: "+db.getRecordCount("DIARY"));
      db.query( "SELECT * FROM DIARY" );

      while (db.next ())
      {
        println("----------------");
        print( db.getInt("DIARY_ID") );
        print( "\t"+db.getString("TEXT_ENTRY") );
        println("\t"+db.getInt("MOOD_ID"));
        println("----------------");
      }
    } else {
      println("db not connected");
    }
  }
}

Help needed with P3D on Android

$
0
0

Hi there

I developed a Processing based Android app month ago and I'm stuck with a bug that prevents me from releasing it.

I reported the issue Here

Here is and debug unsigned apk of my app

and Here is a video capture of the graphical problem

and here is the whole Android Studio project

It is kind of painful to have done a project almost all the way and not being able to release it

If anyone could give it the notch it needs to get out, I'll put his name in the splash screen with mine

It is hard to keep your enthusiasm up sometimes

cheers

Problem with installing android SDK

$
0
0

Hi ! I'm on Processing 3.3.6 with Android mode 4.0 and I have a problem with installing the android SDK. I tried to install it with processing but the download alway stops at 32% (279,7MB).df I also tried to install it manually at developer.android.com/studio/index.html Sans titre-1
but I can't find the SDK in those files when I press "Locate SDK path manually" :

Sans titre-2

Please help me, thanks !


Processing Sketches Have Messed Up Keyboards

$
0
0

Hey all! So I've been struggling for a while with the android virtual keyboard where it'll be messed up completely across ALL processing sketches installed on the device. Even though the keyboard messes up inside the sketches it works perfectly fine in other applications. I've had these keyboard issues:

  1. The bottom row of buttons (ENTER, SPACE, Comma, Fullstop... etc.) are completely missing and there is just space instead. Attempting to tap this space will press the keys directly above.

  2. The keyboard opened is the original old classic phone keyboard similar to the phone dialer where there's three letters for each key.

It doesn't seem to matter what app is opened. As long as the app was created with processing the same issue occurs across them all. It can be fixed and returned back to normal temporarily by resetting the keyboard settings and history within the device's settings. It's also sometimes but rarely possible to restore it on a full app re-install. Obviously this is still an issue though. The amount of time it takes before the keyboard messes up appears to be random but I don't think it can change inside a session, only on the next opening. It's definitely possible I missed something but these are the main points at which I've noticed it messing up.

As for the code I'm using it's simply put just this:

void registerScreen() { if (!keyboard) { openKeyboard(); keyboard = true; } }

Which is located in the draw function. Any help, tips or ideas on how to solve it are very much appreciated! ;;) Thanks!

How to select a library depending on the OS

$
0
0

Hi everyone, i'm developing a software that need's to run on windows, linux and android, since i don't want to make a version depending on the OS, i'd like to know if there is a way to automatically use a librarie, e.g. for android i've to use the following line to toggle on the keyboard:

void showSoftKeyboard() { android.view.inputmethod.InputMethodManager imm = (android.view.inputmethod.InputMethodManager) getActivity().getSystemService(android.content.Context.INPUT_METHOD_SERVICE); imm.showSoftInput(getActivity().getCurrentFocus(), 0); }

the part "android.vie.in......." doesn't allow me to compile for windows (which makes sense, since it's for android) but i think there is a way to makeit depend on the OS to use it or not. To recognice the OS i would use:

String os=System.getProperty("os.name"), vendor = System.getProperty("java.vendor.url");

where the OS in android reports as "Linux" but in vendor says "www.android.com", so i know wich OS i'm running.

Not install Android Mode, What's up?

$
0
0

Hi, nice to meet you. nice day!

fig0 fig1 fig2

what's up?

Why can not I install it? Please tell us.

Unicode Keypress recognise

$
0
0

Hello, I am trying to simply println a value when a non alphabetical key is pressed in the keyboard on an Android Tablet. Specifically I hope to recognise if an emoji key has been pressed.

I cannot seem to get any kind of unicode to convert to char. I have been looking at this post to try and implement the given example but I cannot get it to compile successfully. https://forum.processing.org/two/discussion/9296/getunicodechar-in-android-mode#latest

I am running Android KitKat 4.4.4

I have also been trying to get a simple keycode to be recognised via the code below:

    import android.view.KeyEvent;
    KeyEvent event;
    boolean keyboard = false;
    int unicodeChar=0;

    void setup() {
      fullScreen();
      textFont(createFont("SansSerif", 40 * displayDensity));
      fill(0);
      unicodeChar = event.getUnicodeChar();
    }

    void draw() {
      background(255);
      text(key, width/2, height/2-50);
    }

    void keyPressed() {
      background(200, 50, 30);
      if (key == CODED)
      {
        println("code => " + keyCode);

        if (key==unicodeChar) {

          println("unicode" + unicodeChar);
        }
      } else
        println(key);
    }

    void mousePressed() {
      if (!keyboard) {
        openKeyboard();
        keyboard = true;
      } else {
        closeKeyboard();
        keyboard = false;
      }
    }

From reading the emoji and unicode posts for java based Processing it seems there are issues with being able to implement emoji unicode. However, I wonder if the same issues carry over into Android mode?

Any pointers in the right direction would be really appreciated. thanks

A way to tell if someone shakes the phone?

$
0
0

The Ketai Library has stuff for like onDoubletap, and onFlick, but I can't any thing for onShake, or any other library. does anyone know a way to detect if someone shakes the phone, for my app to respond in the correct way?

Viewing all 941 articles
Browse latest View live