0

I need to integrate socket mobile Bluetooth scanner on my android app.. i tried there SDK they prescribed in their site https://docs.socketmobile.com/capture/java/en/latest/getting-started.html but its not getting the scanned result. and this is my activity.

class ScannerMobileActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_scanner_mobile)
    setSupportActionBar(toolbar)


    Capture.builder(applicationContext)
        .enableLogging(BuildConfig.DEBUG)
        .build()


}


@Subscribe(threadMode = ThreadMode.MAIN)
fun onMessageEvent(event: DataEvent) {
    Log.i(TAG, event.data.string)
    //dataSourceView.text = event.data.dataSource.name
    textView2.text = event.data.string
}


    companion object {
        private val TAG : String = MainActivity::class.java.name
    }


public override fun onStart() {
    super.onStart()
    EventBus.getDefault().register(this)
}

public override fun onStop() {
    super.onStop()
    EventBus.getDefault().unregister(this)
}

}

Enrico
  • 10,377
  • 8
  • 44
  • 55
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. – moritzg Mar 20 '19 at 11:52

1 Answers1

1

What version android are you using? if it is 9.0, this might be it: https://docs.socketmobile.com/capture/java/en/latest/android/getting-started.html#targeting-android-28