Showing posts with label Windows Mobile. Show all posts
Showing posts with label Windows Mobile. Show all posts

Wednesday, 29 December 2010

PythonCE for Windows CE

I'm playing with the PythonCE library for Windows CE devices, and I'm building a little graphic application (GUI) with it just to be sure that the chosen technology is the appropriate. I've always used the embedded VC++ and VB and I think it's time to move on and try new things. I've tested this library on my DELL Axim x50.

Firstly, you have to download the PythonCE library for your device. Download PythonCESetup.exe from sourceforge. Once downloaded, you have to execute the PythonCESetup.exe and it automatically will install the PythonCE on your WindowsCE device.

Once done, your pocket device will have installed the python command line:
Then, for executing graphical applications, we need to install the TKinter library. You'll succeed if you follow the next instructions to install the TKinter library on your pocket device:

Using TKinter for Windows CE:

To use Tkinter you have to download this additional software Tkinter.zip and unpack it on your PDA.
  1. The following archive contains 2 folders: "Windows" and "tcl8.4.3". Put all the files in "Windows" in the "Windows" folder of your PDA.
  2. Create a "lib" folder in the "Program files" folder of your PDA.
  3. Inside the "tcl8.4.3" folder in your archive you will find two folders: "library" and "tk8.4". Copy the "tk8.4" folder into the "lib" folder you just created on your PDA.
  4. Copy all the files in "library" into a folder named "tcl8.4" you will create inside the same "lib" folder.
If  you succeed, you can execute the next example and try it on our device:

from Tkinter import * 

def onCanvasClick(event):                  
    print 'Got canvas click', event.x, event.y, event.widget

root = Tk()
root.title('MyAPP')
canv = Canvas(root, width=100, height=100)
img = PhotoImage(file='\\My Documents\\logo.gif')
canv.create_image(240,250, image=img, anchor=CENTER)
obj1 = canv.create_text(50, 30, fill="red", text='text1')
obj2 = canv.create_text(50, 70, fill="red", text='text2')
widget = Label(root, text='This is a Label')
widget.config(bg='black', fg='yellow')             
widget.pack(expand=YES, fill=BOTH)
canv.bind('<Double-1>', onCanvasClick)                  
canv.pack()
root.mainloop()

Output Example:

Related links:

Tuesday, 31 March 2009

Ejecutar aplicaciones Java-SE en tu Pocket PC (Parte II)

Dado que podemos explotar mucho más la librería de Mysaifu, he decidido comentar un poco más el tema del Java 3D, ya que hay buenos ejemplos por la red, y muestro un poco como funciona.

Primero descargamos el paquete del Java 3D para nuestra Pocket des de Mysaifu j3dm:
j3dm 0.0.1

Una vez descargado, lo descomprimimos y obtendremos 2 carpetas, "lib" y "bin". Luego nos dirigimos a nuestro pocket PC y copiamos estas carpetas en la ruta:
\Archivos de programa\Mysaifu JVM\jre

Una vez hemos copiado las librerías, seleccionamos un .jar de alguna librería 3D y lo arrancamos para ver como funciona. Aquí os dejo un vídeo de muestra de lo que vemos en pantalla:



Aquí os dejo un ejemplo de la libreria, que lo he sacado de la página del Mysaifu:
java3dtest.rar

  • Enlaces de interés:
Java 3D
The definitive Multiplayer
Animation Interaction
Anifun3
J3DM

Monday, 30 March 2009

Ejecutar aplicaciones Java-SE en tu Pocket PC (Parte I)

Gracias a la aportación de un compañero (JM_@Inject), he descubierto como ejecutar mis aplicaciones java en mi Pocket PC con windows mobile 2003. Todo un hallazgo!.

Bien, la aplicación que permite ejecutar las aplicaciones java, es Mysaifu JVM. Es una máquina virtual de java que funciona bajo Windows Mobile, y que es Open Source!.
La instalación es bastante sencilla, solo tenemos que bajarnos el último release de la aplicación:
http://sourceforge.jp/projects/mysaifujvm/releases/

La descarga directa del último paquete la podemos encontrar aquí:
jvm.0.4.5-bin.zip

Una vez lo descargamos, encontraremos un fichero cabinet (jvm.Release.CAB), que lo tenemos que copiar en la carpeta \My Documents de la Pocket PC.

Una vez instalado, vamos a Inicio\Programas\Mysaifu JVM y lo ejecutamos:




  1. Creando el .jar desde eclipse:
Mysaifu JVM es capaz de ejecutar .jar's, por lo tanto lo que haré, es crear un .jar de mi aplicación para ejecutarla en mi Pocket PC (Una dell x50) con windows mobile 2003.
En Eclipse, selecciono el proyecto, botón derecho y "Export". Selecciono "Java\JAR file" y "Next".



Sobretodo, hay que marcar el punto de entrada para el main class, sino el fichero no funcionará. Podemos probar que realmente funciona el .jar, nos dirigimos a la carpeta donde hemos exportado el .jar y lo ejecutamos con un pequeño comando:



Ahora que hemos visto que el .jar funciona correctamente, lo cogemos y lo ponemos en la carpeta \My Documents de la PDA, y ejecutamos el Mysaifu JVM.

Una vez copiado todo, lo ejecutamos y podemos ver como funciona el .jar dentro de nuestra PDA!:



Enlaces de interés:
http://en.wikipedia.org/wiki/Mysaifu_JVM
Mysaifu Official Site