File Chooser not working Construct or Build?

Bugs will be moved here once resolved.

Post » Tue Feb 02, 2016 10:31 pm

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
https://drive.google.com/folderview?id=0B3eaqRhfaUabaHRWOFg1ZXAyTkU&usp=sharing

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: https://www.scirra.com/forum/viewtopic.php?f=147&t=167809

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

Thanks
Rob
Last edited by frozenpeas on Fri Feb 12, 2016 7:45 pm, edited 2 times in total.
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Tue Feb 09, 2016 4:35 pm

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?
Scirra Founder
B
383
S
225
G
86
Posts: 24,134
Reputation: 190,601

Post » Wed Feb 10, 2016 12:48 am

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
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Thu Feb 11, 2016 9:35 pm

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 !
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Fri Feb 12, 2016 2:18 pm

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.
Scirra Founder
B
383
S
225
G
86
Posts: 24,134
Reputation: 190,601

Post » Fri Feb 12, 2016 7:43 pm

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
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Tue Apr 05, 2016 5:36 am

@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.
B
36
S
13
G
1
Posts: 88
Reputation: 3,096


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest