코드바에서 응용 프로그램을 개발 중이지만 Zxing의 바코드 스캐너가 열리고 닫힙니다. 스캔/종료 버튼과 닫기 버튼을 추가해야하는 제품을 스캔 한 후 자동으로 스캐너가 열리거나 닫히지 않아야합니다. 또한 스캔 된 제품이 데이터베이스 (SQL SERVER)에 있는지 확인하고 제품 정보를 반환해야하지만 Google에 도움을 요청했지만 도움을 요청할 필요가 있습니다. 다음은 Eclipse 코드입니다. 내가 UI를 수정할 수있는 내 ZXING 바코드 스캐너 플러그인의 내 컨트롤을 추가 할 수있는 방법을 알고 싶습니다. 이클립스에서 개발 중이며 IIS에서 호스팅되는 웹 API 서비스를 사용하여 안드로이드 앱에 액세스 할 수 있습니다. 최대한 빨리 수행하십시오. 내 바코드 UI를 수정하여 내 컨트롤을 추가 할 수 있습니다.PhoneGap 바코드 스캐너 호
public void scan() {
Intent intentScan = new Intent(SCAN_INTENT);
intentScan.addCategory(Intent.CATEGORY_DEFAULT);
this.cordova.startActivityForResult((CordovaPlugin) this, intentScan, REQUEST_CODE);
}
내 OnStartActivity 코드는 여기에 코드가 있지만 귀하의 코드와 같아 보입니다.
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == REQUEST_CODE) {
if (resultCode == Activity.RESULT_OK) {
JSONObject obj = new JSONObject();
try {
obj.put(TEXT, intent.getStringExtra("SCAN_RESULT"));
obj.put(FORMAT, intent.getStringExtra("SCAN_RESULT_FORMAT"));
obj.put(CANCELLED, false);
} catch (JSONException e) {
Log.d(LOG_TAG, "This should never happen");
}
//this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback);
this.callbackContext.success(obj);
} else if (resultCode == Activity.RESULT_CANCELED) {
JSONObject obj = new JSONObject();
try {
obj.put(TEXT, "");
obj.put(FORMAT, "");
obj.put(CANCELLED, true);
} catch (JSONException e) {
Log.d(LOG_TAG, "This should never happen");
}
//this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback);
this.callbackContext.success(obj);
} else {
//this.error(new PluginResult(PluginResult.Status.ERROR), this.callback);
this.callbackContext.error("Unexpected error");
}
}
}
나는 이미 거기 있던 나의 부호를 배치하고 배치했다 그러나 아직도 작동하지 않는다 –
늦은 대답을 위해 유감스러운 ... 그래서 아직도 동일한 일을하고있다 .. 그것은 스캐너를 열고 inmediatly를 닫는다 ... 다른 QR 스캐너를 사용하려고 ... QR 드로이드를 사용하는 것이 좋습니다 – geekCode
QR 드로이드는 ZXIng보다 잘 작동합니까? –