简体   繁体   English

zxing条码扫描器需要向android清单文件添加什么?

[英]What needs to be added to the android manifest file for the zxing barcode scanner?

I have used Intent to integrate the zxing barcode scanner into my application but i am lost on what needs to be in the manifest. 我已经使用Intent将zxing条形码扫描仪集成到我的应用程序中,但是我对清单中需要的内容一无所知。 As of right now when i click on the button to launch the camera it causes a force close, when i click force close the barcode scanner opens up behind and works. 截至目前,当我单击按钮以启动相机时,它会导致强制关闭,当我单击强制关闭时,条形码扫描仪会在后面打开并起作用。 The code linked to the button is as follows: 链接到该按钮的代码如下:

    public void onClick(View v) {
    Intent intent = new Intent("com.google.zxing.client.android.SCAN");
    intent.setPackage("com.google.zxing.client.android");
    intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
    startActivityForResult(intent, 0);     
    }
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == 0) {         
        if (resultCode == RESULT_OK) {
            contents = intent.getStringExtra("SCAN_RESULT");
            format = intent.getStringExtra("SCAN_RESULT_FORMAT");
            // Handle successful scan         
            } else if (resultCode == RESULT_CANCELED) {
                // Handle cancel          
            }
        }
}

this is the android manifest file: 这是android清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="andrew.markley.android.firstGame"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="8" />
    <uses-feature android:name="android.hardware.CAMERA"/>
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".create" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="com.google.zxing.client.android.SCAN" />
                <category android:name="com.google.zxing.client.android" />
            </intent-filter> 
    </activity>         
    <activity android:name=".Scan" android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"                android:theme="@android:style/Theme.NoTitleBar.Fullscreen"                android:windowSoftInputMode="stateAlwaysHidden">        <intent-filter>          <action android:name="android.intent.action.MAIN"/>          <category android:name="android.intent.category.LAUNCHER"/>        </intent-filter>        <intent-filter>          <action android:name="com.google.zxing.client.android.SCAN"/>          <category android:name="android.intent.category.DEFAULT"/>        </intent-filter>  </activity>
    </application>

  <uses-permission android:name="android.permission.CAMERA"/>
</manifest>

The logcat trace is extremely long: logcat跟踪非常长:

