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

141
Views
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
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!