Simcom Smart Device Scan Head interface description [go]

Source: Internet
Author: User

Document title:simcom Smart Device Scan Head Interface description

version:1.01

Date:2014-02-13

Status:release

Document Control id:sim0005

Writer:Yunqi.miao

Open Scan with program code

Broadcast implementation, broadcast name: Android.intent.action.SIMSCAN

Example:

Context.sendbroadcast (New Intent ("Android.intent.action.SIMSCAN"));

Description

The scanning light lasts for up to 6 seconds when the scan is turned on via program broadcast, i.e. the laser light of the scanning head is automatically switched off after 6 seconds.

To turn off scanning through program code

Broadcast implementation, broadcast name: Android.intent.action.SIMSCAN

Example:

Context.sendbroadcast (New Intent ("Android.intent.action.SIMSCAN"));

Description

When scanning via program broadcast, the scanning lamp lasts for a maximum of 6 seconds, that is, the laser light of the scanning head will be automatically closed after 6 seconds, then the scanning head can be closed by the above broadcast in 6 seconds.

Get scan results from program code

Broadcast implementation, broadcast name is: Com.sim.action.SIMSCAN, broadcast parameters are: value, parameter type: String

Example:

@Override

protected void OnCreate (Bundle savedinstancestate) {

Super.oncreate (savedinstancestate);

Mreceiver = new Broadcastreceiver () {

@Override

public void OnReceive (context context, Intent Intent) {

To allow other broadcast registrants to be unable to obtain broadcast information, * * * here must be * * *

This.abortbroadcast ();

Get scan results Information here

Final String Scanresult = Intent.getstringextra ("value");

Mtvscanresult.settext (Scanresult);

Mtvscanresult.invalidate ();

}

};

Mfilter = new Intentfilter ("Com.sim.action.SIMSCAN");

When the user gets the data themselves, the broadcast priority is tuned to the highest 1000,*** here must * * *

Mfilter.setpriority (intentfilter.system_high_priority);

}

@Override

protected void Onresume () {

Super.onresume ();

Register a broadcast to get scan results

This.registerreceiver (Mreceiver, Mfilter);

}

@Override

protected void OnPause () {

Log off the broadcast to get scan results

This.unregisterreceiver (Mreceiver);

Super.onpause ();

}

Note: When getting the scan results, it is important to focus on

1) When the program captures the broadcast, it needs to execute:

This.abortbroadcast ();

2) The broadcast receive priority needs to be adjusted to the highest level:

Mfilter.setpriority (intentfilter.system_high_priority);

Simcom Smart Device Scan Head interface description [go]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.