スタンドアロンにするために、アプリにzxingを完全に含めました。それは動作しますが、カメラは回転していて(私は反時計回りに90と思います)、奇妙なパディングがあります。私のJava:
package it.mi.action.codmmunicator_2ddecoder;
import android.os.Bundle;
import android.widget.Toast;
import android.graphics.Bitmap;
import com.google.zxing.Result;
import com.google.zxing.client.android.CaptureActivity;
public class Lettore extends CaptureActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lettore);
}
@Override
public void handleDecode(Result rawResult, Bitmap barcode) {
Toast.makeText(this.getApplicationContext(), "Scanned code " + rawResult.getText(), Toast.LENGTH_LONG);
}
}
そして私のxml(インクルードのようにzxingのアクティビティを取ります):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
<ImageView android:src="@drawable/head" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="250dip">
<include layout="@layout/capture" android:toDegrees="90" />
</FrameLayout>
</LinearLayout>
パディングはこれです:https ://dl.dropbox.com/u/16047047/Untitled-1.jpg
誰かが解決策を投稿できますか?
どうもありがとう