GLBasic User Manual

Main sections

Compiling for WebOS - Palm Devices

Device - Setup


GLBasic ships everything you need when developing for WebOS devices. The installation goes like:

1. step: prepare device


In card view (no cards open type "webos20090606" (without the quotes) in the search box.
There will be an icon "Developer Mode Enabler". Tap that, and turn developer mode on.

2. step: driver and connection


In the directory "C:\Prog...\GLBasic\compiler\platform\webos\tool\bin\novaterm\drivers" there are 2 drivers. Please install the the correct one (x86 for 32 bit, or x64 for 64 bit systems).

In the very same directory you fond a file "pdk-tcprelay-install.bat". You have to start this file with administrator rights (On Windows Vista/7 you right click the file and select "Run as an adiminstrator"). When typing "i" for [i]nstall, the service "Palm TCP Relay" is getting installed, that is required for getting a device shell, later. If you only want to upload to the device and test, this step might not be neccessary for you.

Now connect the device via USB. On the device select "Only Charge" - <B>don't pick "Use as USB drive"!</B>

In the directory "C:\Prog...\GLBasic\compiler\platform\webos\tool\bin\novaterm\" double click the file "pdk-device-install.bat", now. The program should copy the required files to your device now. If there is an error, please contact us in the GLBasic.com forums.

Programming


3. step: create a program


Once you built with GLBasic for WebOS, a directory "glbwebos" appears paralell to the .app directory. Here, manually check the "appinfo.json" file with Notepad. This content is important:
{
    "id": "com.glbasic.appname_lowercase",
    "version": "1.0.0",
    "vendor": "Your Company Name",
    "type": "pdk",
    "main": "glbasic-webos-exe",
    "title": "WebOS Icon Text",
    "icon": "icon.png"
}


The changes will not be overwritten next time you build.

The directory "Media" is created, but does not contain any elements, yet. Please copy the files from .app/Media into that folder.

4. step: upload and test


The folder "glbwebos" in the project directory must now be packed and uploaded to the device. That is done with the command:
"C:\Prog...\GLBasic\compiler\platform\webos\tool\bin\glb_pack_and_install.bat" "...\glbwebos"


For rapid development you can use an GLBasic Editor macro for that (menu: tools/macros/edit). that looks like:
:: Copy to Palm Pre

CALL "%GLB_MAIN_PATH%\compiler\platform\webos\tool\bin\glb_pack_and_install.bat" "%GLB_PROJ_PATH%\glbwebos"


After a few seconds the script should have created a file com-company-appname-version.ipk and installed it on the device already. BTW: This ipk file is the very same file you need for the App Catalog upload.

5. step: debugging


In the directory "C:\Prog..\GLBasic\Compiler\platform\webos\tool\bin" there's a file "DeviceShell.bat", that opens a command prompt on the device.
<B>Beware</B>, the shell you have has "root" rights. That means you have full controll and access to everything. When you delete system files, you might turn the device into an expensive paper weight.

You start a program like:
# cd /media/cryptofs/apps/usr/palm/applications/
# ls
com.your_company.appname
...
# cd com.your_company.appname
# ./glbasic-webos-exe
...


GLBasic development


The Palm Pre forwards all input actions to GLBasic as the iPhone does. Please continue your reading in that section.

Additionally the back gesture is submitted as KEY(1) = ESC. Here, you must set ALLOWESCAPE FALSE, otherwise the program would just end.

Vibration is only accessable in WebOS 2.0.x and thus not supported, yet.

The axes are returned with GETJOY... in the same way as on the iPhone! (Internally the Palm Pre has the Y axis mirrored).

The Palm Pre has a screen resolution of 320x480. The Palm Pixi (which is not tested so far) has a 320x400 resolution.

See also...