2

I'm starting a project to develop a mobile application where I'll need to access the phone's camera and retrieve a picture/photo.

However, before going to a native application, I would like to know if Dart (compiled to JavaScript, of course) could access Android phone's camera and retrieve that picture. In that case, the application would be web based.

Could Dart do it or I'll need a native application?

Felipe
  • 376
  • 2
  • 5
  • 15

2 Answers2

4

(It's more depending on the browser than on the language...)

There is a dedicated html input tag for this since android 3.0 but i dunno if you can easily access it from dart or if it's enough for you..?

There is also the more conventionnal Html5 mediastream (that should fit all your needs) but it wont work below android 4.4...

Community
  • 1
  • 1
Anthony Bobenrieth
  • 2,758
  • 1
  • 26
  • 38
1

Yes you can access the camera.

window.navigator.getUserMedia(audio: false, video: true)
.then((MediaStream stream) {
  // Stuff happens here
});

Also I've been looking at the Rikulo Gap package and it seems to be able to access the camera as well as other mobile sensors.

https://github.com/rikulo/gap

Peril Ravine
  • 1,142
  • 8
  • 12