Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a browser window in J2ME?

Tags:

java-me

How can i create a browser component in J2ME which can display web pages inside an application? Is there any API available for this ? or is this really possible ?

like image 986
Jinesh Avatar asked Mar 17 '09 11:03

Jinesh


4 Answers

My experiences:

  1. J2MEPolish has HTML browser. It costs 990EUR per app and you need to use J2MEPolish to use it. But be warned: their HTML browser has many issues, it supports forms and other advanced elements, but if you try to get something you like then rendering quality is bad (e.g. no spacing, defaults to center view etc). Free evaluation/GPL is available.
  2. PocketLearn J2ME HTML Component - http://www.j2mehtml.com/ seems to have less features but much better rendering quality. This is not free as well, and there they do not provide any useful evaluation download or public license fee info.
  3. J2ME cHTML browser is free and open source, but no docs (and probably no quality too)
like image 148
JaakL Avatar answered Nov 26 '22 00:11

JaakL


As far as I know, the only browser written in J2ME is Opera Mini (not to get confused with Opera Mobile, which is a different thing). It runs amazingly good even on very low end phones, but most of the HTML handling is done on a special server that Opera hosts, and the client gets optimizes, preformatted, binary data to display.

Doing everything on the phone using Java might be hard or even impossible. You'd be able to code up a browser that displays very basic HTML pages, but doing it right even for more complex pages seems to be impossible on J2ME because of the limited memory and CPU.

I could imagine that some high end phones come with a custom API to embed a native browser into you Midled, but the standart J2ME definitely does not have this.

like image 42
Lena Schimmel Avatar answered Nov 26 '22 02:11

Lena Schimmel


The only portable way to display a web page in the browser is with:

MIDlet.platformRequest(String URL);

On some mobile, this will terminate the J2ME application though.

like image 29
Maurice Perry Avatar answered Nov 26 '22 00:11

Maurice Perry


The Content handling API is what you're looking for.

That's JSR 211.

Unfortunately, to do what you want, you would need to find a handset that contains an implementation of JSR211 that is both complete and correct.

That doesn't exist yet as far as I know.

The only J2ME emulator that I know that may allow you to launch a web browser window (outside of a MIDlet) is the Nokia Series60 emulator. That doesn't have a complete implementation of JSR 211.

like image 44
michael aubert Avatar answered Nov 26 '22 00:11

michael aubert