4 ms·
Ask HN: What's the best way to learn Java/J2ME to build mobile applications?
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).
I'm looking for some recommendations on the the best books/sites/strategies to begin learning the basics of Java and building J2ME apps?
I'm coming from a web dev background (ruby,php,perl etc).
- Tichy 18y agoLearned it without any books, just looking at the documentation from Sun. Just get started with a simple project, I guess.
- rmobin 18y agoI picked up Beginning J2ME (http://www.amazon.com/Beginning-J2ME-Novice-Professional-Third/dp/1590594797 http://www.amazon.com/Beginning-J2ME-Novice-Professional-Thi...) 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 http://devberry.com, but I believe he took it down after his frustrations with RIM (it's like "shouting at a brick wall").
- martythemaniak 18y agoFirst, 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.
- sama 18y agoThe best way is not to, I assure you.
- schtog 18y agoIt is used everywhere so how can knowing it be a bad thing?
- fhars 18y agoKnowing 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.
- tiffani 18y agoI'd have to agree. After spending a bit of time working on a J2ME app, friends and I figured out that you'd have a helluva time getting it to run on enough phones to actually make a difference. With operator restrictions, the need for security certs in order to run code on a real phone (important to gauge real behavior that emulators often can't do), and slightly differing implementations of J2ME on different devices, you'd have to do so much to get things to work to your liking. If you're still insistent, experiment a bit and think of something to write. I figured out J2ME wasn't for me after a year of dealing with operators, devices, etc. HTH
- pistoriusp 18y agoI saw this the other day: http://rhomobile.com/ 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 18y agoLooks interesting