Slashdot Mirror


Programming Wireless Devices With Java 2

Jeff Carroll writes "Developers building Java applications for wireless handheld devices have been looking forward for some time now to the release of devices supporting version 2.0 of the Connected Limited Device Configuration (CLDC), and version 1.1 of the Mobile Information Device Profile (MIDP). These new releases contain support for features demanded by developers that didn't make the original releases. In support of CLDC 2.0 and MIDP 1.1, Roger Riggs and his team of authors from Sun, Nokia, and Motorola have released Programming Wireless Devices with the Java 2 Platform, Micro Edition, Second Edition (since I don't have a copy of the first edition, I can only evaluate the new edition on its own merits)." (Read on for his review.) Update: 07/23 16:31 GMT by T : Whoops -- that's CLDC 1.1 and MIDP 2.0, not the other way around. Programming Wireless Devices with the Java 2 Platform, Micro Edition, 2ed. author Roger Riggs, Antero Taivalsaari, Jim Van Peursem, Jyri Huopaniemi, Mark Patel, Aleksi Uotila pages 464 publisher Addison-Wesley Professional rating 7 reviewer Jeff Carroll ISBN 0321197984 summary In-depth introduction to and reference on CLDC 2.0 and MIDP 1.1.

As is characteristic of the titles I've seen from Sun's Java series, this book goes into great detail about architectural decisions, standards process, and philosophy underlying the new release. The first six chapters are given over to this discussion. This material is mostly great for experienced developers seeking a deeper understanding, occasionally so abstract as to be silly (as in the case of the Java washing machine and its downloadable stain-removing code), but likely to be of only secondary interest to new J2ME developers focused on coming up to speed.

What this book does best is comprehensive exposition of the J2ME APIs. There are chapters dedicated to the APIs for forms, graphics, games, sound, persistence, and networking, with code samples offered in most cases, and a Java Almanac-style reference to all J2ME-specific classes and interfaces is provided as an appendix. Features that are new to the J2ME second edition are clearly identified.

The remainder of the book constitutes a detailed discussion of the new technologies for event-driven launch, application security, and over-the-air deployment, perhaps the most potentially confusing of which is event-driven application launch. While the book explains the new technology well, it doesn't address how it will be introduced by network operators, or how it might interact with or replace similar existing proprietary technologies such as Sprint's MUGlets.

Another subject that is not dealt with here that will soon be relevant to developers for any particular J2ME-supporting network is that of optional packages (OPs) - features to be supported at the option of particular device vendors and/or network service providers. It is fairly clear that, going forward, the wireless network infrastructure and its supported features will be an integral part of the J2ME platform that will have to be taken into account by developers, and books which fail to discuss popular and commonly adopted OPs will be of limited usefulness (you'd think that Sun would know that after all that rhetoric about the network being the computer). In general, a book of this sort would benefit from the participation of network operators, as it does from that of device manufacturers Nokia and Motorola.

All the code samples and background on architecture notwithstanding, this book is clearly targeted at experienced Java programmers, not handheld device programmers working in other technologies. If you don't already know Java, this book will not teach you. There is also nothing said here about selection, configuration, or use of development tools; readers who are not already adept at the use of J2ME development tools, including the Wireless Tool Kit (WTK), should not expect to acquire that knowledge from this book. (People who need help in this area may want to consider Jonathan Knudsen's Wireless Java or Kim Topley's J2ME in a Nutshell.)

Keeping the aforementioned caveats in mind, this is an excellent introduction to and reference on the new release of J2ME.

You can purchase Programming Wireless Devices with the Java 2 Platform, Micro Edition, 2ed. from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

108 comments

  1. Games? by Nick+of+NSTime · · Score: 2, Interesting

    Could this be applied to wireless games on cell phones?

    1. Re:Games? by yatest5 · · Score: 0, Funny

      Short Answer: Yes.

      --
      • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
    2. Re:Games? by Nick+of+NSTime · · Score: 2, Informative

      I meant to say wireless networked games on cell phones.

    3. Re:Games? by Anonymous Coward · · Score: 0


      You'd probably want to use assembly for that

    4. Re:Games? by Troed · · Score: 1

      That's what MIDP is used for in phones .. I haven't seen many applications that are NOT games - and MIDP2 is a lot better for games than MIDP1 was/is.

    5. Re:Games? by ph43thon · · Score: 1

      yes it can.. anyone who says "no it can't" is a fool. J2ME is specifically for this stuff.. Lots of phones can use it. Especially newer Sprint phone (sanyo samsung) and I'd assume many of the others.

    6. Re:Games? by FyRE666 · · Score: 1

      Could this be applied to wireless games on cell phones?

      Why, that's just crazy talk!!

      Oh yeah: "Duh!"

  2. There are no such beasts by Gzip+Christ · · Score: 5, Informative
    Developers building Java applications for wireless handheld devices have been looking forward for some time now to the release of devices supporting version 2.0 of the Connected Limited Device Configuration (CLDC), and version 1.1 of the Mobile Information Device Profile (MIDP).
    You've got that backwards dude. It's MIDP2.0 and CLDC1.1. See here and here.
    1. Re:There are no such beasts by Troed · · Score: 1

      Yeah - I'm currently working in this very area and got extremely confused by the article writeup :)

  3. Re:I thought Java was doomed by yatest5 · · Score: 0, Informative
    I've been told Python does everything Java does and better.

    Well it doesn't run on Mobile Phones so it doesn't do that better....?

    --
    • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
  4. Re:I thought Java was doomed by Trelane,+the+Squire · · Score: 1

    I'll have to look into that. my main complaint with java is that it is so high level, and programmer-centric. There's so much stuff in there that only helps the programmer. I would gladly pay the price in time and study to make something more user friendly

  5. Too Complex by nathanz · · Score: 5, Insightful
    I hate to sound like a VB programmer here, but I think part of the problem with all these Java API's, VM's, etc. for mobile platforms is that they are too complex. When the MIDP and the kvm first came out for Palm, I just at it, but was quickly frustrated by the complexity of creating an application and the limited number of controls.

    I shouldn't need a book to create Java applications for a mobile device. I should need a two page cheat-sheet that maps "mobile" concepts to core Java/Swing concepts.

    BTW, I did finally get my Palm program working by using Waba (http://www.wabasoft.com), which I thought was far superior to what Sun was putting out.

    1. Re:Too Complex by FatherOfONe · · Score: 2, Interesting

      I agree with our main point. However don't blame Sun too much for the crap that was KVM. Remember they turned that over to "PALM" to head up. I never understood that at all. Why would Palm EVER want to support JAVA? They owned like 90+% of the PDA market. They want people to write to their platform, not a generic one, that would let people move off of Palm.

      I currently have an Ipaq, and it runs java via some JVM supplied by compaq. It looked cool and I thouht it would be great because this thing runs at 400mhz! Well, it doesn't support SWING... man that kinda sucks for what I would want to do with it.

      --
      The more I learn about science, the more my faith in God increases.
    2. Re:Too Complex by nate1138 · · Score: 2, Interesting

      If you want an easy to code PDA platform, try Ewe. It's got a full featured class library, a fast-ass VM, and it runs on anything (PocketPC, Linux, win32, mac). We've been using it to deploy wireless pocketPC apps, and it rocks.

      --
      Where's my lobbyist? Right here.
    3. Re:Too Complex by pmz · · Score: 0, Flamebait

      I shouldn't need a book to create Java applications for a mobile device.

      You know, working for a living is also hard. Why not just sit back and let those welfare checks, food stamps, and magical tax returns roll in. Did you know there are people who get back more money from the IRS than they put in? It's called Earned Income Credit. Check it out.

      I think the technology industry has led itself into a delusional state, where marketing is somehow reality. Too many people start pet projects thinking, "Gee, it would be neat if we had a flexible database system for tracking widgets...", and end up learning millions of dollars later that hiring new college graduates was a mistake and specifying buzzwords like "web enabled" just made the whole thing into a useless mess.

      One self-inflicted reason why finding a new job is so hard, is that so many of the available slots out there are working for shitty pork-barrel what-if me-too projects that serve only to make the developers cynical and depressed. Where are the people who know what they are doing??? I'm getting a feeling they are holding onto their jobs and not letting go--hence no open slots :(

  6. So far.. by Dexter77 · · Score: 5, Informative

    I've been involved with wireless programming and Java since late 90's. So far Java hasn't lived up to its promises. Sure, you can do nice games on mobile phones, but real programming is a joke.

    For an example six months ago I had to do a little program that sent data through Nokia 9210's irDa port. API seemed to support it, so I made a program that used the irDA. Unfortunately the program never could open the irDa port. After days of research I finally found out that Nokia had NEVER implemented the irDa port correctly to the library that Java used. They had a typo in the port name, but nobody seemed to care about 'a minor flaw' at Nokia. The bug had been there for years and there was no way you could use irDa with Java in Nokia 9210(i).

    After that I just switched to the C++ and everything worked perfectly.

    The problem with mobile phones and Java generally is that if hardware interface is not implemented correctly, you can do nothing about it. Can you imagine yourself coding hundreds of hours a Java program and finally realising that the API hasn't been yet implemented fully and the program can never run. Ok, maybe not never, but would you like to wait years before you get fully implemented API?

    1. Re:So far.. by Anonymous Coward · · Score: 5, Insightful

      In all honesty though that isn't JAVAs fault. The problem was that Nokia had made a mistake. Having had several nokia phones, I will admit they are a bit prone to mistakes as well, especially regarding IRDA. I had several Nokia phones, that while they had IRDA ports, the ports were not even turned on, or at least not in the US editions. Don't blame a mistake that was made by an OEM on the people who made the software.

    2. Re:So far.. by Anonymous Coward · · Score: 0

      1) It is not "JAVA", because Java is not an acronym or abbreviation. It is simply, "Java".

      2) There is an apostrophe in "Java's".

    3. Re:So far.. by Anonymous Coward · · Score: 0

      If you have been "involved with wireless programming and Java since [sic] late 90's" then you should be aware of several things that would have possibly solved your problem: JNI, Open Source API's, and possibly third party API's.

      With JNI, you could have written a small chunk of C/C++/etc code to interface with your Java code, and forgo rewriting the entire application.

      With Java, you can also fix defects in the API yourself and submitted said changes to Sun.

      Please, don't blame Java for your own lack of proper research, especially when the root problem seems to have been with Nokia.

  7. Re:I thought Java was doomed by Glock27 · · Score: 3, Insightful
    I've been told Python does everything Java does and better.

    Whats to believe?

    What's the fastest runtime for Python? Can it translate to C code?

    The fastest Java runtimes are approaching C++/Fortran speeds.

    My personal quest has been for a productive, portable language that's efficient enough for high-end gaming applications. C++ isn't too productive, but GC pauses and portability (consoles) are still issues for Java games. Gcj looks interesting - with it you can disable bounds checking and GC (not a problem if you use mostly static objects).

    One point of synergy between Python and Java is Jython - Python that compiles to Java byte code. Perhaps the JVM is the fastest Python runtime... ;-)

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  8. Samsung N400 by LordNimon · · Score: 1

    Could I use this book to learn how to write software for the Samsung N400?

    --
    And the men who hold high places must be the ones who start
    To mold a new reality... closer to the heart
    1. Re:Samsung N400 by Anonymous Coward · · Score: 0

      No, you are apparently too stupid.

    2. Re:Samsung N400 by Anonymous Coward · · Score: 0

      yes

  9. Fair Comparison by Anonymous Coward · · Score: 5, Funny

    This weekend, I took the time to review two competing programs for your computer: J2ME, and WinME.

    First off, WinME. WinME is what computer people call an "Operation System", which means it is a program that can perform operations on a computer. What I really liked about WinME over its predecessor, MacOS9, is that the menu is on the bottom of the screen, there are great screen savers like a Star Wars -ish one where stars fly across your screen, and it supports a mouse with more than one button. Other noteworthy features of WinME was that I can sign up for AOL right off of the homepage, just by double-clicking on the little AOL picture. Neat!

    Now, here is where the story gets good. J2ME is just like WinME in many ways - Microsoft designs them that way so you don't have to relearn your computer everytime you "install" a new "operation system" (see, this isn't so hard now, is it?). The only thing I didn't quite understand was that WinME comes on a CD-Ram, and J2ME comes on a cellular phone. Now, I am usually really savvy with computers, but I still just can't figure out how to get J2ME off of my cell phone and onto my PC. This is important to me, because I really want to "upgrade" my PC from MacOS9, which was an earlier version of WinME/J2ME that just isn't as good as those two.

    Nevertheless, I think that Microsoft is doing a tremendous job with their entire 'ME' series of operation systems, and I hope you agree!

  10. Java Isn't Trustworthy by Vagary · · Score: 2, Insightful

    If you use a language that won't let you get to the hardware yourself or an API that isn't open source, then you're at the mercy of the hardware vendors to make the nice little garden paths you need to go down. And a reoccuring theme is that they don't.

    For right or wrong, a lot of hardware vendors seem to assume that people using high-level languages aren't writing serious programs. As a result, they don't bother to fully implement their interfaces. This leads to a catch-22 because, of course, without the interfaces you can't write serious programs. Since I assume the hardware industry isn't about to get a clue, the only solution seems to be volunteer-implemented APIs -- either that, or using programming languages that are actually designed for hardware interfacing.

    1. Re:Java Isn't Trustworthy by BFKrew · · Score: 2, Interesting

      Totally disagree with you I'm afraid.

      To say that someone who is writing in Java is not writing a "serious program" is wrong. If I wrote a program for a mobile phone that interacted with an Exchange server, imported XML documents from your company intranet and performed some processing before presenting the result etc is not a trivial matter, but I do not need to necessarily to understand the low level details - which Java hides really well.

  11. Java woes by Mondoz · · Score: 2, Interesting
    It's great that there's more support for the actual wireless aspect, but there's not enough Java support for the other devices that interact with the wireless.

    For example, I'm working on a project that involves a barcode scanner attached to a PDA, communicating wirelessly to a database. Java might let me do all the wireless/database stuff, but so many addon devices don't support Java.
    Anyone know of a PCMCIA or CF barcode reader that does suport Java?

    (crickets chirp)

    --
    /sig
    1. Re:Java woes by juanfe · · Score: 1

      How about a cell phone that has J2ME and that also has a barcode scanner that it can talk to?

      http://www.symbol.com/products/barcode_scanners/ ba rcode_psm20i.html

      --
      ***Foucault is watching you..***
    2. Re:Java woes by Mondoz · · Score: 1

      There's lots of dedicated 'one piece' devices that Java can interact with, the problem is finding add-on devices that Java can talk to.

      --
      /sig
    3. Re:Java woes by Anonymous Coward · · Score: 0

      Symbol has several. We are using the PSM20i for some of our projects.

  12. Re:Washing Machines and Ad-hoc Networks by idlethought · · Score: 4, Informative

    Compared to the other demands on medium/high end mobile (camera, bluetooth, the GSM/CDMA network itself), Java doesn't have that much implication for battery performance- provided it has a decent software implementation or some form of HW acceleration.

    Some phones have better Java technology than others however.

  13. Re:I don't understand... by ming242 · · Score: 1

    Yeah, good idea. Except that you can only support 1% of the devices out there. Try writting a consumer application where you can't force the device on the end user.

  14. Interesting ? by MosesJones · · Score: 2, Informative


    I'm assuming you are based in the US, because right now there are loads of games on mobile phones in Europe and Asia, and some of them are already interactive across the network.

    And that was MIDP 1.0

    --
    An Eye for an Eye will make the whole world blind - Gandhi
  15. Re:I thought Java was doomed by tuffy · · Score: 3, Informative
    I've been told Python does everything Java does and better.

    Whats to believe?

    Python can do everything Java can do (Turing-completeness, and all that) but better is far too subjective a claim. Python is a higher level language than Java is and offers more powerful language constructs. But, Java's current implementation tends to run faster than Python's for much the same reason. Python offers scores of standard libraries to perform useful tasks, but those libaries tend toward one-off minialism. Java also offers scores of standard libararies, but Java's take a "implement everything and the kitchen sink" approach.

    Which is better depends on what you need.

    --

    Ita erat quando hic adveni.

  16. You are denying reality... by MosesJones · · Score: 4, Informative


    Bloody hell.. lets see there are nearly 100 mobile phones that support J2ME, there are over 100 million sold in the last 12 months world wide and Nokia in ONE QUARTER ALONE sold over 800,000 of the high end smart phones.

    Low end phones like the 6310i have been J2ME phones for around a year now. And now almost ALL phones released in Europe and Asia are J2ME enabled.

    Basically you know zip, zero, nada about Mobile Applications.

    This isn't new, this is way over 12 months old and represents already a multi-million dollar industry in selling J2ME applications to consumers.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
  17. Re:I thought Java was doomed by __past__ · · Score: 2, Interesting
    What's the fastest runtime for Python? Can it translate to C code?
    Nope, it goes directly to machine language. Plain old CPython with Psyco, that is.

    My personal quest has been for a productive, portable language that's efficient enough for high-end gaming applications.
    Try Lisp. No, seriously. Think GCs and (native-code) compilers with 40 years of optimization, together with a really high-level, productive language. See this example where it seems to have worked quite well.
  18. Using Cellphone cameras under J2ME by TheSync · · Score: 1

    I'm curious if this book (or any other) goes into using the cameras on cellphones under J2ME. I'd like to write a "real webcam program" for a Sanyo SCP-5300, i.e., one that takes a picture every few minutes and ftps it to a server. Is there any hope for this kind of thing to be written?

    1. Re:Using Cellphone cameras under J2ME by The+G · · Score: 1

      As far as I know the only phones that let you get at the camera are Nokia phones which won't let you do networking except through a tremendously buggy http implementation. So your likelihood of success is very, very low.

      But not impossible.

      If you only need to do this with one phone, try writing your code in C++ for a Symbian phone like the Nokia 3650, so you aren't constrained by the crippled Java on Nokia phones.
      --G

    2. Re:Using Cellphone cameras under J2ME by Anonymous Coward · · Score: 0

      Not to be rude, but, exactly what sort of things would you be taking pictures of with your camera 'every few minutes'? Judging by where most people keep their phones, it's most likely going to be a pocket, a briefcase, a purse, or perhaps other peoples hips from a holster. While it is a 'neat idea' I wonder about the practical implementation of it (it's more of a 'doing it to say I did it' thing). If you are honestly interested in having a 'mobile webcam' you should look into things such as Professor Steve Mann's wearcam, as well as other things relating to augmented reality or mediated reality. Also, on many phones, the use of the camera drains the battery significantly if used a lot (something you must consider) so you'd probably need the phone plugged in, and finally, you have to consider the cost of 'network airtime' from your provider (but since you say a Sanyo SCP-5300, I'm going to guess that you have PCS vision from sprint).

    3. Re:Using Cellphone cameras under J2ME by TheSync · · Score: 1
      Aha, you are right...

      Brief Introduction to the Mobile Media API v1.0 (with Camera instructions)

      Camera MIDlet: A Mobile Media API Example v1.0

      And at The J2ME Mobile Media API:

      MMAPI includes support for a camera, with a special locator capture://video used to create its Player. An application can use the VideoControl to display a viewfinder on the screen, then take a picture using VideoControl.getSnapshot(String imageType). The default image format is PNG. You can use the imageType parameter to select any other supported format, and query the system property video.snapshot.encodings to find out what formats are supported.
    4. Re:Using Cellphone cameras under J2ME by gl4ss · · Score: 1

      Mmapi(mobile media api) supports this, available at least on nokia 3650, and possibly included on midp2.0 i dunno, there is one blogging software in java for 3650 that sends pics too and one commercial surveillance product that runs on symbian.

      --
      world was created 5 seconds before this post as it is.
    5. Re:Using Cellphone cameras under J2ME by javajonathan · · Score: 1

      Coincidentally, I just published an article on this subject: http://wireless.java.sun.com/midp/articles/picture /

  19. Slashbot book review by rkz · · Score: 1, Troll

    This one is a great addition to the book shelf, you all know how to use basic java under J2ME but this book clarifies nicely why you are actually doing it the way you are. Also, it introduces nice advanced concepts which regular java programmers might not have come across before.

  20. Snipe Hunting? by Vagary · · Score: 1

    Let me guess, you're trying to catch the little man who keeps sneaking into your pocket and replacing your change with lint?

  21. "download new stain algorithms"? by sczimme · · Score: 1


    Wow. Apparently I have missed out on new washing machine developments in the last four years or so (since I last bought such an item).

    That, and I got a chuckle out of the phrase itself. YMMV, of course.

    "I for one welcome our agitating overlords..."

    --
    I want to drag this out as long as possible. Bring me my protractor.
  22. I beg to differ. by Dr.+Bent · · Score: 4, Informative

    There are only about 125 classes in the entire MIDP specification, and alot of these are things like Integer and IllegalStateException. When you get down to the meat of it, there's maybe a couple dozen classes that you really need to understand.

    I find MIDP to be very simple and easy to use. Maybe it helps to be a Java progammer and understand the Java way of doing things, but I've built a few J2ME applications and I've been amazed at how little time they took to create, and how well the finished product performed.

  23. Re:I thought Java was doomed by MyPantsAreOnFire! · · Score: 3, Informative

    Yes and no. Java's OO structure (IMHO) is much clearer and strictly defined. Java also runs on micro-devices (what this review is about) whereas Python does not. There are those people that will also argue that Java's performance benchmarks can also beat out Python. Python's a great language, and I've been impressed with it, but then again, C# is much the same. Java is the king of that hill, and it will take some serious work to knock it off.

    --
    --My other sig is a ferrari.
  24. too right, mate. by mekkab · · Score: 2, Interesting

    For right or wrong, a lot of hardware vendors seem to assume that people using high-level languages aren't writing serious programs. As a result, they don't bother to fully implement their interfaces.

    Nor do they bother to comply with standards. Despite providing PCI token ring cards for their new e-servers, don't expect a device driver that is standards compliant from IBM. Never mind that we run a real time human grade system (thus, the olde skool token rings!)

    I seem to remember another slashdot article (or was it a Journal Entry?) where a managing engineer asked a company to buy a license to see and modify a device driver, threatening to take their VERY BIG contract away. The companies response was a list of their 3 competitors. They would rather lose money than give up any "Secrets!" (secrets being defined as "turn on this poll bit of the PCI controller at this address", or something to that effect)

    IBM used to print up GREAT guides for their hardware- how to check the Power Status registers or the front panel key position on their RS/6000 machines (what registers, what offset, etc.)- Now, they won't even give you an assembler reference manual for their POWER4 chips ("just look at the powerPC stuff, its close enough...")

    --
    In the future, I would want to not be isolated from my friends in the Space Station.
  25. Memory footprint for java2 embedded chips ? by zymano · · Score: 1

    Isn't there a special version of java just for embedded ? How much memory usage?

  26. Why is this Java's fault? by Dr.+Bent · · Score: 2, Insightful

    After days of research I finally found out that Nokia had NEVER implemented the irDa port correctly to the library that Java used.

    So why exactly is this a problem with Java? Nokia didn't stick to the specification, and your program doesn't run because of it. If Nokia didn't stick to the spec for thier native libraries, you would have the exact same problem with your C++ app.

    Sounds to me like the real issue here is with Nokia not doing thier job.

    1. Re:Why is this Java's fault? by Anonymous Coward · · Score: 0

      No, because in your C++ app you have access to the hardware yourself. In Java, interfaces need to be implmented to allow you to access hardware.

    2. Re:Why is this Java's fault? by Anonymous Coward · · Score: 0

      What is Java without implemented APIs? It's just a syntax. If you buy a car that has motor made by GM and it won't run faster than 20km/hour. Do you blame GM or the company that made the car?

  27. WiFi blew up by ratfynk · · Score: 0, Offtopic

    I spilled my coffee all over my WiFi, My java didn't work too well, I am about as good with coffee as I am with Java!

    --
    OH THE SHAME I fell off the wagon and use sigs again!
  28. Re:New upcoming books from Sun by Code_Princess · · Score: 1

    Yea, the sun books are all fine and dandy, but in my opinion the best books and authors were all with wrox - barker, topley, knudsen, brown, dalton, jepp etc. At least the new editions will be out soon and rumor has it that apress is giving books away at shows and user group meetings. Anybody know about it?

  29. Implementation != Use by Vagary · · Score: 1

    But are people actually using J2ME applications? Like lots of cell phones are WAP-enabled, but I don't know anyone who has used a WAP site for more than the novelty. And I'd guess a lot of those JVMs are put on there for web browsing rather than full-blown client-side apps.

    If you bothered to actually read my original post, you'd realise that cell-phones aren't what I was talking about. Their screens are too puny for serious applications and their wireless capabilities are too limited to require the full power of J2ME. I'm talking about ad-hoc networks of palmtops and embedded appliances, not the highly sophisticated device your mother uses to alert me after she's turned her last trick.

    1. Re:Implementation != Use by juanfe · · Score: 1

      Vagary,


      There are plenty of full-blown, client-side, enterprise quality J2ME apps that run on cell phones, that can use public IP addresses on the Internet (yes, I've seen HTTP servers on a cell phone and cell phones with domain names), and that can do what staid enterprise developers would call Cool Things (barcode scanning, biometric IDs, on-phone GPS location tracking, voice recognition, phone-to-phone data streaming, FIPS-II crypto).


      Not only that, these apps sell and companies make money off of the software.


      Take a look at the various APIs that the actual handset manufacturers and network carriers make available--you may get a sense that J2ME two years ago and J2ME today are two different beasts.

      --
      ***Foucault is watching you..***
  30. Re:Snipe Hunting? (Offtopic) by Anonymous Coward · · Score: 0

    You're a canuck eh?
    Just wondering where you heard of snipe hunting..
    Where the hell did that originate, people everywhere know it but don't know the roots...

  31. APIs Are Serious by Vagary · · Score: 3, Interesting

    Um, did you or any of the asshat moderators bother to read my post or did you just interpolate from the highlighted word?

    My point is that without the APIs encapsulating the hardware interfaces you can't write serious programs in Java, not that you shouldn't. How is your mobile phone going to interact with that Exchange server if you can't even use the phone's network interface? If the J2ME API is not fully implemented, then you're trapped in a little mobile jail.

    I was arguing that industry has shown itself unable to properly implement APIs for high-level languages, so therefore volunteers need to implement them. As a result, someone needs to know the low-level language because Java can't be used to write its own APIs. Java can be used for serious programs, but only after someone else does some programming in a lower-level language.

    1. Re:APIs Are Serious by JohnA · · Score: 1
      I was arguing that industry has shown itself unable to properly implement APIs for high-level languages, so therefore volunteers need to implement them. As a result, someone needs to know the low-level language because Java can't be used to write its own APIs. Java can be used for serious programs, but only after someone else does some programming in a lower-level language.

      But this is true for any language. Before someone can write a C application, they need a C compiler. And if the compiler has never been written for a particular architecture, someone needs to write a cross-compiler on another platform, and this requires intricate knowledge of the platform's processor instruction set.

      So, I guess if you write in machine language, you're golden. :-)
    2. Re:APIs Are Serious by juanfe · · Score: 2, Interesting
      Vagary,

      You may be looking at the wrong devices. I recommend you take a look at Motorola's iDEN phones site--the J2ME implementation of various APIs in the phones are very complete and robust, including serial port interfaces, a half-dozen network protocols, crypto, interfaces to GPS hardware, etc. Yes, many of these are Motorola proprietary classes, but if you look at the MIDP 2.0 spec a lot of those proprietary features have become part of the general MIDP API.

      Full disclosure: I work for Nextel. I also run their Developer Program.

      --
      ***Foucault is watching you..***
  32. Ewe Free? by Anonymous Coward · · Score: 1

    What's the deal with licensing/deploying Ewe?

    Looks like everything is free. Am I reading that wrong?

  33. Chemainus by Vagary · · Score: 1

    I'm not sure if it's the first place I heard about it, but my most solid source is a large statue commemorating the snipe hunt in the small tourist town of Chemainus, BC.

  34. An accurate review by nut · · Score: 1

    I have just got this book and was in fact planning to review it here myself... This is a good and accurate account of what the book does in my opinion - bar the mix-up in version numbers that several have noted.
    It is very much a reference work, and reads like it was written by a committee. (Six authors listed in fact.)
    It's a suitable book for any Java programmer who wants to learn the J2ME platform.

    --
    Never trust a man in a blue trench coat, Never drive a car when you're dead
  35. Re:Snipe Hunting? (Offtopic) by Farley+Mullet · · Score: 1

    I'm a canuck, and the the first I heard about snipe hunting was on the T.V. show "Cheers", in an old episode.

    Sam: What's new Normie?
    Norm: Terrorists Sam, they've taken over my stomach. They're demanding beer.

    Jeez, i miss that show

  36. Try the wireless toolkit by Anonymous Coward · · Score: 0

    The WTK mentioned at the bottom of the article was designed to be a quick starting point for MIDP development and its reviews and awards prove that it is.

    Programming a device will never be as simple as a desktop application since there are greater constraints. But its pretty close.

  37. Re:I thought Java was doomed by GooberToo · · Score: 1

    The biggest reason for performance differences is that little has been done to date to optimize Python.

    With little insentive to do so (it's usually fast enough), there isn't a big push to make it lots faster. The general feeling is that Python could be heavily optimized and see a huge performance gain. Just the same, it's a big task and it is, generally fast enough already. So, it becomes a catch-22.

  38. Re:I thought Java was doomed by ansible · · Score: 1

    What's interesting about Psyco and similar efforts is that there exists a possibility of further optimzations than in regular compiled languages.

    Suppose you have a function called do_it(), which takes an integer argument. Its got a loop in there that does some calculation. If you wrote it in C, you'd code up your for loop, and do it's thing.

    However, a really smart optimization system would not only look at the code as you've written it, but also look how it is actually used in runtime.

    Supposed that most of the time you're calling do_it() with an argument of '3'. It may be possible to really optimize that code path, and use either the regular version, or the '3' version based on the function's argument.

    This is much better than trying to do it by hand. Becuase your next program may mostly call do_it() with '5' instead of '3'.

    This kind of dynamic optimization is only possible when you're using a high level language, which embodies the general algorithm. It is nice when you can leave grungy details like optimization up to the system instead, who can (potentially) do a much better job at it than you can. Read the papers on the site, in case I'm not explaining things well.

  39. Written by Finns by aminorex · · Score: 2, Insightful

    Just a heads-up for those who might miss the fine print:

    "Written by a team of authors that includes the original J2ME technology experts from Sun, Motorola, and Nokia..."
    Now, doesn't that just tell you everything you need to
    know. Wirtten by "technologists" and "architects", who
    don't know how to write code and don't give a crap.

    --
    -I like my women like I like my tea: green-
    1. Re:Written by Finns by cheekyboy · · Score: 1

      How do you know they werent coders before or are still?

      You're all ASS-U-mptions.

      --
      Liberty freedom are no1, not dicks in suits.
  40. Re:I thought Java was doomed by __past__ · · Score: 1
    However, a really smart optimization system would not only look at the code as you've written it, but also look how it is actually used in runtime.
    Isn't that basically what HotSpot JVMs do?
  41. Re:I thought Java was doomed by buckinm · · Score: 2, Insightful

    I'll have to look into that. my main complaint with java is that it is so high level, and programmer-centric. There's so much stuff in there that only helps the programmer. I would gladly pay the price in time and study to make something more user friendly

    Traditionally, that has been the programmer's job.

    --
    This isn't any ordinary darkness. It's advanced darkness.
  42. Self-Compiling Languages by Vagary · · Score: 1

    Yes, but to write a C API (or compiler), all you need to know is C. Yes, you need low-level knowledge of the hardware interfaces, but that's an assumed requirement for writing an API, isn't it? Whereas with Java, you can't write the API in Java because it doesn't have low-level hardware access. Therefore, Java only works on a platform if the hardware vendor or some other kind soul decides to allow it to work.

  43. Generalizations About Broads by Vagary · · Score: 1

    Obviously there are a few hardware platforms with good J2ME API implementations, but as long as they're not consistently good you're left with write-once-debug-everywhere. Am I supposed to tell my customer who complains that an application isn't working to "take a look at Motorola's iDEN phones"?

  44. Re:I thought Java was doomed by HeyLaughingBoy · · Score: 2, Insightful

    What kind of things do you expect to see in a programming language that are there for the user's benefit, where "user" is not defined as "the programmer"???

  45. Re:New upcoming books from Sun by javajonathan · · Score: 1

    Two things:

    1. I never wrote for Wrox.

    2. My book has been out in a second edition since February:

    http://www.apress.com/book/bookDisplay.html?bID=13 8

  46. The reality (Re:You are denying reality...) by Anonymous Coward · · Score: 0

    Actually, it's a multi-billion industry if you include all the java apps that manage ringtones and other business apps. For news and articles on j2me: http://www.blueboard.com/j2me/

  47. J2ME news and articles by Anonymous Coward · · Score: 1, Informative
    There are many sites focused on J2ME. This one is for news and developer articles (it also has links to other J2ME resources):

    Lurker's Guide to J2ME

  48. free shipping by Anonymous Coward · · Score: 0
  49. Re:I thought Java was doomed by ansible · · Score: 1

    Well, not sure what everyone's doing in this space. But its not what Sun is doing.

    I looked at Sun's whitepaper: The Java HotSpot Virtual Machine, v1.4.1. When they're talking about hotspots, they just mean running the JIT on the most-used sections of code. They're trying to get Java bytecode to match the speed of optimized C code.

    The Psyco stuff I mentioned is talking about dynamic optimimization of functions you've already selected. They are trying to surpass the speed of optimized C code.

    Even if you're not a fan of Python, I'd recommend reading the stuff on the Psyco site, just to get some interesting ideas.

  50. Re:New upcoming books from Sun by Code_Princess · · Score: 1

    Ok, sorry about that. Apress - yea, they're good and I actually have your book. I like that I can still use it for MIDP 1.0. Do you like working with Apress? It seems like most of their book are really advanced. Someone sent me a bunch of stuff for my user group for free. Do you have an opinion of the Enterprise Java Beans 2.1 book they have or the Using and Understanding JBO book?

  51. Re:I thought Java was doomed by bigredswitch · · Score: 2, Interesting

    "GC pauses and portability (consoles) are still issues for Java games"

    I write mobile Java games for a living I have to say that pauses caused by garbage collection are not an issue I've come up against in modern (12 month old) phones. And portability isn't too much of an issue either, sure screen sizes are different and manufacturers API differ but it's not *that* problematic.

    --
    After about three months of relentless Willy action I reckon I'm now as good as when I was 10.
  52. Re: Python can do everything Java can do... by mikec · · Score: 1

    ...except parse a program that isn't indented correctly :-)

    -mike

  53. It's usually called adaptive jitting by AndersDahlberg · · Score: 1

    And yes, Sun's jvm have been doing that since (pre?) 1.4. You know, it's a lot of money involved in all those high-end application servers that runs with 99.9999+ % uptime - the same money that sun get's a share of from j2ee licensing fees. A large part of that money is applied on making java faster on the server (take care of the hand that's feeding you approach). Which probably also is the reason that java -server usually does a better job at optimizing code than client (even though server takes more memory and longer start-up times.) Basic explanation of adapting jitting is that it's compiling code to native form and later realizing that some branches are never touched/new constraints are found/etc - tadá, recompile and see if it works better/correctly - if not. tadá..., you get the picture :)

  54. Re:New upcoming books from Sun by javajonathan · · Score: 1

    Sorry, no, I'm not familiar with those books. The irony is that even though I wrote technical books I read very few of them.

    I did enjoy working with Apress. They seem to be a very author-friendly publisher.

  55. Re:Snipe Hunting? (Offtopic) by Goozbach · · Score: 1

    Snipe Hunting is big in rural Utah.

    I think that is due to the lack of anything else to do.

    --

    I used to but then I quit.

  56. YES.... by MosesJones · · Score: 1


    Okay on my desk right now I have a P800 and a 6310i. On the P800 are a few Java games which do full 3D. On the 6310i is an application that uses Web Services to connect to a weather information service.

    But of course to you the 6310i couldn't possibly run J2ME and act as a weather service and cache route information and act as a timesheet which submits to a central server once a week. Because it can't be used in this way.

    Java Smartphones out sell PDAs 5 to 1 already, and this number will rise. J2ME MIDP2.0 isn't supported on many (its about a couple in Asia) phones as yet but it will represent another nail in the coffin of proprietary palmtops.

    J2ME has very little at the moment that requires complex wireless, Bluetooth is not part of the standard install for instance.

    Trust me, you know jack shit in the area.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
  57. Why this is a troll... by Anonymous Coward · · Score: 0

    This one is a great addition to the bookshelf, you all know how to {TROLL SLASHDOT} but this book clarifies nicely why you are actually doing it the way you are. Also, it introduces nice {GOATSE LINKS} which {TROLLERS} might not have come across before.

    Another example of rkz's work.

  58. Re:Broad generalizations by juanfe · · Score: 1

    In a nutshell, yes. You've already told your customers to "take a look at x" in multiple ways by the time you sell your software.

    By the time you sell a desktop app, you've consciously or implicitly come up with recommended hardware, configurations, service providers. You'll have implicitly made choices about:

    Desktop hardware: you'll have specified minimum requirements because you probably don't want to even try supporting your new and sharp 3D topographic elevation GIS app on a Mac LC.

    OS: Even if you've chosen Java (and certainly if you've chosen not-java), you've made a decision about the operating systems you'll support. You've made implicit and perhaps explicit statements about what configurations you know work. You've probably even tested on a dozen of them. (Probably the only vendor nowadays where you could try to get away with write once, test once would be Apple, and even that would be a bad idea.)

    Network: You've made protocol choices, network architecture choices, all sorts of things that constrain your customers already. Or do you want to support your app if it happened to not work over X.25?

    The wireless world offers, even then, some advantages:
    - device vendors tend to standardize across their product line on one particular flavor of implementation
    - carriers tend to standardize on one set of device vendors, and many vendors will fit on different carriers
    - individual carriers tend to enforce one specific approach to application design, testing and deployment to eliminate the potential for apps that don't work on their phones, because when apps fail on their phones (certainly consumer apps), consumers tend to call the carrier's support line and not the software vendor's support line.

    --
    ***Foucault is watching you..***
  59. Re:New upcoming books from Sun by martin.streicher · · Score: 1

    Code_Princess: This is Martin Streicher, and I am the Open Source Editor at Apress. If you'd like to try one of those books, drop me a line.