Image upload using BrowserComponent (Android)

29 views
Skip to first unread message

migue...@bitxenio.com

unread,
Feb 26, 2018, 11:58:06 AM2/26/18
to CodenameOne Discussions
Hello:

   I'm having difficulties trying to upload images from Android using BrowserComponent on an image upload page. At first I looked for bugs in my html image upload page, to no avail, so I switched to several other image upload pages on the web and all of them fail.

   You can try using http://imgbb.com for example. Clicking on the big blue "upload image" button doesn't do anything (in the CodenameOne BrowserComponent, on Android). Using the same page in mobile chrome works as intended.

   I tried adding android.permission.CAMERA to conenameone.settings but it doesn't make a difference.

   I also tried to force the "request access to camera" permission by adding a camera capture Form in my app, and launching that Form before the BrowserComponent one. In this case, the camera capture using the Capture Form works ok, but doesn't make any difference on any later BrowserComponent behaviour.

   Any advice?

Shai Almog

unread,
Feb 26, 2018, 11:17:52 PM2/26/18
to CodenameOne Discussions
Hi,
unfortunately this is a problem with Android: https://stackoverflow.com/questions/40507338/how-to-open-html-input-type-file-dialog-box-inside-codenameone-app/40520092#40520092

You just can't do that. Notice it's a problem with native Android and relates to security constraints it's not an inherent problem in Codename One.

Reply all
Reply to author
Forward
0 new messages