Recent Changes - Search:

wiki Start

main page

OpenMix

Text

Thanks

WikiSandbox
edit SideBar

BrianContent

first documentation for inhalt.xml

in order to extend or edit the content of this application unpack the jar-file using any zip-archiver and 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

german version shown

<?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?
  </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

nameexampledescription
Assignmentx=1Assign value to variable. After execution of this statement, it is possible to access variables from other expressions.
Conditional operatorc?x:yIf 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)
Greaterx>yThe 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;
Lessx<yThe 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;
Between1<x<5The 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.
Sequencex=1,y=2Sequence 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.
Additionx+ySum of two operands
Subtractionx-yDifference of two operands
Multiplicationx*yMultiplication of two operands
Divisionx/yDivision of first operand on the second operand
Powerx^yRaise 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
Sinesin(x)Sine
Cosinecos(x)Cosine
Tangenttan(x)Tangent
Arc sineasin(x)Arc sine
Arc cosineacos(x)Arc cosine
Arc tangentatan(x)Arc tangent
Exponentexp(x)Exponent
Natural Logarithmln(x)Natural logarithm
common Logarithmlog(x)common logarithm (base 10)
Ceilceil(x)Smallest integer value not less than operand
Floorfloor(x)greatest integer value not greater than operand
Square rootsqr(x)Square root

count and order of the formulas

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

fieldsformulas
22
36
412
520

the order is to be kept as follows:

number of fieldsformula-Nrwill be used when this field is changed by the userand calculates the new value of field
2112
2221
3112
3213
3321
3423
3531
3632

and so on in case of more fields...

back to Brian main page

Christian Güssmer 2006

Edit - History - Print - Recent Changes - Search
Page last modified on March 10, 2011, at 05:12 PM