Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda