Trouble with the SelectFile library (Android mode)

edited November 2015 in Android Mode

When running the SelectFile library example I get a Fatal Exception error. Can someone explain me why? Thanks.

import select.files.*;

SelectLibrary files;

void setup() { size(320, 240);

files = new SelectLibrary(this);

files.selectInput("Select a file to process:", "fileSelected"); // files.selectFolder("Select a folder to process:", "fileSelected"); // files.selectOutput("Save the file please:", "fileSelected"); }

void fileSelected(File selection) { if (selection == null) { println("Nothing was selected."); } else { println("User selected " + selection.getAbsolutePath()); } }

FATAL EXCEPTION: Animation Thread Process: processing.test.sketch_151112c, PID: 1588 java.lang.NoSuchMethodError: processing.core.PApplet.runOnUiThread at select.files.SelectLibrary.selectImpl(Unknown Source) at select.files.SelectLibrary.selectInput(Unknown Source) at processing.test.sketch_151112c.sketch_151112c.setup(sketch_151112c.java:30) at processing.core.PApplet.handleDraw(Unknown Source) at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source) at processing.core.PApplet.run(Unknown Source) at java.lang.Thread.run(Thread.java:841)

Answers

  • @mmuylle===

    • what version of processing???
    • is this lib supposed to work in android mode?
  • Processing 3.0.1 the library was developed for processing in android mode: see http://andrusiv.com/android-select-file/

  • edited November 2015

    the example that I showed is the one that comes with the library .

  • @mmuylle=== looking to your link i see::

    It is specifically designed for Android mode in Processing 2.0.

  • Thanks, and this is good to know but doesn't solve the problem. Are you aware of any files selection library that works in processing 3.0.1 android mode?

  • @mmuylle=== i dont know wether it exists some lib for that; anyway, if you only want to select a file or a folder, java (or java android) can do that without any lib...

  • Same problem as you, even with processing 2. I suppose that android doesn't found the path of the method select.files.SelectLibrary.selectImpl. I tried with all permissions and the bug is not there. No idea, do you find a solution with java ?

  • @mattieu && mmuylle:: where are your files??? on the sdcard??? in some specific folder??? do you know the uri for the folder??? - Places where you can put files and get them selecting are not at all like on a computer!

  • When testing the program from the computer in processing/android mode; I suppose the the path to the files is identical as when testing in java mode. If not, where can I find the instructions how to organise the files on the sdcard. thanks

  • I thought I will have a selector panel to can choose my file in the folders on my tab, like selectInput() on my laptop

  • @matthieu=== not at all, the path to the files on the phone is very different: internal, external storage & so on. @mmuylle=== you put your files on the sdcard then in order that the user can select you have to use an Intent with Action_Get_Content, categoryOpenable and start ActivityForResult; see the android doc here:

    developer.android.com/reference/android/content/Intent.html

Sign In or Register to comment.