I'm considering taking mobile phone software development course at my university. The course uses J2ME with an emulator. I'm intereste开发者_StackOverflowd in software development for mobile phones, but I get the impression that J2ME is somewhat stale and limited in comparison to the newer platforms like the iPhone and Android. I'm most interested in Android, as I dislike the closed nature of the iPhone.
So if I take the course, how well would the skills acquired transfer to a platform like Android?
And I have a related question. I'm pretty comfortable with Java (and various other programming languages), but I haven't used J2ME. Is there anything that makes it particularly painful to program with? (Not that Java is that pleasant anyway)
Going from being comfortable with Java to comfortable with J2ME should be a pretty easy transition. The biggest hurdles are likely to be stuff like getting a phone simulator or build script set up, and learning how to load and run builds on the phone. But that's all exactly the kind of stuff I'm sure you'll cover in the first week in your class. There are also some differences as far as stuff that's included in desktop Java that are left out of the mobile APIs (like pretty much any Java 1.5+ feature, and certain UI packages and so forth) and a few J2ME specific APIs you'll have to use to do things like painting to the screen, or responding to key-presses, but they're all very java-like and are well-documented with Javadoc so they're not very hard to learn...basically it could be compared to a stripped down version of Java taking out the features that aren't so useful to mobile apps.
J2ME would be a good introduction to mobile development in my opinion, even if it is a little more "stale" as a platform, if they don't offer a class for the platform you're most interested in. It'll introduce you to a lot of the types of concerns that you will still have to worry about like the small form-factor/screen size, memory and performance concerns, making apps work across multiple phone models with different abilities, etc.
Going from J2ME to native (non J2ME) blackberry development was not a giant leap for me after doing almost a year of J2ME development--mostly it meant learning different build tools and how you load blackberry apps on the handset, using a different simulator, and a few different blackberry specific packages for the UI stuff--depending on how good of tutorials you can find, this could be a breeze or a bit of "how does XYZ translate onto this new platform".
Android is probably about a similar level of jump--you'll probably actually find that between J2ME, Blackberry, and Android there's quite a bit of code you can reuse since all three platforms let you write java-based code (at my work the blackberry and android versions of the projects actually share a bunch of non-ui related code by setting up dependent projects)...I think one of the biggest differences between all three platforms from a coding perspective is they have different libraries for doing the UI...I mean, they're all essentially going to have paint methods and whatnot, but each platform has different UI and other native packages you have to use which have some variation in what is and is not available easily (eg: much easier to draw gradients on blackberry than J2ME), filesystem access is a little different between platforms as far as what API you have to use, etc.
As far as painful things about J2ME...I'd say issues you can't debug through a device simulator (eg: phone-call interrupting your app, audio that doesn't play right, etc.), protected APIs (if you're using a provider like ATT requires this causes you to require signing on your build), and just trying to deal with screens having tiny resolutions and/or slow processors are the most difficult...nothing so painful I'd think you'd hate yourself for taking a class on mobile development, and some of those issues may be beyond the scope of your class anyhow.
All in all, I'd say learning any mobile platform will get you a lot closer to your desired goal of learning a certain specific platform that isn't offered as a course, and that there are plenty of things you'll learn in the course that will generalize :)
PS...If ultimately, you'd like to learn Android, and must start with a different handset language, I think learning J2ME or Blackberry are the closest-matching platforms since they are all java-based and have a bit of overlap on what tools you use (like you're likely to use Eclipse as your IDE for all three), compared to say Windows Mobile, BREW (C++ based), or iPhone (Objective C).
PPS...sorry for editing again to add this...but I took a look at our company's internal docs (targeted at new developers) on getting an android build environment set up to see how crazy it is (its not crazy at all), and its actually extremely similar to what I had to do to get the blackberry environment set up, except different plugins and SDKs to install. I think you'll find either of those two platforms only a small leap from what you'll likely learn in a J2ME development class.
Essentially, to write android code in Eclipse you have to add a plugin for Android: In Eclipse, under the help menu add new software, and add a download site with url https://dl-ssl.google.com/android/eclipse/ ), and after you get that set up, then set the default JRE in Eclipse to one of the JREs for android rather than the one from the JDK (caveat: you may have to install SDK tools as well to get the right JRE you want (google for "android sdk tools")). The plugin will add some Android-specific menu options you'll need like "Convert to android project"... you'll may know enough by even partway through your J2ME course to venture into trying to get an android development environment set up on your own :)
There was a good answer already, but I'd like to add my 2 cents and will try not to be too redundant. :) Btw, my experience is in mobile game programming, intermediary level.
So if I take the course, how well would the skills acquired transfer to a platform like Android?
If you already know Java syntax, learning J2me will be all about knowing how to code in embedded environments: how to code small, having really downed performance compared to desktops and have few APIs exposed to you (really few, j2me is a really tiny API and is, yes, already outdated). There are only a few common APIs to both of them, J2me and Android, so you'll have a steep learning curve when moving to Android. J2me can be a base but there's not too many meat to it.
With j2me you'll at least get the fundamentals of embedded programming: application life cycle, running thru emulated environments, build scripts, java preproccessors (bleh), code optimization by tools, code obfuscation by tools, sharpening your portability skills, deployment, new swearing ethimology (yes it's gonna goof up).
You prolly won't learn as much optimization / profiling / debugging ine j2me environment because it's not well suited for it (you'll learn more of scientific "hypothesis - trial - error" type of methodology then engineered way of "measuring - calculating - applying"). As opposed, Android env is developper friendly, everything being done from within Eclipse.
And buisness wise, J2me is slowly dieing and Android is on a quite good start, so the latter is more valuable. Also the trend is to go with native environments, not interpreted ones... and Android permits it, not J2me.
And I have a related question. I'm pretty comfortable with Java (and various other programming languages), but I haven't used J2ME. Is there anything that makes it particularly painful to program with?
J2me is simple. What is problematic is its portability. A few manufacturers have extentions, a few carriers have proprietary APIs, devices have different JSRs (APIs/libraries), devices have different Java virtual machines, so you will end up with different behaviors in reality, on devices. Add to that the debugging defficiencies, sometimes its quite painful to get your app to work properly on devices. That is the biggest problem. Otherwise J2me is a really stripped down version of J2se (version 3 and less if I recall properly?), so it's really similar to standard Java.
I think j2me is quite good to start for academics, but you should check out Android if you're interested in going beyond.
Ciao!
精彩评论