Skip to main content

JSR 75(PIM) Support for PhoneME

18 replies [Last post]
priteshgajjar
Offline
Joined: 2009-04-07
Points: 0

I have installed MIDP-phoneme_feature_mr3-win32_arm_wm6-bin-rev17059.cab.
on Windows HTC touch diamond.

I tried to run my application which accesses contacts from address book. But it fail to retrieve contacts.

So does this VM has support of PIM?

Or any other issue is there?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
technolgia
Offline
Joined: 2009-03-09
Points: 0

Hi Davy,

I am trying to write a an image onto HTC touch but am not able to. It gives a class not found exception.Does the advanced binary support fhe file API?. How do i go about writting to the phone's file system. Kindly help me with this.

Thanks
Regards,
Norton

davyp
Offline
Joined: 2007-01-03
Points: 0

Norton,

Could you be more specific? What exception do you get?

Jsr75 is not implemented for the phoneME Advanced dual stack (the native part needs to be rewritten from KNI to JNI), but I can run the PDAPDemo jsr75 test application from WTK2.5.2 with phoneME Feature.

Davy

technolgia
Offline
Joined: 2009-03-09
Points: 0

Hi Davy,

I want to write a file onto HTC device.Using import javax.microedition.io.Connector is giving me an exception.How do i go about it.Kindly help me out with this.

Thanks,
Regards,
Norton

davyp
Offline
Joined: 2007-01-03
Points: 0

Norton,

Are you using phoneME Feature or phoneME Advanced (dual stack)?

What exception do you get?

Can you paste the code that is throwing the exception?

Google is your friend when you need some JSR 75 FileConnection examples:
http://bittyjava.wordpress.com/2006/11/19/more-about-jsr-75/
http://j2mesamples.blogspot.com/2009/02/file-connection-using-j2me-api-j...

Davy

technolgia
Offline
Joined: 2009-03-09
Points: 0

Hi Davy,

I am using PhoneME Advanced.
My code snippet is as below:

FileConnection fileConnection = null;
DataOutputStream dataOutputStream;
String connection = "file:///" + imagePath + fileName + ".png";
System.out.println("Conn Path:" + connection);
try {
fileConnection = (FileConnection) Connector.open(connection);
if (!fileConnection.exists()) {
fileConnection.create();
}
dataOutputStream = fileConnection.openDataOutputStream();
dataOutputStream.write(data, 0, data.length);
dataOutputStream.flush();
dataOutputStream.close();

} catch (Exception e) {
e.printStackTrace();
} finally {
if (fileConnection != null) {
try {
fileConnection.close();
} catch (IOException e) {
e.printStackTrace();
}
}

[b]I get the following exception on the phone:[/b]

java.lang.NoClassDefFoundError:javax.microedition.io.file.FileConnection

Is this because the FC api is not supported. How do i go about it. Kindly help me.

Thanks,
Regards
Norton.

davyp
Offline
Joined: 2007-01-03
Points: 0

Norton,

JSR75 is not supported in the phoneME Advanced stack.

You could try to run your midlet with the phoneME Feature stack. The only advantage of the
phoneME Advanced stack over phoneME Feature is that the first has support for JSR82 using the
BlueCove bluetooth stack.

(BlueCove does not work with phoneME Feature because its native backend is wrapped in JNI
interfaces, and I have not found a way to map these onto KNI interfaces that phoneME Feature
requires.)

Davy

technolgia
Offline
Joined: 2009-03-09
Points: 0

Hey Davy

Thank you. I got my application running on windows 5.1. I tried the same thing with HTC diamond am able to write small images onto the mobile bu when i try writting a bigger image on the mobile, the application does nothing.Do u have any idea with this.

Thanks,
Regards
Norton.

davyp
Offline
Joined: 2007-01-03
Points: 0

How big is the image memory wise (resolution, file size, file format)? Perhaps you are running out of memory?

Davy

technolgia
Offline
Joined: 2009-03-09
Points: 0

Hi Davy,

The image size is 144kb, png format and the resolution is 320x240. There's enough memory on the phone.

Thanks,
Regards,
Norton

technolgia
Offline
Joined: 2009-03-09
Points: 0

Hi Davy,

Thank you so much. I got it working. The problem was with the Base64 i was using to encode and decode. For some reason it does not work fine on HTC touch.
I have another question. System.getproperty("os.name") and System.getproperty("os.version") on PhoneMe Advanced returns the name of the operating system and the version.But when i try the same on PhoneME feature it returns null and when i try System.getproperty("microedition.platform") it returns j2me and i badly need the version of the windows OS it runs. Could u kindly help me out with this.

Thanks,
Regards
Norton.

davyp
Offline
Joined: 2007-01-03
Points: 0

Indeed, CLDC and MIDP do not seem to define these properties for any of the platforms
apparently. I'll see if I include those in my next builds. It is probably going to be something
like what CDC produces:

os.name = Windows CE
os.version = 5.2 build 1622
os.arch = arm

Out of curiosity, what kind of application are you developing? I am always interested in how
people are using my WinCE builds.

Davy

technolgia
Offline
Joined: 2009-03-09
Points: 0

Hi Davy,

Thank you.Is there any other way out for this to get the spec of the platform. Am developing a mobile framework which caters to various enterprises. And your build is really of great help with out which it would have been very difficult for me to port my application on windows platform. looking forward for the build...:-)

Thanks,
Regards,
Norton

priteshgajjar
Offline
Joined: 2009-04-07
Points: 0

HI Davy ,

Thanks a lot . Last reply has solved my problem of accessing contacts temporary.

So isn't there any way of accessing actual address book contacts?

Once again , Thanks a lot !!!

davyp
Offline
Joined: 2007-01-03
Points: 0

If there are APIs available, I guess it is possible to rewrite the JSR 75 PIM
backend to read and write from the Windows Mobile address book.

Davy

priteshgajjar
Offline
Joined: 2009-04-07
Points: 0

Hi Davy, How can i create group of contacts in pimdb folder? like group1,group2 which individually contains some contacts.

Thanks

priteshgajjar
Offline
Joined: 2009-04-07
Points: 0

The JSR-75 PIM implementation keeps its own list of contacts in the appdb\pimdb subfolder.
It does not use the Windows Mobile address book.

Hi Davy,
Thanks for your reply.

So do i need to keep contacts in this folder ? and where i can find this folder. Can you give some more detail about this?

Thanks

davyp
Offline
Joined: 2007-01-03
Points: 0

If you installed the CAB on the device, then I think you can find the folder at:
\Program Files\pMEF MIDP\appdb\pimdb

Each contact is in fact a separate .vcf file. If you run for example the PIM midlet at
http://bittyjava.wordpress.com/2006/11/10/a-simple-pim-example/

you should get a file appdb\pimdb\pim\contacts\Default_contact\1.vcf with the following content:

BEGIN:VCARD
VERSION:3.0
FN:Lynn Hanson
REV:2009-04-07
TEL;TYPE=HOME:555-HOME-NUMBER
TEL;TYPE=CELL:555-MOBILE-NUMBER
END:VCARD

Davy

davyp
Offline
Joined: 2007-01-03
Points: 0

The JSR-75 PIM implementation keeps its own list of contacts in the appdb\pimdb subfolder.
It does not use the Windows Mobile address book.

Davy