Skip to main content

Installing phoneME on windows mobile 5

17 replies [Last post]
mearl
Offline
Joined: 2008-11-24
Points: 0

I am new to phoneME and am having trouble installing phoneME on windows mobile.

I am trying to use phoneME because it was recommended by the Lwuit team.

I have downloaded the .cab files from "http://www.cs.kuleuven.be/~davy/phoneme/downloads.htm".

I have installed the phoneME Feature - MIDP rev16539 and this seems to work fine.

There are 5 other .cab files for WM5 should I have installed these as well?

My software requires MIDP 2.0 and CDLC 1.1 so I was wondering if I should have installed the CDLC.cab file and if so how?

Is there a guide or tutorials for new users?

Mike

Message was edited by: mearl

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mearl
Offline
Joined: 2008-11-24
Points: 0

We have tested your example and noticed something odd.

It only works if we have opened a gprs connection first using another product. Where as the IBM and Jbed kvms will open a gprs connection if one is not open.

Any thoughts?

Mike

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

Perhaps it is due to the way the Connection Manager APIs are (not) used to make network connections, but I am afraid I cannot test as I don't have GPRS.

sampretorius
Offline
Joined: 2009-03-19
Points: 0

I've got a question with regards to platformrequest - specifically to request a number to be dialed.

The phone does not respond at all to a platformRequest("tel:" + tel); request. Any ideas? Without this, I'll have to look at another JVM for Windows Mobile.

Thanks!

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

You are correct.

The method platformRequest() is currently not supported. You basically need
an external program to handle these platform requests. I have not thoroughly
tested this, but I think Internet Explorer can be used for this purpose.

Davy

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

> There are 5 other .cab files for WM5 should I have
> installed these as well?

No, if you just want to run midlets, installing phoneME Feature should be
enough,

> My software requires MIDP 2.0 and CDLC 1.1 so I was
> wondering if I should have installed the CDLC.cab
> file and if so how?

No, I think most people will never need the CLDC binaries, but I made them
available just in case.

> Is there a guide or tutorials for new users?

I know there is never enough documentation, but I am afraid for the time
being you will have to do what is currently on the website.

> Mike
>
> Message was edited by: mearl

Davy

mearl
Offline
Joined: 2008-11-24
Points: 0

Is there a maximum file size for the phoneME build you have done?

My app is 1.2MB and phoneME says there is not enough memory but the phone has plenty.

Mike

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

There is no limit on the file size (at least I have ran midlets with a bigger JAR file size), but there is a limit on the amount of memory you can allocate in your application at runtime. Do you get an exception of any kind? Could you be a bit more specific when you get the error and whether you are referring to storage memory or working memory for running applications.

Davy

mearl
Offline
Joined: 2008-11-24
Points: 0

The error I get is "There is not enough room to install my documents/uitest.jad (1090k is needed for installation.). Try removing other items to free up space."

However when I look in windows memory screen I have 64MB free in program and 73MB free in storage.

What space should I be freeing up?

Do I need to define how much memory it can use in the .lnk file?

If so what should parameters should I put in my .lnk file

Regards

Mike

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

I am not quite sure, but could have been a storage limit that was set quite low. I changed a few
numbers and recompiled a new build. Could you download and try again?

You can also try to run the midlet without installing it. Create a startup.lnk file on your device
with everything on one line and adjust the paths where necessary:
254#"\midp\bin\arm\runMidlet.exe" -classpathext "\midlets\midlet.jar" -1 my.Main

The my.Main is the midlet's class name.

Davy

mearl
Offline
Joined: 2008-11-24
Points: 0

Can't install my app, still says there isn't enough space but it will now run using the lnk file.

I now have a problem with connector.open. My app is currently unsigned. In other KVMs it asks do you want to allow this untrusted app to connect. Does phoneME do the same or does it only allow trusted apps to connect to the internet?

Thank you for your help.

Regards

Mike

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

You should be able to run unsigned midlets just fine. There is however a slight difference
with running the midlet using the above approach. phoneME will no longer ask for
permission to go online like it would if you install a midlet.

Could you show the code snippet that is causing the problem?

Davy

ianmellor
Offline
Joined: 2009-01-21
Points: 0

This is our socket opening code, and from the network activity [or lack of!] at the server we are connecting to this never makes the connection:

public void open(int port,String hostS ) throws CommsException{
String pathS = hostS + ":" + port;

try{
sc = (SocketConnection) Connector.open("socket://" + pathS );

sc.setSocketOption(SocketConnection.KEEPALIVE, 1);

is = sc.openInputStream();
os = sc.openOutputStream();
} catch ( IOException e) {
throw new CommsException("IO:"+ e.getMessage() );
}
} // end proc

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

Strange, I made a quick example that connects to "socket://www.cs.kuleuven.be:80",
writes "GET /index.html HTTP/1.0\n\n" on the socket and reads the HTML refresh page.
So in my case, it seems to work. Here is the code if you want to try it out yourself.

http://www.cs.kuleuven.be/~davy/midlets/SocketExample.java

Davy

ianmellor
Offline
Joined: 2009-01-21
Points: 0

Davy,

Thanks for your quick answer last month. Sorry for the delay responding.....we've been a bit distracted by IBM's KVM for the last month and only now got our heads enough above water to look at where we want to be, rather than where we ended up!

I've not run your socket example - and the link is now 404. Would it be possible to re-instate the example code?

Also, we've tweaked our exception messages and we can now see that the error we are getting is "Could not resolve hostname". However, we are connecting by ip address. Does phoneme only do connecting by name?

We changed to our [not actually a proper] name of nnn-nn-nnn-n.zone3.bethere.co.uk which resolves to the ip address we had been using and we are now getting "Invalid ipv4 format".

I promise to look at anything you reply back with straightaway this time ;-)

Thanks

Ian

ianmellor
Offline
Joined: 2009-01-21
Points: 0

OK, In reply to myself....

The code at the end of this post connects to google and sends a "GET". Using either the name or the ip address in IBM's KVM produces the same result - a chunk of text reporting "302 Moved". However, with phoneME only the open by name works. Opening by IP address fails.

One work around for is obviously for us to go off and buy a domain name to go with the ip address we want to talk to. Are there any less "hack like" alternatives that we could try in code?

Or more likely, what are we doing wrong....!

Thanks

Ian

String reply = "";
SocketConnection client;
try {
//client = (SocketConnection) Connector.open("socket://209.85.229.147:80");
client = (SocketConnection) Connector.open("socket://www.google.co.uk:80");

client.setSocketOption(SocketConnection.DELAY, 0);
client.setSocketOption(SocketConnection.KEEPALIVE, 0);
InputStream is = client.openInputStream();
OutputStream os = client.openOutputStream();
os.write("GET / HTTP/1.1".getBytes());
os.write("\n\n".getBytes());
int c = 0;
while ((c = is.read()) != -1) {
reply = reply + (char) c;
// do something with the response
}
is.close();
os.close();
client.close();
} catch (IOException ex) {
ex.printStackTrace();
}

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

I put back online the example code at:
http://www.cs.kuleuven.be/~davy/midlets/SocketExample.java

I noticed some issues too when using an IP address. Probably the resolving of
a hostname does not handle IP addresses well.

As a temporary workaround, you could define a phony static hostname in the
hosts file and assign it the IP address you want to access. You can use the
free tool "Pocket Hosts" for that purpose.

Davy

ianmellor
Offline
Joined: 2009-01-21
Points: 0

The PocketHosts hack allows us to connect and runs fine.

Thanks

Ian