Documentation for PhoneME Basis and Personal Profile

 
Post new topic   Reply to topic    Bug Labs Forum Index -> BUG SDK
View previous topic :: View next topic  
Author Message
koolatron



Joined: 25 Sep 2007
Posts: 52
Location: Cary, NC

PostPosted: Fri Oct 19, 2007 2:51 pm    Post subject: Documentation for PhoneME Basis and Personal Profile Reply with quote

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 Smile
Back to top
View user's profile Send private message Send e-mail AIM Address
finsprings



Joined: 25 Sep 2007
Posts: 267
Location: Pittsburgh, PA

PostPosted: Fri Oct 19, 2007 11:17 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
koolatron



Joined: 25 Sep 2007
Posts: 52
Location: Cary, NC

PostPosted: Fri Oct 19, 2007 11:48 pm    Post subject: Reply with quote

Well, they're all subsets of J2EE anyway, right? Wink
Back to top
View user's profile Send private message Send e-mail AIM Address
Shawn



Joined: 15 Oct 2007
Posts: 14
Location: Dallas Texas

PostPosted: Sat Oct 20, 2007 2:40 pm    Post subject: Coming from the other side of java... Reply with quote

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. Wink

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
Back to top
View user's profile Send private message Yahoo Messenger
timg



Joined: 19 Dec 2007
Posts: 6

PostPosted: Sun Jan 06, 2008 4:35 pm    Post subject: Re: Documentation for PhoneME Basis and Personal Profile Reply with quote

[quote="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.
[/quote]

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
Back to top
View user's profile Send private message
resistor



Joined: 05 Jan 2008
Posts: 2

PostPosted: Fri Jan 11, 2008 1:22 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
kengilmer



Joined: 25 Sep 2007
Posts: 183
Location: New York, NY

PostPosted: Sun Jan 13, 2008 4:47 am    Post subject: Re: Documentation for PhoneME Basis and Personal Profile Reply with quote

[quote="timg"]
koolatron wrote:

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.
_________________
thanks!
ken

Bug Labs
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
koolatron



Joined: 25 Sep 2007
Posts: 52
Location: Cary, NC

PostPosted: Mon Feb 04, 2008 1:46 pm    Post subject: Re: Documentation for PhoneME Basis and Personal Profile Reply with quote

timg wrote:

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 Sad
Back to top
View user's profile Send private message Send e-mail AIM Address
jconnolly
Site Admin


Joined: 11 Feb 2008
Posts: 128
Location: Bug Labs HQ New York

PostPosted: Tue Apr 15, 2008 11:04 am    Post subject: Re: Documentation for PhoneME Basis and Personal Profile Reply with quote

koolatron wrote:
timg wrote:

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 Sad



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 Mr. Green ). 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):


Code:

      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]
_________________
| John Connolly
| Bug Labs Development Team
|
| Join the bug-dev email list:
| http://lists.buglabs.net
| jconnolly on IRC:
| irc://irc.freenode.net/buglabs
------------------------------------------------------
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
bballantine



Joined: 28 Sep 2007
Posts: 30

PostPosted: Tue Oct 14, 2008 9:28 am    Post subject: More Image Related Stuff Reply with quote

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:

Code:

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 Sad.
_________________
__Brian__
Software Engineer
Bug Labs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Bug Labs Forum Index -> BUG SDK All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

FAQ   |   Search   |   Memberlist   |   Usergroups   |   Register   |   Profile

Email forums administrator

Bannersmonster.Com © 2007
Powered by phpBB © 2001, 2002 phpBB Group
Designed by:linux hostingHotel