BUG Community

Welcome! Log In

Forums BUG SDK Documentation for PhoneME Basis and Personal Profile

Subscribe to Documentation for PhoneME Basis and Personal Profile  13 posts, 10 voices

Log in to reply to this topic
 
Oct 19, 2007 3:51pm
Img_missing_medium koolatron 52 posts

Hi all,

So, I'm not sure how many of you guys are delving deeply into the guts of the Java distribution that we're working with on the BUG.. but I spent a good chunk of time today trying to figure out why the BufferedImage class we have access to doesn't have a public constructor.

Well, it turns out that not only is PhoneME a subset of the regular 1.4.2 codebase, many things that are present are simply different or applied differently. The 1.4.x API docs is by and large a good reference, but they document a lot of features we simply do not have access to. This is understandably headache-inducing and wild-goose-chase-leading.

So, cutting to the chase:

The documentation for the code that we're working with can be found here:

http://java.sun.com/javame/reference/apis/jsr217/ (PhoneME Basis Profile)
http://java.sun.com/javame/reference/apis/jsr216/ (PhoneME Personal Profile)

Hopefully using that will save you the trouble that I went to :)
Oct 20, 2007 12:17am
Medium Bug Labs team finsprings 268 posts

Thanks mate. I presumed that it was a derivative of micro-edition (J2ME) rather than based on the full-blown JDK.

I was toying with getting the Gmail Mobile app onto the BUG. I got as far us finding the app jar and getting it going in the phone emulator that comes with the Java WTK, but the PhoneMe stuff doesn’t have any MIDlet classes in it. I tried pulling the appropriate jar out of the WTK but couldn’t figure out how I’d tell the Gmail app to start.

Oct 20, 2007 12:48am
Img_missing_medium koolatron 52 posts

Well, they’re all subsets of J2EE anyway, right? ;)

Oct 20, 2007 3:40pm
Img_missing_medium Shawn 14 posts

It sounds like some of y’all are more EE or SE based developers so I’ll provide my bit of knowledge in this area to see if it helps everyone.

OSGi – yup it’s kinda like EE

PhoneME – there are 2 main flavors Feature (MIDP) & Advanced (PP, PBP)

MIDP - Mobile Information Device Profile and uses CLDC as the base. (google phone apps use this) also known as MIDlet and onllly uses the java.io, java.lang, java.util classes that are compatible with jdk1.1.8 (ie: no collections other than vector / hashtable)

Personal Basis Profile & Personal Profile – This uses CDC, and has been used in such devices as the Sharp Zaurus 5000,5500,... This is more closely aligned with JavaSE core. Meaning AWT but no swing. Has collections, but no java 5 features… matter of fact I believe it is more like version 1.3-ish.

So parts off the system align well with EE - such as OSGi, but others align more with Java SE (think applets), and the whole thing has to live on a small device which aligns with the thinking of ME.

However things like googles gmail for phones will not work here as they use javax.microedition.lcdui components, which are not in the bugs libs. However you might look at ME4SE and see if that helps.

Desktop code may work depending on what target it was compiled for, hence 1.5 compiled code will most likely not work here.

Swing will not work here without loading those onto the device… wow that will be a huge jar. ;)

Well that’s all I know.

This is truly a mind bending device for developers…. I Love it!!

Thanks for the links to JSR217/216.

-Shawn

Jan 6, 2008 4:35pm
Img_missing_medium timg 6 posts

"koolatron"
I spent a good chunk of time today trying to figure out why the BufferedImage class we have access to doesn't have a public constructor.


So I looked at the API docs you listed and, sure enough, there is no public constructor for BufferedImage. So did you figure out how to create one?

I see that you can create a VolatileImage. Is that what we are stuck with?

Also, any idea on Java2D? I see Graphics2D in the javadocs, but Component returns a Graphics. Volatile image does return a Graphics2D, though.

Or, maybe an easier question: If I download the DragonflySDK and build and/or run against the emulator, does it use the PhoneME libraries (locally) or the fullblown JDK? (i.e. will I know what support I have if I'm developing on my local box?).

Thanks,
tim
Jan 11, 2008 1:22am
Img_missing_medium resistor 2 posts

Yeah, I’m pretty much stall on my concept for an application without better information on how the Image APIs are supposed to work. How am I supposed to interact with data from the camera otherwise?

Jan 13, 2008 4:47am
Medium Bug Labs team kgilmer 215 posts

[quote="timg"]
koolatron

Or, maybe an easier question: If I download the DragonflySDK and build and/or run against the emulator, does it use the PhoneME libraries (locally) or the fullblown JDK? (i.e. will I know what support I have if I'm developing on my local box?).


Timg,

The answer is yes (kind of). The SDK bundles the PhoneME class libraries. These libraries are referenced in Eclipse for Dragonfly projects. When you run a program in the SDK, it is executed with your desktop JVM against the phoneME Advanced class libraries. So, it's not exactly the same as what the native BUG will run (due to the different JVM) but you should see the class libraries accurately.
Feb 4, 2008 1:46pm
Img_missing_medium koolatron 52 posts

timg

So I looked at the API docs you listed and, sure enough, there is no public constructor for BufferedImage. So did you figure out how to create one?

I see that you can create a VolatileImage. Is that what we are stuck with?


Sorry for the lack of a timely response on this one, I guess phpbb wasn't interested in emailing me to tell me there were more replies to this topic.

The short answer to your question is that I didn't use a BufferedImage. I faked it with some creative use of an ImageObserver and local buffers that I could fill before displaying. I'm not sure *why* there's a BufferedImage class without a public constructor in PhoneME Personal Basis, but the fact that there isn't means that you are stuck using regular old Image and VolatileImage classes. This, obviously, sucks if you planned on using transforms or being efficient with memory :(
Apr 15, 2008 12:04pm
Medium Bug Labs team jconnolly 285 posts

koolatron
[quote:02808c1776="timg"]
So I looked at the API docs you listed and, sure enough, there is no public constructor for BufferedImage. So did you figure out how to create one?

I see that you can create a VolatileImage. Is that what we are stuck with?


Sorry for the lack of a timely response on this one, I guess phpbb wasn't interested in emailing me to tell me there were more replies to this topic.

The short answer to your question is that I didn't use a BufferedImage. I faked it with some creative use of an ImageObserver and local buffers that I could fill before displaying. I'm not sure *why* there's a BufferedImage class without a public constructor in PhoneME Personal Basis, but the fact that there isn't means that you are stuck using regular old Image and VolatileImage classes. This, obviously, sucks if you planned on using transforms or being efficient with memory :([/quote:02808c1776]


I have also run into similar problems working with PhoneME and Images. The ImageIO libraries won't work with PhoneME either (I tried, don't bother :mrgreen: ). One way of dealing with it is to use the awt Toolkit:

java.awt.Toolkit.getDefaultToolkit().getImage(URL)
or
java.awt.Toolkit.getDefaultToolkit().createImage(byte []).

In my ImageTest this is the code I use (from lines 137 and 138 in ImageTestApplication.java):



Image img = Toolkit.getDefaultToolkit().createImage(camera.getImage())
.getScaledInstance(320, 200, Image.SCALE_FAST);


See here for PhoneME awt's Toolkit class:

http://java.sun.com/javame/reference/apis/jsr217/java/awt/Toolkit.html [/url]
Oct 14, 2008 10:28am
Medium Bug Labs team bballantine 56 posts

Hey Guys,

I know this thread is long dead, but I wanted to add info on some of the work I've been doing. I've been messing around with images and awt for the last couple of days to create a simple Draw Pad ( http://buglabs.net/applications/Draw%20Pad ) program.

I'm pretty down on PhoneME after the whole experience, honestly. Anything relating to graphics and images is severely limited in PhoneME. Here are some notes -

* There are a couple of ways to create an AWT image. One is to get it from an AWT Component - Component::createImage(). This is good for creating an offscreen image that you draw on for speeding up animations. Another way is to create an image from a byte array, image_buffer:


Toolkit.getDefaultToolkit().createImage(image_buffer)
.getScaledInstance(310, 200, Image.SCALE_FAST);


These both return an awt.Image, but they are different in a number of ways that are still unclear to me. For example, when you try to call getGraphics() on the Toolkit image, you get an error.

* If you want to save out your image in a certain format, be prepared to do some work. Actually, I've found some code for creating BMP and GIF images from awt.Image. I have wrapped it up in a BUG app and you can find it here - http://buglabs.net/applications/Basic%20pMEA%20Image%20Utils

* The technique uses PixelGrabber to create an RGB pixel array, and then encode it. I don't have a very strong understanding of PixelGrabber, but I could see a lot of potential uses for manipulating image data on that level.

* One thing that I'm still missing and would be super useful, is a way to turn an awt Image to a jpeg. If anyone has code to do this, please share.

* I've looked into a number of other solutions, to no avail. The ME4SE project mentioned above isn't very useful for what I'm after. There is another project called JIMI, which is an image manipulation library that looks promising. We (Bug Labs) have some jpeg stuff as part of our JNI code, which I plan to look at. There may be a way to create something like ImageIO using that code.

In the end, I just wish we had a full VM :(.
Oct 3, 2012 2:40am
User_img_not_found_02_med wunai 103 posts

Thanks to the answers was possible to Tods shoes evaluate the intensity of use and the question of the distinction in purchasing. Women need a bag to carry their belongings, that’s for sure. Leather bags, women nowTods UK  have the flexibility and class beyond what I ever thought. The serious fashion lovers will love the leather bags thanks to its versatility, high quality and elegant style. With brands like Tod tods women shoes, Cole Haan,Tods Outlet   Rebecca Minkoff, among many others, is nothing but leather bags and upscale beyond amazing. Hogan shoes outlet The design is based on a conceptLouis Vuitton UK of minimal interference between your feet and the floor.

Oct 24, 2012 1:41am
User_img_not_found_01_med qazqazqaz 469 posts

As a perfect combination of classic and modern fashion,Coach Outlet Online Julia Bags can show the customers'unique personality.Tiffany UK grabbed the globe, stands out as the celeb on their favorite stars luxury type, granted an innovative simple move the pavement luxury, complete with luxury.In terms of the quality and superior design that make more and more customers are satisfied to Coach Factory Online.Welcome!hat experts claim Coach Outlet Online shopping is in the changes they are available in.As long as you open our Coach Factory Outlet webpage, you will view various Coach New Arrivals which are the most popular also the most fashionable in this year.On the date when the Louis Vuitton UK on sale, all people will pour into the stores. At this time, it on the booths will be wiped out, and only one or two days the seller will declare that there is no stock anymore.

Oct 24, 2012 4:08am
User_img_not_found_01_med qazqazqaz