

Ask HN: What's the best way to learn Java/J2ME to build mobile applications? - dmix

In the near future I plan on developing mobile applications (primarily for Blackberry) that are an extension of my rails applications. I am currently using mobile optimized in-browser versions of the applications but that limits the capabilities and benefits of a native mobile application (GPS, offline capabilities, speed).<p>I'm looking for some recommendations on the the best books/sites/strategies to begin learning the basics of Java and building J2ME apps?<p>I'm coming from a web dev background (ruby,php,perl etc).
======
martythemaniak
First, what you really wanna do is learn the basics of Java itself - primitive
types, flow structures, conditionals, classes, inheritance, basic data types
(vectors, maps) etc. You'll find the syntax has much in common with php and
perl, so it won't be alien, although you'll have to adjust to the static
typing.

Second, you'll have to learn the specific mobile environment you want to
develop for - J2ME, Blackberry or Android. What they all have in common is
that they implement the basic java language (which I mentioned above) along
with a set of packages/classes that allow your app to run the device.

J2ME is very basic and is meant to run on a very wide range of cellphones
(mostly featurephones) and its also quite hard to get access to the nicer APIs
(contact info, internet access etc). It is specified by Sun working with phone
manufacturers.

Blackberry has its own set of APIs which allow you to access BB specific
functions (email, gps, phone etc) and UI elements. This one is defined and
implemented by RIM and does not have anything in common with J2ME.

Android, like the BB also has its own set of APIs that allow you to use its UI
elements, access its data, etc etc and is driven by Google.

Since you're interested in BB development, most of you apps should be
developed (and in many cases will have to be) using the BB API. The BB has the
ability to run J2ME apps, but I think that's mostly for compatibility reasons.

Anyway, good luck.

------
rmobin
I picked up Beginning J2ME ([http://www.amazon.com/Beginning-J2ME-Novice-
Professional-Thi...](http://www.amazon.com/Beginning-J2ME-Novice-Professional-
Third/dp/1590594797)) earlier this year when working on a mobile application
for BB and it was pretty handy. You should know that RIM provides additional
apis on top of J2ME that let you create more native-feeling BB applications
(and it's worth learning imo) - for this I used tutorials online and RIM's api
documentation.

The developer of BBSmart, Neil Sainsbury, used to have a really helpful blog
at <http://devberry.com>, but I believe he took it down after his frustrations
with RIM (it's like "shouting at a brick wall").

------
sama
The best way is not to, I assure you.

~~~
schtog
It is used everywhere so how can knowing it be a bad thing?

~~~
fhars
Knowing it might be OK, the horrible part is actually programming in that
environment. It is totally locked down, you have to buy certificates and sign
your applications and stuff. Without that, your application will be almost
unusable (unless you only use the games APIs, which can't do much except
storing high scores). Even saving a file to a directory turns into busywork
for the user, as the run time system will ask for every single directory on
the path if it is OK to access it... It is a bit more liberal with actions
that might cost you money like dialing, sending text messages or establishing
data connections (it will ask you only once), but it is still annoying.

It is a trusted (by the network operators, not by you) computing environment.

------
pistoriusp
I saw this the other day: <http://rhomobile.com/>

"Rhomobile's open source mobile application framework Rhodes lets you quickly
build mobile interfaces to enterprise applications. These are true native
device applications: they work against synced local data and take advantage of
device capabilities such as GPS and PIM access."

I didn't look into it much, but it might be worth your while to investigate.

~~~
setandbma
Looks interesting

------
Tichy
Learned it without any books, just looking at the documentation from Sun. Just
get started with a simple project, I guess.