D/RILJ    ( 1470): [1696]< SCREEN_STATE error: com.android.internal.telephony.Co
mmandException: GENERIC_FAILURE
D/HTC_RIL ( 1211): (t=1299683238)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683241)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683250)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683253)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683256)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683259)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683265)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683268)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683271)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683274)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683280)%% +HTCUCSQ: 16\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683283)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683286)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683295)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683304)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683310)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683322)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683325)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683331)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683334)%% +HTCUCSQ: 22\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683344)%% +HTCUCSQ: 15\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683347)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683350)%% +HTCUCSQ: 16\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683353)%% +HTCUCSQ: 13\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683356)%% +HTCUCSQ: 15\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683359)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683362)%% +HTCUCSQ: 21\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683374)%% +HTCUCSQ: 22\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683386)%% +HTCUCSQ: 21\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683389)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683392)%% +HTCUCSQ: 21\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683398)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683407)%% +HTCUCSQ: 21\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683413)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683419)%% +HTCUCSQ: 21\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683425)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683428)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683431)%% +HTCUCSQ: 15\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683434)%% +HTCUCSQ: 16\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683437)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683440)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683443)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683455)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683458)%% +HTCUCSQ: 21\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683470)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683473)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683476)%% +HTCUCSQ: 14\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683482)%% +HTCUCSQ: 15\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683485)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683494)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683497)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683500)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683503)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683506)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683512)%% +HTCUCSQ: 16\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683521)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683527)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683530)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683536)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683539)%% +HTCUCSQ: 16\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683542)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/RILJ    ( 1470): [1697]> SCREEN_STATE: false
W/RILSWITCH( 1211): RIL REQUEST: SCREEN_STATE --> Vendor RIL
D/HTC_RIL ( 1211): ril_func_screen_state_notified():called
D/HTC_RIL ( 1211): fd_ballots():AP 0 votes to enable fast dormancy!
D/HTC_RIL ( 1211): (t=1299683544)>> AT+ENCSQ=0\r
D/GSM     ( 1470): [DataConnection] Stop poll NetStat
D/GSM     ( 1470): [DataConnection] Start poll NetStat
D/HTC_RIL ( 1211): (t=1299683544)<< 0\r
D/HTC_RIL ( 1211): (t=1299683544)>> AT+CREG=1\r
D/HTC_RIL ( 1211): (t=1299683544)<< 0\r
D/HTC_RIL ( 1211): (t=1299683544)>> AT+CSQ\r
D/HTC_RIL ( 1211): (t=1299683544)<< +CSQ: 17,99\r\n0\r
D/HTC_RIL ( 1211): (t=1299683544)>> AT@HTCPDPFD=1\r
D/HTC_RIL ( 1211): (t=1299683544)XX @PDPFD: garbage_count=0\r\n
D/HTC_RIL ( 1211): (t=1299683544)<< 0\r
D/HTC_RIL ( 1211): (t=1299683544)>> AT+HTCPDPFD=1\r
D/HTC_RIL ( 1211): (t=1299683544)<< 4\r
D/RILSWITCH( 1211): RILD <-- RIL (token 0xd298)
D/RILSWITCH( 1211): atdToken : 0xd298, bECMRedirected 0
D/RILJ    ( 1470): [1697]< SCREEN_STATE error: com.android.internal.telephony.Co
mmandException: GENERIC_FAILURE
D/RILJ    ( 1470): [1698]> SCREEN_STATE: true
W/RILSWITCH( 1211): RIL REQUEST: SCREEN_STATE --> Vendor RIL
D/HTC_RIL ( 1211): ril_func_screen_state_notified():called
D/HTC_RIL ( 1211): fd_ballots():AP 0 votes to disable fast dormancy!
D/HTC_RIL ( 1211): (t=1299683723)>> AT+ENCSQ=1\r
D/HTC_RIL ( 1211): (t=1299683723)<< 0\r
D/HTC_RIL ( 1211): (t=1299683723)>> AT+CREG=2\r
D/GSM     ( 1470): [DataConnection] Stop poll NetStat
D/GSM     ( 1470): [DataConnection] Start poll NetStat
D/HTC_RIL ( 1211): (t=1299683723)<< 0\r
D/HTC_RIL ( 1211): (t=1299683723)>> AT+CSQ\r
D/HTC_RIL ( 1211): (t=1299683723)<< +CSQ: 20,0\r\n0\r
D/HTC_RIL ( 1211): (t=1299683723)>> AT+CREG?\r
D/HTC_RIL ( 1211): (t=1299683723)<< +CREG: 2,1,"9CCE","000060ED"\r\n0\r
D/HTC_RIL ( 1211): (t=1299683723)>> AT+CGREG?\r
D/HTC_RIL ( 1211): (t=1299683723)<< +CGREG: 1,1\r\n0\r
D/HTC_RIL ( 1211): (t=1299683723)>> AT+COPS=3,2;+COPS?\r
D/HTC_RIL ( 1211): (t=1299683723)<< +COPS: 0,2,"31026",3\r\n0\r
D/HTC_RIL ( 1211): (t=1299683723)>> AT@HTCPDPFD=0\r
D/HTC_RIL ( 1211): (t=1299683723)XX @PDPFD: garbage_count=0\r\n
D/HTC_RIL ( 1211): (t=1299683723)<< 0\r
D/HTC_RIL ( 1211): (t=1299683723)>> AT+HTCPDPFD=0\r
D/HTC_RIL ( 1211): (t=1299683723)<< 4\r
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/RILSWITCH( 1211): RILD <-- RIL (token 0xdf88)
D/RILSWITCH( 1211): atdToken : 0xdf88, bECMRedirected 0
D/RILJ    ( 1470): [1698]< SCREEN_STATE error: com.android.internal.telephony.Co
mmandException: GENERIC_FAILURE
D/HTC_RIL ( 1211): (t=1299683725)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683731)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683734)%% +HTCUCSQ: 21\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683740)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683758)%% +HTCUCSQ: 20\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683761)%% +HTCUCSQ: 19\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683770)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683779)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683782)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683788)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683791)%% +HTCUCSQ: 18\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683794)%% +HTCUCSQ: 16\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683797)%% +HTCUCSQ: 15\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/HTC_RIL ( 1211): (t=1299683800)%% +HTCUCSQ: 17\r\n
D/RILSWITCH( 1211): Vendor RIL ----> UNSOLICITED: 1009
D/RILSWITCH( 1211): Sending vendor RIL unsolicited message to rild
D/RILJ    ( 1470): [1699]> SCREEN_STATE: false
W/RILSWITCH( 1211): RIL REQUEST: SCREEN_STATE --> Vendor RIL
D/HTC_RIL ( 1211): ril_func_screen_state_notified():called
D/HTC_RIL ( 1211): fd_ballots():AP 0 votes to enable fast dormancy!
D/HTC_RIL ( 1211): (t=1299683802)>> AT+ENCSQ=0\r
D/HTC_RIL ( 1211): (t=1299683802)<< 0\r
D/HTC_RIL ( 1211): (t=1299683802)>> AT+CREG=1\r
D/GSM     ( 1470): [DataConnection] Stop poll NetStat
D/GSM     ( 1470): [DataConnection] Start poll NetStat
D/HTC_RIL ( 1211): (t=1299683802)<< 0\r
D/HTC_RIL ( 1211): (t=1299683802)>> AT+CSQ\r
D/HTC_RIL ( 1211): (t=1299683802)<< +CSQ: 17,99\r\n0\r
D/HTC_RIL ( 1211): (t=1299683802)>> AT@HTCPDPFD=1\r
D/HTC_RIL ( 1211): (t=1299683802)XX @PDPFD: garbage_count=0\r\n
D/HTC_RIL ( 1211): (t=1299683802)<< 0\r
D/HTC_RIL ( 1211): (t=1299683802)>> AT+HTCPDPFD=1\r
D/HTC_RIL ( 1211): (t=1299683802)<< 4\r
D/RILSWITCH( 1211): RILD <-- RIL (token 0xd298)
D/RILSWITCH( 1211): atdToken : 0xd298, bECMRedirected 0
D/RILJ    ( 1470): [1699]< SCREEN_STATE error: com.android.internal.telephony.Co
mmandException: GENERIC_FAILURE

Do you want to call the installed Barcode Scanner app? 您要调用已安装的条形码扫描仪应用程序吗? I did the same a week ago. 我一周前也做过。

Here's my code: 这是我的代码:

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
startActivityForResult(intent, 0);

AndroidManifest.xml AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="de.myPackage"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".MyApp"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>

Hope this helps. 希望这可以帮助。

The ZXing project provides some code for calling XZing via an Intent on their Wiki: ZXing项目提供了一些通过其Wiki上的Intent调用XZing的代码:

http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java

If you're using that code, you don't need to add anything to your manifest file. 如果使用该代码,则无需在清单文件中添加任何内容。 From your activity you can just call 从您的活动中,您可以致电

IntentIntegrator.initiateScan(this);

That will take care of verifying that ZXing is installed, and prompt the user to install it via the Marketplace if it isn't. 这将确保您已安装ZXing,并提示用户通过Marketplace进行安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM