Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
Transfer data from Android with webView to Asp.Net backend

I have an Android App that is basically a webView to our asp.net web application. Now I have to implement a barcode scanner in the Android app to read and transfer the number from the barcode to the asp.net backend. I have this line in js in the web to call the Android function for the barcode scanner:

window.AndroidWebInterface.getIcc();

In Android I tried many different approaches to start the ScanActivity which uses ML Kit to read the barcode which is working fine, but I have problem returning the code I read with the camera to the js caller function from the backend. I can display it in the Android app but don't know how to return it to the backend. Some code from the android app

barcodeScanner.process(inputImage)
            .addOnSuccessListener { barcodeList ->
                val barcode = barcodeList.getOrNull(0)
                // `rawValue` is the decoded value of the barcode
                barcode?.rawValue?.let { value ->
                    // update our textView to show the decoded value
                    binding.bottomText.text = barcode.displayValue

                    val data = Intent()
                    data.putExtra("icc", barcode.displayValue)

                    setResult(Activity.RESULT_OK, data)
                    finish()
                }
            }

registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
    if (result.resultCode == Activity.RESULT_OK) {
        icc = result.data?.getStringExtra("icc")
    }
}

startForResult.launch(Intent(this, ScanActivity::class.java))
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda