Fwing Photo Upload MIDlet for 6600 and 6680

One of my long standing pet peeves is that I can’t set tags when I send a photo from my phone. There were some postings a while ago about a MIDlet that posted to Flickr, but I couldn’t find it. And I haven’t written any MIDP code since early 2003. That’s a long time ago in Internet time. It translates on the Great Internet Timeline scale to somewhere around the Tiassic period. I really needed a quick refresher. So I fixed both problems by making a MIDlet that uploads images to Flickr using the POST based API. It’s ugly, it’s full of bugs, it doesn’t start up right the first time you try it, it can’t capture images unless there’s practicly nothing else running. But for me at least it works. So I’m going to invoke the “Release early, release often” mantra and just toss this one out there. If you want to give it a shot download here. Here are the basic steps for use:

  1. Start the app and bring up the settings form. You might have to start and exit and start again the very first time in order to get it to work correctly. There’s probably a problem there with the values for the defaults… I would test it out and find the bug. But that means uninstalling it to clear the record store, reinstalling to test out a fix, uninstalling again to retest. You see the problem there? The whole thing smacks of effort.
  2. Fill in your username (that’s your email) and your password. Fill in the defaults with new values if you want. Please keep the “fwing” tag as part of the tagset you use. You don’t have to, but consider this a kind request from the guy who released the project. I want to see how many people use this.
  3. Go back to the main form and fill in the title, description, and tags you want to use. Remember to please keep the fwing tag, see above.
  4. Select capture to go to a camera preview screen.
  5. Once you have a picture you like framed select capture again to snapshot it. Pressing in on the joystick should capture an image as well. But look at that, it doesn’t! It used to do that in the original sample from Nokia, but that one only captured images at 160×120. I’m sure it could be added back in. That is, it is theoretically possible to add it back in. The theory does not account for my laziness however. I’ve found that to be a general issue with theories.
  6. Select send if you want to send the image to the server, or back if you want to grab a different image. There should be a progress dialog there to let you know how far along it is. But the upload can take a long time, and I was sure people would get bored. So I included a little mini-game. It’s called “Guess How Long the Upload Takes”, and you play by staring at the screen until the info dialog comes up informing you of success or failure. You can even play multiplayer using a single handset!

You can keep looping and capturing and sending images with the same set of tags and description/title. That’s about all it’s good for, cause that’s what I normally do. You don’t like it? Think it should allow you to return to the top level and tweek description for each photo? Think there should be an option to pull images from the filesystem? Think it should spool images and upload in a batch? Think the bugs are too annoying to deal with? Good. This is the code for the initial version, download it and fix it yo’ damn sef. If you want to be really cool, send me patches or release your version and send me a note. License is GPL.

I’ve personally tried this out on the 6680 and the 6600, and it works on both. I’m assuming it should work with the 6620 and maybe a few other models. The image source is the back camera on the 6680. I have yet to find a way to capture from the front camera via Java. Images are captured at 640×480, try for any larger and the snapshot call consistently returns an exception. Not that I’m a Java programmer or anything, but there are some bits of code which may be of interest to some folks:

  • I had heard that the image resolution for captured images on the 6600 had to be the same as the display resolution when you’re working in Java. Not true. If you initDisplayMode() on the VideoControl with USE_DIRECT_VIDEO then just about any parameters you pass to getSnapshot() either cause an exception or get ignored. But if you init with USE_GUI_PRIMITIVE then you can getSnapshot() in the size you want. Well, not quite the size you want. I can’t get a full rez 1.3 megapixel image from the rear camera on the 6680, and I REALLY WANT ONE! The code I started with came from a sample on the Nokia site.
  • The 640×480 image is resized to 160×120 using a quick hack of an image downsampling routine I found online. Check out the scaleImage() routine in DisplayCanvas. It takes an immutable image and a width and height, and returns another image with the given size. J2ME doesn’t have an image resize available as far as I can tell, so that little routine might find it’s way into my standard toolkit.
  • The submission to Flickr is done as a multipart form POST. There’s a horrifically simple cover called MultipartHttpConnection that covers HttpConnection. Create the class giving it the URL to use, then you can addParam() and addFile() as necessary, and send() it when you’re done. I tend to do a metric buttload of server interaction on just about every project, and if it’s not XML it’s multipart forms. So that one is probably another keeper.

