Skip to content

selectInput() is not working in Android mode. #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bizkitj opened this issue Feb 16, 2017 · 3 comments
Open

selectInput() is not working in Android mode. #296

bizkitj opened this issue Feb 16, 2017 · 3 comments

Comments

@bizkitj
Copy link

bizkitj commented Feb 16, 2017

`
void setup() {
selectInput("Select a file to process:", "fileSelected");
}

void fileSelected(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
} else {
println("User selected " + selection.getAbsolutePath());
}
}`

switch from Java mode to Android mode, processing gives error, Am I doing something stupid?

@codeanticode
Copy link
Contributor

Hi, unfortunately the selectInput() function is not currently implemented in the Android mode, essentially due to the reason we discussed in #295: there is no native file selection widget in Android. I will mark this as en enhancement, but cannot give you at this time an estimate on when this will be addressed.

@omerjerk
Copy link
Contributor

@codeanticode The simplest to way to implement this would be to use the native file browser app. This app is mostly available on all the devices. Processing-android will call startActivityForResult which will start the file browser activity.
It is explained here - http://stackoverflow.com/questions/7856959/android-file-chooser

@codeanticode
Copy link
Contributor

Also, there is a library that adds this functionality: android-select-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants