Skip to main content

Windows mobile development

5 replies [Last post]
jjgl
Offline
Joined: 2008-09-29

Hi,
I am working with a windows mobile device, and I would like to know if I can launch another application already installed (not a java application, an .exe file) from my J2ME application. I have read about the function "platformRequest", but I believe it only launches URL's and "tel:" commands, not internal paths ("\\Program Files...") and I think there is nothing similar to "Runtime.getRuntime().exec" in J2ME to solved my problem.
Another question, is it possible to read my WinCE registry from my J2ME application. Any idea?

Thank you very much in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jjgl
Offline
Joined: 2008-09-29

> One possible way to do this on a Sprint Winmo device
> with Titan support (Don't know if this exists yet)
> would be to setup an OSGi app that your JavaME MIDlet
> could talk with, and since OSGi is at a CDC I believe
> in TItan, then it could call out to run a native app.
>
> ou would need to write an OSGi app as well.
>
> So here is a goofy way I thought you might look into,
> and there a lot of unknowns that I'll list.
>
> Concept:
> -Write a little socket listener in native winmo that
> takes in a message which contains 2 strings then
> calls the code to launch an app on winmo. (see
> link)
> http://www.codeproject.com/KB/mobile/CreateProcess_Lau
> nch_EXE.aspx
> -In javaME write a socket connection to localhost on
> the port setup in app, and send message with name of
> app and parameters.
>
> Unknowns:
> -can winmo run 3 apps at the same time
> -can winmo run java and 2 apps at the same time
> -does winmo have a concept of local host, 127.0.0.1,
> etc..
> -can javaME post a message to the device it's running
> on and find the hostname or ip
>
> Regards,
> -Shawn

Hello Shawn,
As you suggested me, I have implemented a socket on my windows mobile device. I have a c++ application which is the socket server and a midlet that acts as the socket client. It works well and they communicate but when I implement it into my main application, I have problems.
This is the context: my midlet uses a socket to connect to a server because it is an IM application, but when I open the other socket to connect to my local server, it crashes. I have realized that the midlet calls its pauseApp function.
I don't know if I have implemented the socket in a wrong way or if the problem is that my device doesn't support two sockets at the same time. Any idea?

Thanks in advance

sfitzjava
Offline
Joined: 2003-06-15

If you are using the PhoneME Advanced then you are not using CLDC/MIDP, and you should be able to have access to Runtime.exec(); From PhoneME feature, the standard platformRequest only supports HTTP and TEL. But hey it's open source put in whatever you like. :)

No access to Registry.... again unless you want to add it into your build. :)

However there are the usual legaleeze issues with GPL and publishing your changes, and calling it java, and well you know the routine.

-Shawn

jjgl
Offline
Joined: 2008-09-29

Hi,

Thanks Shawn. Yes, I am using CLDC/MIDP in my application so I cannot try my beloved Runtime.exec() ;)
I will go on searching some code or way to do that, but I have not found anything yet. Do you suggest me some website?

Thank you in advance

sfitzjava
Offline
Joined: 2003-06-15

One possible way to do this on a Sprint Winmo device with Titan support (Don't know if this exists yet) would be to setup an OSGi app that your JavaME MIDlet could talk with, and since OSGi is at a CDC I believe in TItan, then it could call out to run a native app.
You would need to write an OSGi app as well.

So here is a goofy way I thought you might look into, and there a lot of unknowns that I'll list.

Concept:
-Write a little socket listener in native winmo that takes in a message which contains 2 strings then calls the code to launch an app on winmo. (see link)
http://www.codeproject.com/KB/mobile/CreateProcess_Launch_EXE.aspx
-In javaME write a socket connection to localhost on the port setup in app, and send message with name of app and parameters.

Unknowns:
-can winmo run 3 apps at the same time
-can winmo run java and 2 apps at the same time
-does winmo have a concept of local host, 127.0.0.1, etc..
-can javaME post a message to the device it's running on and find the hostname or ip

Regards,
-Shawn

dreamcatcher004
Offline
Joined: 2008-10-15

hi... Well guyz i m in serious trouble hope you guyz can help me. Well i had developed an application in J2ME Polish which works perfectly in different devices of Motorola, Nokia, SE, Samsung, Black Berry but when the turn of Window Mobile comes i got stuck, Some Screens work properly but some screens are nt displaying themselves. The jar file which i provides to Midlet Manager is a generic one, not for windows mobile but generic one which i developed for other mobile devices like nokia, SE, Samsung and Motorola. So now just tell me pleaseeee that how can i make a jar file in J2ME Polish for Windows Mobile. The device over which i m implemnting this jar file is I-Mate PDA2. I am providing the build.xml file for that jar file also hope that you guyz will help me in customizing that build.xml according to Windows Mobile Requirement

Regards....
Attique Yousaf

-------- Build.xml file----------
-->

name="enough-j2mepolish-StockPro"
default="j2mepolish">
name="blackberry.home" location="C:/Program Files/Research In Motion/BlackBerry JDE 4.2.1" />

classname="de.enough.polish.ant.PolishTask"
classpath="${polish.home}/lib/enough-j2mepolish-build.jar:${polish.home}/lib/jdom.jar"
/>

description="Call this target first to set the OTA download-URL, e.g. ant setdeploy j2mepolish"
>

description="Call this target first to skip the obfuscation step, call the emulator and start the debugger, e.g. ant enableDebug j2mepolish"
>

description="Call this target first to skip the obfuscation step and call the emulator, e.g. ant test j2mepolish"
>

depends="init"
description="This is the controller for the J2ME build process."
>

name="Stock Pro"
version="2.0"
description="Mobile Trading terminal."
vendorName="Softech Systems (pvt) Ltd"
infoUrl="http://www.softech.com.pk"
icon="icon.png"
jarName="StockPro.jar"
jarUrl="${deploy-url}${polish.jarName}"
copyright="Copyright 2008 Softech Systems (pvt) Ltd. All rights reserved."
deleteConfirm="Do you really want to kill me?"
/>






symbols="ExampleSymbol, AnotherExample"
fullscreen="menu"
usePolishGui="true"
workDir="${dir.work}"
>






dir="${resources.dir}"
defaultexcludes="yes"
excludes="readme.txt"
>



unless="test || polish.blackberry" >






wait="true"
securityDomain="trusted"
enableProfiler="true"
enableMemoryMonitor="true"
enableNetworkMonitor="true"
if="debug"
>

wait="true"
trace="class"
securityDomain="trusted"
enableProfiler="false"
enableMemoryMonitor="false"
enableNetworkMonitor="false"
if="test and not debug"
>



name="emulator"
depends="test,j2mepolish"
description="invokes the emulator"
>

description="allows a clean build. You should call [ant clean] whenever you made changes to devices.xml, vendors.xml or groups.xml">


name="cleanbuild"
description="allows a clean build. You should call [ant cleanbuild] whenever you made changes to devices.xml, vendors.xml or groups.xml"
depends="clean, j2mepolish"
/>