Hi Boki,
You may, or may not, be interested in the following (negative) feedback on
aspects of your source code:
import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.lang.String.*;
import javax.microedition.io.*;
import javax.bluetooth.*;
import java.util.*;
import java.io.IOException;
import de.avetana.javax.obex.*;
import de.avetana.obexsolo.*;
Use some kind of logical sorting order for your imports, and use this order
consistently. Interleaving java.* and javax.* imports is a no-no in my book.
I also import home-grown packages first (your de.*) to highlight the fact
that the current source file relies on non-standard packages.
////////////
// midp/cldc API
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.i

utputStream;
import java.util.Vector;
import java.util.Hashtable;
You don't list these in alpha order, you've already imported IOException in
the earlier import lines. Your way of specifying imports is a mess,
basically. You may think "So what? Who cares?", well, possibly some
newsgroup contributors may not be too eager to wade through code that's a
mess, when you ask us to help and debug your code...
public class boki extends MIDlet {
Class names should start with a capital letter. And should reflect the
essence of the purpose of the class, "boki" does neither.
/** Stream with image data */
private InputStream imageSource = null;
private ByteArrayOutputStream baos = null;
10 out of 10 for declaring your fields private, BUT, you need to spend more
time on naming your variables properly. "imageSource" is a poor name.
"imageInputStream" would probably be far more readable in statements using
the variable.
/** Array with image data */
private byte[] imageData = null;
You don't need to initialize fields to null. Java does this by default. What
you're doing is like importing java.lang.*.... it's totally unnecessary.
// read image data and create a byte array
byte[] buff = new byte[1024];
buff or buffer? Why chop off 2 lousy characters and to save yourself minimal
typing at the expense of readability?
baos = new ByteArrayOutputStream(1024);
How many more times would specifying "1024" like that be necessary before
you realise the need for a symbolic constant ? ;-)
You use "imageData" earlier, and now you've gone back to "img" instead of
"image". At the very least be consistent, and try not to abbreviate things
if at all possible.
Never catch everything like this, use explicit sub-exception types.