title: How to scan barcode lines with VARCHAR Chars For example OfficeEqp35023U11 In android Kotlin
body: <p>How to scan barcode lines with VARCHAR Chars For example OfficeEqp35023U11 In android Kotlin</p>
  <p>Struggling to scan this asset image
  <a href="https://i.stack.imgur.com/XVzoC.jpg" rel="nofollow noreferrer">Struggling to scan this asset image</a></p>
  <p>class BarcodeScannerActivity :  AppCompatActivity(), ZXingScannerView.ResultHandler {
  private var mScannerView: ZXingScannerView? = null
  lateinit var apiInterface: APIInterface</p>
  <pre><code>public override fun onCreate(state: Bundle?) {
      super.onCreate(state)
      setContentView(R.layout.activity_barcode_scanner)
  
  
  
      ssoId = intent.getStringExtra(&quot;initiator&quot;)
      val contentFrame = findViewById&lt;View&gt;(R.id.content_frame) as ViewGroup
  
      mScannerView = ZXingScannerView(this)
      contentFrame.addView(mScannerView)
  }
  </code></pre>
  <p>public override fun onResume() {
  super.onResume()
  mScannerView!!.setResultHandler(this)
  mScannerView!!.startCamera()
  }</p>
  <pre><code>public override fun onPause() {
      super.onPause()
      mScannerView!!.stopCamera()
  }
  
  
  override fun handleResult(rawResult: Result) {
      Toast.makeText(
          this, &quot;Contents = &quot; + rawResult.text +
                  &quot;, Format = &quot; + rawResult.barcodeFormat.toString(), Toast.LENGTH_SHORT
      ).show()
      var result = rawResult.text
  
      if (result.isDigitsOnly()) {
  
          assetTag = result.filter { it.isLetterOrDigit()  }
  
  
          mScannerView!!.stopCamera()
          apiInterface = APIClient.client!!.create(APIInterface::class.java)
  
          val call: Call&lt;Verifiedd&gt; =
              apiInterface.saveVerification(assetTag, ssoId, ssoId, &quot;Verified&quot;, &quot;Verified&quot;)
  
          call.enqueue(object : Callback&lt;Verifiedd&gt; {
              override fun onResponse(call: Call&lt;Verifiedd&gt;, response: Response&lt;Verifiedd&gt;) {
                  if (response.body() != null) {
                      lovelyProgressDialog?.dismiss()
                      Log.d(&quot;TAG&quot;, response.code().toString() + &quot;&quot;)
                      var displayResponse = &quot;&quot;
                      val resource: Verifiedd = response.body()!!
                      responseCode = resource.responseCode
                      responseMessage = resource.responseMessage
                      if (responseMessage == &quot;Data persisted successfully &quot; || responseMessage.equals(
                              &quot;Data persisted successfully &quot;
                          )
                      ) {
                          Toasty.normal(
                              this@BarcodeScannerActivity,
                              &quot;&quot;,
                              Toasty.LENGTH_LONG
                          ).show()
  
  
                      } else if (responseMessage == &quot;&quot; || responseMessage.equals(
                              &quot;&quot;
                          )
                      ) {
                          Toasty.normal(
                              this@BarcodeScannerActivity,
                              &quot;Invalid Asset Verification status values&quot;,
                              Toasty.LENGTH_LONG
                          ).show()
                          val intent =
                              Intent(this@BarcodeScannerActivity, BranchItemsActivity::class.java)
                          intent.flags =
                              Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
                          intent.putExtra(
                              &quot;initiator&quot;, ssoId
                          )
  
  
  
                          startActivity(intent)
  
                      }
  
                  }
              }
  
              override fun onFailure(call: Call&lt;Verifiedd&gt;, t: Throwable) {
                  Toasty.normal(
                      this@BarcodeScannerActivity,
                      &quot;Server Error&quot;,
                      Toasty.LENGTH_LONG
                  ).show()
              }
          })
  </code></pre>