Jul 12, 2013

Networking Library for Java ME: Networking ME

Hi, all

One more time, it is a pleasure for me to announce another project of mine for this amazing platform: Networking ME.

Networking ME is a networking library for Java ME platform. It's built on top of Generic Connection Framework and other foundation technologies. It has a modular architecture with well-designed, feature-rich APIs that are easy to use.

For this initial release, I focused on HTTP connections, which notoriously is the most used protocol by internet services nowadays, because of its versatility and interoperability.

To work with HTTP connections in Java ME is not complicated itself, as you may know. On the other hand, it requires a good number of lines of code to make things happen, e.g., start a new thread, handle exceptions (either I/O or security), parse the result response, etc. Besides, there are some lack of features, e.g., session management, cookie tracking, URL redirect, etc. Because of these matters, I decided to develop Networking ME and make mine and developers' life easier.

Networking ME was created based on some codes of mine, which I used to implement the same tasks mentioned above in some apps that I worked on. Finally, I have decided to compile them all in a library, so my future apps and other developers could use them as well.

Stop talking and show me the code!, you may be thinking. :) Alright, here it goes:

...
URL url = new URL("http://www.emobtech.com");
HttpRequest req = new HttpRequest(url);
//
RequestOperation oper = new RequestOperation(req);
oper.start(new TextListener() {
    public void onText(String text) {
        System.out.println(text);
    }
    public void onFailure(Request req, RequestException e) {
        System.out.println(exception.getMessage());
    }
});
...

Easy and clean, huh?

The code above shows a basic HTTP request. In the project's Wiki you will find more example usages, e.g. download image, POST data, upload file, etc. It is just an appetizer.

In terms of requirements, Networking ME is implemented using MIDP 2.0 and CLDC 1.0. That's pretty much what all Java ME devices available in the market support at least.

That's it! I invite everybody to visit the project's website and take a look at everything and download the release v1.0.0. By the way, Networking ME is under MIT.

I am really excited about this new project and I hope everybody like and find it useful.

See you in the next post...

3 comments:

Tunde Sanusi said...

A*m new to J2ME Programming,please can you teach me how to insert this code into Resource code in Source packages

Ernandes Mourão Júnior said...

Which IDE are you using? If Eclipse, just go:

- Project's Properties
- Build Path
- Libraries (add you jar there)
- Order & Export (mark the jar you added)

Regards,

Unknown said...

Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!

JAVA Training Center in Chennai