Sean,
I am able to fix this error by changing the heap size of eclipse. But I am encountering a new error.
[2008-07-18 11:15:34 - BarcodeScan] ------------------------------
[2008-07-18 11:15:34 - BarcodeScan] Android Launch!
[2008-07-18 11:15:34 - BarcodeScan] adb is running normally.
[2008-07-18 11:15:34 - BarcodeScan] Could not find BarcodeScan.apk!
This is what I am getting after running the application. I found some people got this error before but couldn't find any answer to this. could you please help me regarding this? I'm pasting the code again.
Thanks in advance,
Ivar
package
com.co;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MonochromeBitmapSource;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.Reader;
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.ResultPoint;
import com.google.zxing.client.j2se.BufferedImageMonochromeBitmapSource;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class Scan extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
// Reader to read all formats
Reader reader = new MultiFormatReader();
File inputFile = new File("test.gif");
BufferedImage input;
Result result;
try {
input = ImageIO.read(inputFile);
MonochromeBitmapSource source = new BufferedImageMonochromeBitmapSource(input);
result = reader.decode(source);
// Displaying the barcode
String text = result.getText();
tv.setText(text);
setContentView(tv);
//byte[] rawBytes = result.getRawBytes();
//BarcodeFormat format = result.getBarcodeFormat();
//ResultPoint[] points = result.getResultPoints();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (ReaderException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}