*
The moose likes Java Micro Edition and the fly likes Android & J2ME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Android & J2ME" Watch "Android & J2ME" New topic
Author

Android & J2ME

Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

How does Android Programming compare to J2ME?

Given that both have Java as the core language & the purpose in both is Mobile Programming, I was wondering how different or same are they... And also how difficult would it be to transition between them.

"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

J2ME is geared towards monolithic apps, where a single program does everything, much as is the case with desktop apps. Android is more of a component architecture. While an Android app stands by itself, often components within the app may be invoked by other apps. For example, a phone book app may publish an interface to its database services, allowing other apps to access phone book entries without having to explicitly code detailed support into the phonebook app.

Technically, Android is not "Java", since we usually consider Java to signify not only the language, but the VM and the core classes. No one really cared about the difference, however, until Oracle's lawyers got involved. The Dalvik environment is somewhat richer than J2ME, since its least-common-denominator is more powerful hardware, but for the most part, there's nothing missing in J2ME that will kill you.

The biggest difficulty in moving between the 2 platforms is their fundamental difference in application architecture. As I said, a J2ME app is a program (or set of programs), whereas an Android app is a set of interconnected modules where each module belongs to 1 of 4 basic component types. Both have lifecyle support for an environment where the app may be pushed into the background or put to sleep altogether, although Android makes those stages perhaps a bit more visible.


Customer surveys are for companies who didn't pay proper attention to begin with.
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Thanks for your answer. I thought DVM was JVM optimized for mobile devices hence essentially the same. I've been doing some Android stuff, so familiar with the component based architecture, but wasn't sure how J2ME does things.
Jaydeep Wagh
Greenhorn

Joined: Feb 14, 2011
Posts: 12
is there a way to run .jar file of J2ME on an Android mobile...?

and if I know Java good enough, how difficult will it be for me to Develop an App for Android.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41082
    
  43
is there a way to run .jar file of J2ME on an Android mobile?
JME and Android are not compatible; specifically, the GUI portions are completely different. While some JSE libraries can be made to work on Android -as long as they don't use any AWT or Swing classes- getting a JME application to run on Android will require major effort.

and if I know Java good enough, how difficult will it be for me to Develop an App for Android.

It's not all that difficult, but be prepared that the GUI is entirely different from JSE and JME, and that the overall application structure is unlike what you may be used to from Java desktop apps.


Ping & DNS - my free Android networking tools app
Jaydeep Wagh
Greenhorn

Joined: Feb 14, 2011
Posts: 12
Thanks Ulf Dittmer, I am all set to writing my own Android Apps after the completion of my SCJP.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Android & J2ME
 
Similar Threads
Android vs. J2ME
From J2ME game programmer to Android
does j2me programming have any future?
Android anyone ?
Skill-set Suggestion