back

first documentation for inhalt.xml

in order to add or edit the content of this application unpack the jar-file using any zip-packer, edit the file inhalt.xml, caution: the file HAS to be saved with line breaks in unix format, otherwise the application will not start anymore! at last transfer the jar-file (including the new inhalt.xml) to your phone
hint: temporarily rename the jar-file with a .zip-ending

simple example
<?xml version="1.0" standalone="yes"?>
<Brian>
  <Berechnungen>

root may be anything

elements without attributes or content appear in lists for navigation

    <page name="Temp" descr="Celsius/Fahrenheit">
page defines a form for calculations
attributes: name is required, descr is an optional text for a description
      <feld name="°C" init="15" />
      <feld name="°F" init="59" rund="1" />

here 2 fields are defined
attributes: name is required
and optional:
init="15" - value shown when opening the form
edit="false" - to protect the field from user input
rund="1" - count of numbers after the comma (rounded)
format="hex" - a hexadecimal field (alternatively "bin") the values are always internally converted to decimal

      <formel val="#0*1.8+32" />
      <formel val="(#1-32)*(5/9)" />
to define the formulas of the calculation
attribute: val contains the formula (see below for operators)
there is a strictly count and order of the formulas see below
    </page>
  </Berechnungen>
(close elements)
  <Texte>
    <text name="eins" descr="ein kurzer Text" image="bild.png" />
a new element for navigation
any element that is not empty will be displayed as text (indepent of the element's name being text or not)
attributes: name is required, descr is the (optional) text, image is the file name of an optional png-image inside the jar-archive
    <text name="zwei" monospace="true" size="small">
larger texts may contain
line
breaks
that have to be right in here...</text>
another example for text
here it is placed as content of the element letting you control the line breaks. moreover there are optional styles to be choosen from:
monospace="true" - to select a monospace font
size="small" or size="large" - easy, isn't it?
(both styles are not working on a SE K700)
  </Texte>
</Brian>
(closing elements)

please note: on some Nokia phones the size of jar-Files is limited to 64kB.

about the formulas:
to use the values entered or shown in one of the fields the character # is to be used, immediateley followed by the the field's number, counting starts witch 0 for the first field, so the second field is #1
the operators of the compiler by Konstatin Knizhnik
name example description
Assignment x=1 Assign value to variable. After execution of this statement, it is possible to access variables from other expressions.
Conditional operator c?x:y If value of expression left to question sign is true, than value of conditional expression is value of the expression after question sign, otherwise - value of expression after colon sign.The following conditional expression for example example is used to calculate fibonnachi numbers: fib(x)=x<2?1:fib(x-1)+fib(x-2)
Greater x>y The value of expression is true if value of left operand is greater than value of right operand. In order to kepp the xml well formed write as entity: &gt;
Less x<y The value of expression is true if value of left operand is less than value of right operand. In order to kepp the xml well formed write as entity: &lt;
Between 1<x<5 The value of expression is true if value of the second operand is within bounds specified by first and third operands. Use entities &lt; to keep the xml well formed.
Sequence x=1,y=2 Sequence of expressions. Expression are evaluated in left-to-right order and result of the last expression is used. using sequences of expressions allows to write the simplest programs.
Addition x+y Sum of two operands
Subtraction x-y Difference of two operands
Multiplication x*y Multiplication of two operands
Division x/y Division of first operand on the second operand
Power x^y Raise left operand to the power specified by right operand
Integer part [x] integer part of the number
Floating part {x} Floating part of the number
Absolute value |x| Absolute value
Parenthesis (x) Expression in parenthesis
Sine sin(x) Sine
Cosine cos(x) Cosine
Tangent tan(x) Tangent
Arc sine asin(x) Arc sine
Arc cosine acos(x) Arc cosine
Arc tangent atan(x) Arc tangent
Exponent exp(x) Exponent
Natural Logarithm ln(x) Natural logarithm
common Logarithm log(x) common logarithm (base 10)
Ceil ceil(x) Smallest integer value not less than operand
Floor floor(x) greatest integer value not greater than operand
Square root sqr(x) Square root

count and order of the formulas
the number of the formulas depends on the number of the fields (theoretically max. 9):

fields formulas
2 2
3 6
4 12
5 20

the order is to be kept as follows:

number of fields formula-Nr will be used when this field is changed by the user and calculates the new value of field
2 1 1 2
2 2 1
3 1 1 2
2 1 3
3 2 1
4 2 3
5 3 1
6 3 2

and so on in case of more fields...

back

Christian Güssmer 2005-06