SWILIB API (SG)    
Loading...
Searching...
No Matches
Java

Detailed Description

Functions for the JVM.

Usage: #include <swilib.h> or #include <swilib/java.h>

Data Structures

struct  JAVA_HEAP_SLOTS
 Java heap slots, allocated at the VM start and never freed by the firmware (see RamJavaHeapSlots). More...
 

Typedefs

typedef struct JAVA_HEAP_SLOTS JAVA_HEAP_SLOTS
 

Functions

char * GetLastJavaApplication (void)
 Get the name of the running Java application.
 
int IsNoJava ()
 Check if Java is NOT running.
 
int8_t * RamIsRunJava ()
 Check if Java IS running.
 
int runMidletLinkablely (const char *midlet, WSHDR *filename)
 Open file with java midlet.
 
void StartMidlet (char *midlet)
 Start java midlet.
 
int * RamJavaVMStarted (void)
 "VM started" flag: 1 while the Java VM exists, cleared when the VM ends.
 
int * RamJavaExitPopup (void)
 Java exit popup flag: 1 while the "exit Java" popup is shown.
 
JAVA_HEAP_SLOTS * RamJavaHeapSlots (void)
 Java heap slots (see JAVA_HEAP_SLOTS).
 
void ** RamJavaVMHeaps (void)
 Heap pointers reused by the next VM start; a non-NULL entry equals heap[i] of its JAVA_HEAP_SLOTS slot.
 
int JAM_StartApplicationClass (WSHDR *class_name, int unk1, int unk2, int unk3, int unk4)
 Start a Java application by class name, as the firmware's FlexMenu_start does at boot for L"com.siemens.mp.app.flexmenu.MenuContainer" ("JAM_StartApplicationClass(%Pw)", csrc/core/jam_start_handler.c).
 

Data Structure Documentation

◆ JAVA_HEAP_SLOTS

struct JAVA_HEAP_SLOTS

Typedef Documentation

◆ JAVA_HEAP_SLOTS

typedef struct JAVA_HEAP_SLOTS JAVA_HEAP_SLOTS

Definition at line 19 of file java.h.

Function Documentation

◆ GetLastJavaApplication()

char * GetLastJavaApplication ( void )

Get the name of the running Java application.

Returns
Pointer to the current Java application name, or NULL if no application is available.

◆ IsNoJava()

int IsNoJava ( )

Check if Java is NOT running.

Returns
1 or 0

◆ RamIsRunJava()

int8_t * RamIsRunJava ( )

Check if Java IS running.

On EL71/E71 sw45 this is the midlet manager's count of open Java screens (an int, "decremented gui count to %d" in native/midmgr/midlet_manager.c): 0 = no Java app on screen.

Returns
2 - is no java running

◆ runMidletLinkablely()

int runMidletLinkablely ( const char * midlet,
WSHDR * filename )

Open file with java midlet.

Launches a java midlet passing it a file name.

Parameters
midletpath to the .jar
filenamepath to the any file

◆ StartMidlet()

void StartMidlet ( char * midlet)

Start java midlet.

Parameters
midletpath to the .jar

◆ RamJavaVMStarted()

int * RamJavaVMStarted ( void )

"VM started" flag: 1 while the Java VM exists, cleared when the VM ends.

The JVM message handler (JVM_*_MSG 0x6200-0x6203 on NSG/ELKA, 0x45-0x49 on SG, 0x48-0x4E on X75) ignores messages while it is 0.

Returns
pointer to the flag

◆ RamJavaExitPopup()

int * RamJavaExitPopup ( void )

Java exit popup flag: 1 while the "exit Java" popup is shown.

Then JVM_STOP_MSG / JVM_END_MSG show the popup again instead of ending the VM.

Returns
pointer to the flag

◆ RamJavaHeapSlots()

JAVA_HEAP_SLOTS * RamJavaHeapSlots ( void )

Java heap slots (see JAVA_HEAP_SLOTS).

After the VM has ended, free a slot with mfree(raw[i]) and zero heap[i] and the matching RamJavaVMHeaps entry. Without this the Java heap (MBs) stays allocated until a reboot.

Returns
pointer to the slot table

◆ RamJavaVMHeaps()

void ** RamJavaVMHeaps ( void )

Heap pointers reused by the next VM start; a non-NULL entry equals heap[i] of its JAVA_HEAP_SLOTS slot.

Returns
pointer to the entries (two; on X75 only entry [0])

◆ JAM_StartApplicationClass()

int JAM_StartApplicationClass ( WSHDR * class_name,
int unk1,
int unk2,
int unk3,
int unk4 )

Start a Java application by class name, as the firmware's FlexMenu_start does at boot for L"com.siemens.mp.app.flexmenu.MenuContainer" ("JAM_StartApplicationClass(%Pw)", csrc/core/jam_start_handler.c).

Starts the VM first when it is not running.

Parameters
class_namefull class name
unk1,unk2,unk3,unk40
Returns
nonzero if started