The Source for Java Technology Collaboration
User: Password:



Neto Marin's Blog

Community: Embedded Java Archives


Getting started with JME - Part III / III

Posted by netomarin on July 24, 2007 at 10:06 AM | Permalink | Comments (1)

Hi all ... I´m back !!! ;-)

Let´s finish this post series with the last (but not less important) element that´s I think is essential on a quality JME application development: Connectivity !

To be or not to be CONNECTED ?!?!

Because today, be connected is more than a simple feature of a mobile application, it´s a requirement! Since from a simple search until the data synchronization with some service available at the big Net. And why not integration with other systems using SOA and webservices ?
And the way to do all this on JME is using the Generic Connection Framework, or simply, GCF. He is the responsible of this magic! Let´s understand how it´s works.

Presenting, GCF !

When I used the connectivity recourse by the first time, I didn´t believe that´s how should be too easy! I just called the same method for any kind of connection, and so start using some specific protocol like HTTP. How can GCF do this ???

First, let´s analyze the follow image to understand GCF structure:

How we can observe, all and ever kind of connection extends Connection, and so it´s easier to Java manipulate the connection. And, if we think about the net structure, we really realize that´s all connections has the same basic operation mode.

The Connector class

By the static calling of the method open() from Connector class, a new connection is opened. The calling is ever the same, and something like this:

...
try {
   Connector.open("protocol:address;parameters");
} catch (ConnectionNotFoundExeption e) {
   // no handler available for socket connections
}
...

And, if the desired protocol it´s already known, it´s just do the cast to your connection type and so use as you want. You can find practical examples of the usage at API:

Low-level Networking Programming

But, if you´ve created your own application protocol or have to do some special data manipulation you can use advanced stuffs like SocketConnection, ServerSocketConnection or UDPDatagramConnection, and so do as you want to.
To better explanation and discuss you should visit the article J2ME Low-Level Network Programming with MIDP 2.0 at http://developers.sun.com/mobility/midp/articles/midp2network/.

What about Bluetooth ?!?!

The Bluetooth usage is increasing day-by-day, including by the mobile phones manufacturer that´s making it available in a large number of models. And, what´s already means a high-level mobile phone status, now is a important "accessory" and have been used in a different kind of applications, like: As a remote control, to replace wires, multi-player games and little (or provisional) WLANs.

But, if we think about the net aspect, we are (yet) inside the GCF. But, why make it complex if we can simplify ? ;-) On this way, the Marge Project comes to help (and a lot) the usage of this (important) technology. It´s a framework to make easy all Bluetooth programming process: since the device and service discovery until the data exchange properly.
It´s a open-source project that you can (and should if it´s possible for you) collaborate, incubated at Mobile and Embedded Community. To examples, downloads, discussion and collaborations visit: https://marge.dev.java.net/

JME surfing on SOA and Webservice wave!

The availablement of services at Internet using the Webservice paradigm and the increased usage of this to system´s integration with SOA, brings to JME the necessity to talk with this technologies.

But... What is SOA and Webservice ?

Well, to don´t loss the focus now, if you have any doubt about the real uses of these technologies, visit:

How to consume Webservices and SOA integration

As the name tells, Webservice is a service available at the Web. So, we could think in use directly a HTTP Connection to access the information, correct?
The problem in this case is all the parse that we will have to do, because SOAP uses XML to data encapsulation. And, if we maybe have to to this on all Webservice communication, why not create a Framework ?!? To this, I´d like to introduce you kSOAP and kXML. The first to integrate with SOA and the second to do the XML parse.
To downloads, documentation and examples, visit:

Finalizing

With this post, it´s the end of "Getting Started with JME" trilogy (with a little late) and now I´m feel that I can go ahead with many subjects that were introduced here and because some feedbacks that´s I´ve received by e-mail.

And, to the end of this week you can wait for a complete post about the usage of Webservices and SOA integration, including some examples and tips that will be present at my session at JustJava 2007 (October, São Paulo-Brazil) !!

Thanks all,
Cya... because, JAVA is everywhere!! ;-)

Neto Marin



Getting started with JME - Part I / III

Posted by netomarin on May 04, 2007 at 01:37 PM | Permalink | Comments (0)

Are you one of those that are very interesting on developing something to mobile devices? Or, Are your boss pushing you to show THAT report on his phone ? And so, you decided to visit some sites and mailing lists about, but you found just a "letter soup" like CLDC, CDC, MIDP and others ?????

Oh yeah, I´ve already done the same... and because this I´m going to show you the "stones path": What you have to do to know how this platform works (configurations, profiles, life-cycle, etc). And, for not be a large post, I´ll write divided in 3 parts. ;-)

Part I

The Platform

First, to understand this platform lets look to the above picture:

As you can see, the bars are separated by the kind of device you wanna run your application. Because, with this you will be able to know witch APIs will be available to develop you application. And of course, it´s a good idea read your device specification to know witch optional API will be available too.

My objective today is show you the path to find the best resource of documentation. In this case, the best option is to visit http://java.sun.com/javame/reference/apis.jsp .
There you can read a lot about CLDC, CDC, MIDP and others documentations and APIs, and so, you will know exactly what you´ll have available to develop your application.

Downloads

Yet on Sun´s site, you can find at http://java.sun.com/javame/downloads/index.jsp the oficial toolkit to different JME configuration and profiles.
At this point, probably, you´ve already choose the bar (on the JME Platform image) where you going to run your application and so you can make the choice: Sun Java Wireless ToolKit to CLDC or CDC! ;-)

And now ?!?!?! :/

Well, now you probably have the minimum necessary to start a JME application development for the device you´ve choose. On the next post I going to write about the application life-cycle and with what you must care when going to start you application development.
Also, I´ll write about the IDE that we are going to use to develop our example - a JME applcation that connects on Internet by HTTP ! ;-)

Any doubt? I forgot something? Wrote something wrong?
Let me know!! Send an e-mail to netomarin@gmail.com or do your comment here !! ;-)

Cya!!

[]s
Neto Marin



Introducing myself !

Posted by netomarin on May 01, 2007 at 06:54 PM | Permalink | Comments (3)

Hi all!

From now on, you´ll find here my little contribution about JME discussion. I´ll post news, articles, codes examples, how-to... well, I´ll try to help you at the JME techonology path! :-)

But, before start blogging, I´d like to introduce myself.
My name is Antonio Marin Neto, but to my friends, just Neto Marin ;-)
I´m a JME programmer since 2005 and I´m started on this world creating a multi-player game plattaform. And today I´m envolved in makes JME community in Brazil grows up and still working with personal mobile projects, like JME Brasil (http://www.jmebrasil.org)

If you´re looking for something about JME, let me know writing your sugesttion to netomarin@gmail.com and I´ll do the possible to write about what you wanna know ! ;-)

Now, is just wait my nex post! ;-)
Cya!!

[]s
Neto Marin





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds