简体   繁体   中英

Dart Language and Android: accessing phone's camera

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?

(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 ...

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM