File Chooser not working Construct or Build?

0 favourites
  • 7 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Problem Description

    The file chooser will not load an image into a sprite when exported to apk

    On Android the "Choose an Action" dialogue appears, but no link to the gallery.

    Clicking the camera link and taking a picture and saving and still the sprite does not change.

    Within file chooser I have specified .png,.jpg,.jpeg in the properties.

    On Android I wish to select the file chooser and for it to open a gallery or camera link and for the sprite to change accordingly

    The file chooser works as expected on Chrome, XDK Emulator and NWjs

    I'm building in XDK version 2893 (latest)

    Crosswalk embedded version 15

    CLI 5.1.1

    Have tried Cordova Camera, File and Media and the Custom Intel plugins to no avail.

    Attach a Capx

    Description of Capx

    Just file chooser and a sprite

    Steps to Reproduce Bug

    • Export Cordova app select uses Camera and Media
    • Build in XDK
    • Install on device

    Observed Result

    File chooser on Android opens "Choose an Action" dialogue and select camera, take picture, save picture and sprite does not change

    Further Information on a thread I have created:

    Expected Result

    When selecting file chooser I expect to get the option to select gallery or camera and once an image has been selected for this to appear within the sprite

    Affected Browsers

    • Chrome: (NO)
    • FireFox: (NO)
    • Internet Explorer: (NO)

    Operating System and Service Pack

    This is an Android issue

    Construct 2 Version ID

    221 (64 bit)

    It's very difficult to pinpoint where the problem lies as I have no build errors in XDK so posting here out of desperation and to eliminate at least one from the equation. I very much doubt this is a Construct issue and hope that you confirm this so that I may look at XDK alternatives as a means of building the apk



  • I think for it to work the app needs permission to use the camera (for the camera option) and storage (for the documents option). Have you tried adding android.permission.CAMERA and android.permission.WRITE_EXTERNAL_STORAGE to the app permissions?

    If you're running Android 5.0+, could you try without Crosswalk as well to see if it works with the system webview?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Built a simple file chooser and sprite using XDK with just the android version and cordova camera plugin - Load image from FileChooser.FileURLAt(0)

    Permissions show as "modify or delete the contents of your SD card read the contents of your SD card"

    When you click the file chooser, the recent files list appears (the one that has links to galley, videos, etc) which seems correct

    However, when you click an image, nothing happens. Added a text box to show location of the file which reads something like blob:file%3A///0af12f87.... etc

    Android 5.0.2

  • Removed camera plugin and tried the "cordova-plugin-file"

    Same thing opens recent files list, lets me choose gallery etc

    Select png or jpg and sprite does not change.

    Strange thing also happens when I specify .jpg,.png within construct and build the app. The file chooser does not open the file browser at all !

  • Well the fact it returns a blob: URL indicates the file picker is working and has chosen something. I think maybe it's just Android doesn't support loading images from files like that. I'm afraid it just sounds like Android doesn't support this combination of features - I'm not sure there's anything we can change in C2 to work around that.

  • So, Construct's File Chooser cannot natively load an image from either the camera or the gallery into a sprite on Android.

    Bit of a deal breaker for my current ideas, but at least I can now move on and explore other methods like Bitmap and BitmapFactory. Lots of apps have this feature so it must be possible.

    Thanks Ashley for your reply

  • Ashley and frozenpeas : I just test it using latest C2 (r226) and Intel XDK (3088) my idea of my game is using customizable character with the face can be loaded from user gallery or camera device. And the result is perfect, no issues or error. I tested on galaxy mega (jellybean), when user click face on the game then it'll open dialog box contains gallery, front camera and rear camera (awesome), dropbox, etc. So yes, the image will loaded into my sprite.

    So far no issues, if you want to know about my game, please PM me. My game still under development and i don't want to share to public yet.

    EDIT: I am sorry i didn't read Close Bug category. My bad, please forget my post above.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)