当前位置: 首页 > 面试题库 >

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

冯德宇
2023-03-14
问题内容

我已经使用Intent将zxing条形码扫描仪集成到我的应用程序中,但是我对清单中需要的内容一无所知。截至目前,当我单击按钮以启动相机时,它会导致强制关闭,当我单击强制关闭时,条形码扫描仪将在后面打开并起作用。链接到该按钮的代码如下:

    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          
            }
        }
}

这是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>

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

问题答案:

ZXing项目提供了一些通过其Wiki上的Intent调用XZing的代码:

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

如果使用该代码,则无需在清单文件中添加任何内容。从您的活动中,您可以致电

IntentIntegrator.initiateScan(this);

这将确保您已安装ZXing,并提示用户通过Marketplace进行安装。



 类似资料:
  • 问题内容: 我想为Android创建一个应用程序,它将能够扫描条形码,获取条形码中包含的信息,然后能够以某种方式使用该信息。 我不知道如何创建条形码扫描仪,所以我去了Google搜索,看来Zxing是在应用程序中实现条形码扫描仪的最常用方法。 一些链接: http://code.google.com/p/zxing/ http://awalkingcity.com/blog/2008/08/25/

  • 本文向大家介绍详解Android 扫描条形码(Zxing插件),包括了详解Android 扫描条形码(Zxing插件)的使用技巧和注意事项,需要的朋友参考一下 使用Android Studio 一、在build.gradle(Module:app)添加代码  下载,调用插件 二、添加权限 三、Activity代码 以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希

  • 本文向大家介绍Android中google Zxing实现二维码与条形码扫描,包括了Android中google Zxing实现二维码与条形码扫描的使用技巧和注意事项,需要的朋友参考一下 Android中google Zxing实现二维码与条形码扫描 了解二维码这个东西还是从微信中,当时微信推出二维码扫描功能,自己感觉挺新颖的,从一张图片中扫一下竟然能直接加好友,不可思议啊,那时候还不了解二维码,

  • 我遵循这篇材料在Android中实现QRCode Scanner。 一步一步地,在我的应用程序中实现以下代码后,我在GingerreadOpenCameron aInterface.java类中收到错误。下面的图像是我面临的错误。 错误显示为: 以下是清单文件: 下面这个问题有人能帮我吗?

  • 本文向大家介绍Android-Zxing实现二维码的扫描与生成,包括了Android-Zxing实现二维码的扫描与生成的使用技巧和注意事项,需要的朋友参考一下 Zxing: Zxing是一个开放源码,用java实现的多种格式的1D/2D条码图像处理库,它包含了联系到其他语言的端口。可以实现使用手机内置摄像头完成条形码的扫描以及解码。 github: https://github.com/zxing

  • 使用ML Kit的条码扫描API,您可以读取大多数使用标准条码格式编码的数据。 条形码是将信息从现实世界传递到应用程序的一种便捷方式。特别是,使用QR码等二维格式时,您可以编码结构化数据,如联系人信息或WiFi网络凭证。由于ML Kit可以自动识别和解析这些数据,因此当用户扫描条形码时,您的应用可以进行智能响应。 iOS Android 关键功能 阅读大多数标准格式 线性格式:Codabar,Co