14 Responses to “Fwing Photo Upload MIDlet for 6600 and 6680”

  1. Roland Tanglao Says:

    My friend, Simon Lewis, wrote an open source (GPL) Flickr uploader called HuginAndMugin in Java.
    Check it out at:
    http://www.rolandtanglao.com/archives/mobility/phones/huginmugin/

    You run the settings Midlet and then run the HuginAndMugin Midletto take pictures to take and upload photos.

    There is no documentation yet. But feel free to email me Roland AT rolandtanglao.com if there are any questions. Or Skype IM me rtanglao

    I stopped using HuginAndMugin and switched to Lifeblog despite its flaws (can only upload 4 photos at a time for example) because HuginAndMugin despite Simon’s best efforts could only take 160×200 photos (due to a bug in Java or a limitationi of the implementation on my Nokia 7610?!?)

    Between your program and HuginAndMugin perhaps we can get a very cool Flickr uploader applet. Perhaps in Python (I am hoping that other languages don’t have the 160×200 limitation). Lifeblog works but it’s not really desiged for Flickr.

  2. Razvan Dragomirescu Says:

    If you need to use the front camera on the 6680, use capture://devcam1 instead of capture://video .

    Razvan

  3. shahryar Says:

    I tried your midlet It works till the message is shown image is successfully uploaded …… After that when I went to the flickr website it did not showed any thing … What seems to be the problem ………………………………… I am usinng Nokia 6600 plz I need an urgent reply …. Please from where I can retrive the pictures or is that it shows a false message that the picture is uploaded and actually the picture is not uploaded …

  4. mandy Says:

    Hi

    I have tried us application and it runs till sending image to plickr but where exactly can i find the uploaded images on flickr.com

    mandy

  5. Joey Says:

    I tried Fwing on a 6680. didn’t work. throws media exception symbian os -4. I’m trying something similiar to fwing. trying to capture the image at 640*480 but to no avail even thoughi use GUI_PRIMITIVE. All the variables I pass, “encoding width height” all gets ignored or thrown an exception, same as direct video. what could be the problem?

  6. miker Says:

    I don’t get that on my 6680.

  7. Joey Says:

    I deployed to my 6680 with (*#0000#)v3.04.12 25-04-05 RM-36. The similiar software I am developing is with Netbeans5.0(with profiler n miblity) using Java j2sdk1.4.2_10. As for Nokia developmend I’m using ns60_jme_sdk_fp3 & fp2, nptsdk_jme_v4.0 & nds_jme_v3.0.1. Even on the emulators it throws media exception not supported for all the emulators and SDK when I throw in “width” & “height”. What could be my problem? What was this developed on? even just using the existing .JAR on the 6680, capture gets ignored. HELP!!

  8. This is Mobility » Blog Archive » Web Components For Mobile Applications Says:

    [...] Download an app for free, like Lifeblog. Or even better start with some open source - say a simple photo upload midlet or a blog posting app for Palm devices (also free). Or if you’re that kind of person, pick from among the many network based examples for an open platform like Python for the Series60 (wow, that’s really free). [...]

  9. miker Says:

    I’m using a 6680 with V 2.04.15 04-03-05 RM-36, and I’ve used a 6600 but I don’t have the firmware version on hand. I just tried with the jar from this site on the 6680 and it works fine. I install the app, set the username and password, go to the capture screen. Once I choose to capture a dialog comes up asking if I want the app to be able to capture from the camera. I say yes and it grabs an image. Select send and a dialog comes up asking if I want to allow the app to access the network, again I say yes. Eventually a confirmation comes back saying it was sent. I don’t see the photo actually showing up in my flickr photostream, but all the bits of the app itself seem to work. Flickr must be returning some error that I’m not picking up.

    Where’s the source to your project?

  10. Mike Rowehl: This is Mobility » Blog Archive » Python S60 Flickr Upload Says:

    [...] The Flickr Authentication docs have said that authentication for mobile applications might be available in the future. Apparently the future has not yet distributed to Flickr. The authentication interfaces rely on punching out to a browser to give permission to the application. Pretty lame. Makes me wonder how ZoneTag manages to upload. I thought there was a simple post interface to Flickr at one point… I’m quite sure I developed against it at one point. I can’t find any docs about it now though, and the examples I have don’t seem to work any more. [...]

  11. QuickAnswerKindaGuy Says:

    So all this flickr.com talk is just a waste of time ?
    Flickr.com only supports upload from a browser ?

    Besides…in dutch “Flikker” means : homosexual.
    flickr.com and flikker.com are prenounced the same.
    I would not want to put my pictures on flickr.com hahaha !

  12. Hiten Says:

    I have captured photo on my Nokia 6600, and uploaded till message displayed ‘Send completed’ i don’t know where photo gone on the server? Can anyone please help me to get photo from server? Address???

  13. Hiten Says:

    I am using Fwing, captured an image and click on Send.. it displayed message till “Send Done” but from where i can find that image.. not able to see that image from Flickr !!

  14. Hiten Says:

    Please send me desired solution at hitencool@gmail.com

Leave a Reply