• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android & J2ME

 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jaydeep Wagh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer, I am all set to writing my own Android Apps after the completion of my SCJP.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic