KuneriLite Emulator

From KuneriLite wiki

Contents

Introduction

KuneriLite Emulator is basic testing tool for development of KuneriLite integrated Flash applications.

KuneriLite Emulator is very simple to use. It is just started with executable and (optionally) can be controlled with one text file.

It runs on top of S60 SDK emulator, acting as localhost HTTP server, calls emulated plug-ins upon loadVariables request from SWF and optionally can write back user-specified variables from file.

In short; with KuneriLite Emulator you can:

  • Test your SWF with KuneriLite, without phone device
  • Control the behavior and syntax of loadVariables using any browser
  • Simulate different, asynchronous command sequences and error cases which are difficult to cause otherwise

Using KuneriLite Emulator is easy way to study, test and explore the interface between SWF and KuneriLite.

KuneriLite Emulator is compatible with MS Windows XP, 2000 and Vista.

KuneriLite Emulator can be found from: KuneriLite main screen "Launch KuneriLite Emulator", then press middle button at bottom.
3rd button launches Simulator-version, which just replies user arguments written in "KLEmuResponse.txt".

Interface

You can access KuneriLite Emulator from KuneriLite main menu.

Simulation mode

Emulator can be used in two different ways:

Real emulation, which launches the server and executes actual emulated plug-ins. Remember, that due emulator environment, some KL functionality is unavailable: e.g. you can use KL File, GPS and Uplink/Download rather normally. KL Timer will not execute SWF files, but other file types mostly work. KL Camera and Connect plug-ins are unusable in most part.

Simulation, launches the server and simulates plug-in calls, without actually calling them. Emulator writes the user-specified variables from the KLEmuResponse.txt, as response to each loadVariables call.

To add variables, which to test as response, modify [EPOCROOT]\Epoc32\winscw\c\KLEmuResponse.txt (Usually EPOCROOT is \Symbian\9.1\S60_3rd_MR, modify start.cmd in emulator folder, if not)

For example: klError=0&klStatus=started&klEnd=1&

is response to command
loadVariables( "http://127.0.0.1:<port>/<key>/connect?klCommand=status", "", "POST");

Starting

First check start.cmd, that the paths match your environment, according to [KuneriLite Wizard Beginners Guide].

In Emulator page, press second button to start in Emulator mode and third button to Simulation mode.

Enter localhost port number(<port>) and your KuneriLite unique key (<key>).

For KuneriLite Basic applications, port is 1001 and key is Basic.

Values must be same than loadVariables call in SWF. Check <Port> and <key> in loadVariables syntax. At last, enter the path of the application. Values can be given also as (Emu.exe,EmuSimu.exe) arguments /port=, /id= and /path=.

Example: Enter localhost port for emulator:1001
Port 1001 selected
Enter KuneriLite key:KISS60
Id:Basic
Enter application path: \data\KISS60\

S60 SDK Emulator will be launched.

From PC firewall, give permission to access Internet for Emulator, so it can control localhost network traffic. Firewalls is usual reason to stop emulator to launch. Be patient, it will take 10-20 seconds until Emulator is completely launched.

After launch, Emulator running in SDK emulator acting as localhost server in given socket port.

Open SWF when its advised so, in text file opened in Emulator screen.


Note: When you issue request to KL Emu first time, access point question might pop-up in the Emulator window, select “winsock” from the list.

Also calling Upload/Download plug-in first time will cause AP question.

Using with SWF

Most practical use for KuneriLite Emu is to communicate from Flash (Lite) SWF file. Just execute SWF file in Windows and it can communicate with KL Emulator server using loadVariables.

Note: Copy manually identical file structure of your application below;

EPOCROOT\Epoc32\winscw\c\[APPLICATION PATH]

Copy all files and subfolders, so application can be properly emulated, otherwise -12 and -1 errors will occur.

Response files for testing, klRequest.txt and klResponse.txt are located there as well. In EPOCROOT\Epoc32\winscw\c\data there are klfwEMU.txt and klfw_errEMU.txt, which contain detailed status information of emulator.


Using with Browser

You can communicate with Emulator also from Internet browser (modify <port> and <key> according to your SWF and KL package):

http://127.0.0.1:<port>/<key>/file?klCommand=create&klPath=test.txt will create test.txt in application installation directory.

Note: Do not use '\\' in the URL, when using KuneriLite Emulator from browser.
It is illegal URL and -28 error is returned.

Personal tools