1

I'm trying to use JPEGImageDecoder interface on my android application, but my application stops unexpectedly. the following code snippet:

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageDecoder;

InputStream in = new FileInputStream(filename);
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);

Why my application stops unexpectedly or Can I use these packages on android?

David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
AraZZ
  • 167
  • 1
  • 1
  • 8

1 Answers1

0

Don't think you can use those packages on android. Android uses BitmapFactory (android.graphics.BitmapFactory) to handle image decoding. What does the stack trace show?

Vector
  • 359
  • 2
  • 6
  • yes, you are right. i can't use all java libraries in android. so app stops to work. how can i trace errors or exceptions in eclipse during execution? but when i compile Starting activity com.example.compare.HelloAndroid on device emulator-5554 works fine – AraZZ Jul 17 '11 at 14:08
  • You can use the [adb tool](http://developer.android.com/guide/developing/tools/adb.html) or the [DDMS tool in eclipse](http://developer.android.com/guide/developing/debugging/ddms.html) – Vector Jul 17 '11 at 14:49