Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

How to use camera scene to upload images?
Started by nhungthientai20 Mar 17 2019 08:01 PM

- - - - -
1 reply to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 2 posts
  • Corona SDK

I was thinking how to upload images to FTP server, after invoking camera and taking images on an Android device?  Is it possible to implement an upload button on the camera screen? For example, once the image is captured, a button pops up on the screen so that users can upload the image by clicking that button. Any idea?


[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 473 posts
  • Corona SDK

The built in camera functionality just launches the native camera app which doesn't give you a right lot of control. E.g. the user could return from the app without taking a photo at all.

You could use my plugin to launch a camera preview and handle taking a photo when they tap the screen. Ref the sample code here, https://corona.qweb.co.uk/plugin-android-custom-camera-preview#photo , the plugin passes back the file path to the photo so you'd just use that for your upload. This plugin allows overlaying the preview with one image and/or two text elements, so you could draw a "snap & upload" button if you like.

This currently only supports the rear facing camera though, and will just use the first rear facing camera it finds if there are multiple.