Well,I have an app that sends data to server as soon as bar code is scanned. But bar code has to be scanned every time the apk is changed. The data through the bar code is still there but we have to click on scan barcode every time we upload a new apk.
I want to make it like as soon as i apk it starts sendind data.
Is it possible? Any help will be greatly appreciated.
Well,I have an app that sends data to server as soon as bar code
Share
I presume you have a method that you call on press of the scan button that preforms the scan. In that case create a timer that calls that method and attempts to scan for a barcode. Use a fairly low value for the interval such as 1 or 2 seconds.
You will have to ensure that your code won’t try to upload a barcode unless it finds one but this isn’t a hard change.
Android docs reference:
http://developer.android.com/reference/java/util/Timer.html
A decent tutorial on how timers work:
http://steve.odyfamily.com/?p=12