To start the emulator, double-click "Palm Emulator.app" in the Applications folder and select a resolution (320x480 for Pre, 320x400 for Pixi). This will start VirtualBox if it isn't already running. It is ready to use when the wallpaper is displayed. This can take about a minute.
The following keys are useful in the emulator.
end | opens and closes launcher |
esc | same as back gesture |
home | minimizes/maximizes current card |
left/right arrow | switches to application in left or right card |
There are many features no currently supported in the emulator including: Accelerometer, Audio, Bluetooth, Camera, Gesture area, Multi-touch, Rotation, Sound, Video and Wi-Fi.
To SSH to the emulator, enter
ssh -p5522 root@localhost
.
There is no password for the root account,
so press return when prompted for one.
The default path is
/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:
.
/usr/local/bin
and /usr/local/sbin
don't exist.
/usr/bin
contains awk, curl, sqlite3 and much more.
/bin
contains common UNIX commands including vi.
No scripting languages are installed.
Java is not installed.
From the Launcher, type "upupdowndownleftrightleftrightbastart" which is the "Konami code". This will cause an icon for the "Developer Mode Enabler". Switch "Developer Mode" from "OFF" to "ON" and press the "Reset The Device" button. No data will be lost.
To package an application into a .ipk file, follow these steps:
palm-package {app-dir-name}
.To install an application in the emulator or on a device that has been packaged in a .ipk file, not one from the App Catalog, follow these steps:
To launch an application in the emulator, follow these steps:
palm-package {app-dir-name}
.
To write to the log from JavaScript code,
use functions in the Mojo.Log package.
There are three logging functions,
info
, warn
and error
.
These take any number of arguments.
Their toString() values are concatentated to form the log message.
Another useful logging function is logProperties
which outputs all the properties of a given object.
It takes the object, a String name for the object and a boolean
that indicates whether inherited properties should also be output.
For exceptions there is the logException
function.
It takes an exception object and
a String message to be prepended to the log output.
The current logging level is set in the file framework-config.json. The values for the logging levels are 0 for error, 10 for warning and 20 for info. To see output from all logging statements, this file should contain:
{ "logLevel" : 99 }
To see log content, enter "palm-log {app-id} | tail
".
Get the value of app-id
from the id
in appinfo.json
.
Add the -f
option to follow additions to the log.
This will prevent palm-log
from exiting.
Press ctrl-c when finished viewing log output.
To see more verbose log messages, ssh to the emulator or device
and enter "log {app-id}
"
while in the /var/home/root directory
which is the default directory after running ssh.
Stylesheets included with the SDK are installed in
/opt/PalmSDK/current/share/refcode/framework/200.47/stylesheets.
There you'll find global.css
(imports many of the others),
global-base.css
and many more
for specific kinds of widgets.
To get a reference to a widget after the setup method for it has completed:
var widget = $('id').mojo;
.
To get the value of a widget after the setup method for it has completed:
var value = $('id').mojo.getValue();
.
See Localization at the developer.palm.com site.
The L$
function is used to obtain localized strings.
When a scence wishes to push another scene onto the stack
it calls pushScene
method of the SceneController.
This method takes the name of the scene to be pushed
and optionally takes additional arguments to be passed to
the scene assistant constructor function.
The constructor function can save these values in instance fields
so they can be accessed by instance methods.
Copyright © 2010 Object Computing, Inc. All rights reserved.