Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

281
Views
Cómo obtener permiso para acceder a la cámara en NodeJS en Android

Quiero escribir una aplicación de Android no típica, una aplicación de servidor, de hecho. Cuando el servidor recibe una solicitud, necesita capturar una imagen de una cámara, realizar un procesamiento personalizado y enviar una respuesta al cliente.

El servicio nodejs que escribí (ver más abajo) usa dory para la instalación de nodejs. El servicio funciona en mi PC de escritorio. Pero el paquete node-webcam no es compatible con teléfonos móviles. No he podido encontrar un paquete que admita cámaras en Android.

¿Hay alguna forma de acceder a la cámara en Android?

 const http = require('http'); const NodeWebcam = require( "node-webcam" ); const app = http.createServer((req, res) => { if( req.url === "/image" ) { var opts = { callbackReturn: "base64" }; NodeWebcam.capture( "test_picture", opts, function( err, data ) { let imageHTML = "<div>Error: " + JSON.stringify(err) + "</div>"; if( data ) { imageHTML = "<img src='" + data + "'>"; } // Set a response type of plain text for the response res.writeHead(200, {'Content-Type': 'text/html'}); // Send back a response and end the connection res.end(`<html><body>${imageHTML}</body></html>`); }); } else { // Set a response type of plain text for the response res.writeHead(200, {'Content-Type': 'text/plain'}); // Send back a response and end the connection res.end('NodeJS Server Online!\n\nContent is king!'); } }); // Start the server on port 3000 app.listen(3000, '0.0.0.0');
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!