<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>anyRemote · Control your computer with your phone</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="description" content="anyRemote project page - Bluetooth remote control tool" /> <link rel="stylesheet" href="data/master.css" type="text/css" media="all" title="Default Style" charset="utf-8" /> <script src="data/effects.js" type="text/javascript" charset="utf-8"></script> <link rel="alternate" title="Feed" href="data/feed.xml" type="application/rss+xml" /> <link rel="icon" href="data/logo-favicon.png" type="image/png" /> <link rel="shortcut icon" href="data/logo-favicon.png" type="image/png" /> </head> <body id="docs"> <a class="skip" name="top"> </a> <a class="skip" href="#content">Skip to content</a> <div id="head"> <div id="logo"> <h1><a href="index.html"><img src="data/logo-head.png" alt="logo" /> anyRemote</a></h1> </div> <div id="navigation"><div class="padding"> <a href="index.html"><span>About</span></a> <a href="frontend.html"><span>Screenshots</span></a> <a href="dload.html"><span>Download</span></a> <a href="docs.html" class="active"><span>Documentation</span></a> <a href="faq.html"><span>FAQ</span></a> <a href="contacts.html"><span>Contact</span></a> <a href="thanks.html"><span>Special Thanks</span></a> </div></div> </div> <div id="sidebar"><div class="padding"> <dl class="info"> <dt>Information</dt> <dd> <p>Please use the two sidebar boxes below to browse through the anyRemote Documentation!</p> </dd> </dl> <dl class="docs"> <dt>Documentation</dt> <dd> <ul> <li><a href="pre-setup.html">Before install</a></li> <li><a href="pre.html">Software prerequisites</a></li> <li><a href="install.html">Compilation and installation</a></li> <li><a href="mode.html">Which mode to choose ?</a></li> <li><strong>Setup</strong> <ul> <li><a href="setup-at.html">Setup: AT mode</a> <ul> <li><a href="event.html">Event reporting</a></li> <li><a href="ckpd-emulation.html">Keypad emulation events</a></li> </ul> </li> <li><a href="setup-server.html">Setup: Server mode</a></li> </ul> </li> <li><a href="use.html">How to use anyRemote</a> <ul> <li><a href="android-client.html">Android Client</a></li> <li><a href="use-jc.html">J2ME Client</a></li> <li><a href="web.html">Web Interface</a></li> <li><a href="cm-xml.html">XML Services Interface</a></li> <li><a href="cfg-howto.html">How to create simple configuration file</a></li> <li><a href="bemused.html">Bemused Support</a></li> <li><a href="iviewer.html">Command Fusion iViewer support</a></li> </ul> </li> <li><a href="devices.html">Tested devices</a></li> <li><a href="phones.html">Phone specific details</a></li> <li><a href="tips-tricks.html">Tips & tricks</a></li> <li><a href="man.html">Man page</a></li> </ul> </dd> </dl> <dl class="docs-advanced"> <dt>Advanced</dt> <dd> <ul> <li><a href="http://elpraga.bshellz.net/HOWTOstartanyRemoteatboottime.html">miniHOWTO: start anyRemote at boot time and create a multimedia computer</a> (externally maintained)</li> <li><strong>Format of configuration files</strong> <ul> <li><strong>Server mode</strong> <ul> <li><a href="conf-server.html">Configuration file format</a></li> <li><a href="conf-server-ex.html">Configuration file examples</a></li> <li><a href="set.html">Set(...) / ExecAndSet(...) commands</a></li> <li><a href="set-fm.html">Set(filemanager ... ) command</a></li> <li><a href="set-icons.html">Set(icons ...) command and available icon set</a></li> <li><a href="set-list.html">Set(list ... ) and Set(iconlist ... ) commands</a></li> <li><a href="set-menu.html">Set(menu ... ) command</a></li> <li><a href="set-parameter.html">Set(parameter, ... ) commands</a></li> <li><a href="set-text.html">Set(text ... ) command</a></li> <li><a href="set-window.html">Set(image ... ) command</a></li> </ul> </li> <li><strong>AT mode</strong> <ul> <li><a href="conf-at.html">Configurational file format</a></li> <li><a href="conf-at-ex.html">Configurational file examples</a></li> </ul> </li> <li><strong>Common</strong> <ul> <li><a href="make.html">Make(...) command</a></li> <li><a href="emulate.html">Emulate(...) command</a></li> <li><a href="dbus.html">Dbus(...) command</a></li> <li><a href="vars.html">Variable substitution</a></li> <li><a href="ev-handlers.html">Event handlers</a></li> <li><a href="icon-themes.html">Icon themes for J2ME client</a></li> </ul> </li> </ul> </li> <li><a href="ir.html">anyRemote and InfraRed</a></li> </ul> </dd> </dl> <dl class="contact"> <dt>Contact</dt> <dd> <p>We will be pleased for any questions, suggestions, patches and examples of configuration files!</p> <ul> <li>Post in the <a href="http://sourceforge.net/forum/?group_id=162923">Forum</a></li> <li>Please, send e-mails to <a href="mailto:anyremote@mail.ru">anyremote@mail.ru</a></li> </ul> </dd> </dl> <!--HOSTINGLOGO--> </div></div> <!-- sidebar --> <div id="content"><div class="padding"> <a class="skip" name="content"> </a> <h1>Set(...) / ExecAndSet(...) commands</h1> <p><img class="float-right" alt="Text view screen" src="data/jc/banshee.png" /> This command used to control and customize GUI of J2ME/Android client. It is possible to change:</p> <ul> <li>caption of screen </li> <li>title and status fields</li> <li>arrange icons from predefined <a href="set-icons.html">icon set</a></li> <li>change background and foreground color</li> <li>change font size</li> <li>show album cover image</li> <li>change icon layout</li> <li>use internal vibrator of the phone</li> <li>toggle fullscreen mode</li> <li>show <a href="set-list.html">lists</a> and <a href="set-text.html">texts</a> data</li> <li>show MC-like <a href="set-fm.html">file manager</a></li> <li>show <a href="set-window.html">images</a></li> </ul> <p><strong>Set(...)</strong> command is used to set various parameters of GUI of J2ME/Android client with impicit data specification.</p> <p><strong>ExecAndSet(..)</strong> do the same thing, but it uses the results of executed command as a part of command which will be sent to J2ME/Android client.</p> <p>For details see examples below.</p> <p>There are a plenty of ways to use this command:</p> <h3><a href="set-icons.html">Set(icons, ...)</a></h3> <p>Format: <strong>Set(icons,caption,1,name1[,2,name2...,*,name11,#,name12])</strong></p> <p>where nameX specifies <a href="set-icons.html">desired action.</a> This command sets the caption of J2ME/Android client window and changes shown icons.</p> <pre>1=Exec(xmmsctrl play);Set(icons,XmmsPlaying,5,stop,1,kill); 1=ExecAndSet(icons,echo "XmmsPlaying,5,stop,1,kill");</pre> <p>if You do not want to change the caption of the J2ME/Android client window then it is possible to write:</p> <pre>1=Exec(xmmsctrl play);Set(icons,SAME,5,stop,1,kill);</pre> <h3>Set(caption ...)</h3> <p><strong>Format: Set(caption, new_caption)</strong></p> <p>This command sets the caption of J2ME/Android client window.</p> <pre>Set(caption,Help); ExecAndSet(caption,whoami);</pre> <h3>Set(title, ...)</h3> <p><strong>Format: Set(title, new_title)</strong></p> <p>This command sets the title field of J2ME/Android client.</p> <pre>Set(title,XMMS); ExecAndSet(title,whoami);</pre> <p>It is possible to add line break characters to the text. It could be done with <strong>"\n"</strong>.</p> <h3>Set(status, ...)</h3> <p>Format: <strong>Set(status, new_status)</strong></p> <p>This command sets the status field of J2ME/Android client.</p> <pre>3=Exec(xmmsctrl play);Set(status, Playing) 3=ExecAndSet(status,sh -c "if xmmsctrl playing;\ then echo Stopped; else echo Playing; fi")</pre> <h3>Set(bg ...)</h3> <p>Format: <strong>Set(bg,#XXXXXX)</strong> or <strong>Set(bg,R,G,B)</strong></p> <p>Where:</p> <ul> <li>#XXXXXX is hexadecimal representation of the color</li> <li>R, G, B are decimal integer values beetween 0 and 255</li> </ul> <p>This command sets the background color of control (main) screen of J2ME/Android client.</p> <p>Note: This command does not switch the current screen.</p> <p>For example to set background to blue:</p> <pre>3=Set(bg,#0000FF); 3=ExecAndSet(bg,echo "0,0,255");</pre> <h3>Set(fg ...)</h3> <p>Format: <strong>Set(fg,#XXXXXX)</strong> or <strong>Set(fg,R,G,B)</strong></p> <p>Where:</p> <ul> <li>#XXXXXX is hexadecimal representation of the color</li> <li>R, G, B are decimal integer values beetween 0 and 255</li> </ul> <p>This command sets the foreground color of control (main) screen of J2ME/Android client.</p> <p>Note: This command does not switch the current screen.</p> <p>For example to set foreground to blue:</p> <pre>3=Set(fg,#FF0000); 4=ExecAndSet(fg,echo "255,0,0");</pre> <h3>Set(font ...)</h3> <p>Format: <strong>Set(font [,small | medium | large] [,bold] [,italic] [,underlined] [,system | monospace | proportional])</strong></p> <p>This command sets font parameters for the title and status fields of control (main) screen of J2ME/Android client. Java realization in the phone could support only some subset of fonts which can be specified by this command.</p> <p>Note: This command does not switch the current screen.</p> <p>For example, the following commands sets small underlined bold proportinal font:</p> <pre>3=Set(font,small,underlined,bold,proportinal); 4=ExecAndSet(font,echo "small,underlined,bold,proportinal");</pre> <h3>Set(volume ...)</h3> <p>Format: <strong>Set(volume,X)</strong></p> <p>Where X should be between 0 and 100. This command sets value of volume bar of J2ME/Android client (it needs to issue <strong>Set(layout,....volume)</strong> command before to make volume bar visible):</p> <pre>3=Set(volume,50); 4=ExecAndSet(volume,xmmsctrl getvol);</pre> <h3><a name="sec-cover">Set(cover ...)</a></h3> <p>Format:<p> <p><strong>Set(cover,noname,/path/to/image/file)</strong> or</p> <p><strong>Set(cover,by_name,cover_name)</strong></p> <pre>1=Set(cover,noname,/tmp/album_cover.png); 2=Set(cover,by_name,cover-audio);</pre> <p>It is user responsibility to shrink image to the appropriate size on server side. Use <a href="conf-server.html#sec-get">Get(cover_size)</a> command to retrieve cover size. </p> <p>This command works only if layout previously set to <i>7x1</i> with <i>ticker</i> parameter:</p> <pre>4=Set(layout,7x1,ticker);</pre> <h3>Set(vibrate, ...)</h3> <p>Format: <strong>Set(vibrate,duration)</strong></p> <p>This command switches on internal vibrator of the phone (if exists) for specified amount of time. The duration is specified in tenths of a second and should be between 0 and 300.</p> <pre>5=Set(vibrate,2);</pre> <h3><a href="set-text.html">Set(text, ...)</a></h3> <p>Format: <strong>Set(text,add|replace|show|clear|close|fg|bg|font, _data_)</strong></p> <p>This command shows help test on the screen of cell phone. See detailed description <a href="set-text.html">here.</a></p> <pre>#=Exec(xmmsctrl quit);\ Set(text,replace,Help,To run Xmms press 1) #=ExecAndSet(text,replace,Date,date)</pre> <h3><a href="set-list.html">Set(list ...)</a></h3> and <h3>Set(iconlist ...)</h3> <p>Format:</p> <p><strong>Set(list,add|replace|clear|show|close|fg|bg|font, _data_)</strong> or</p> <p><strong>Set(iconlist,add|replace|clear|show|close|menu|fg|bg|font, _data_)</strong></p> <p>This command used to create and manage lists. It could be useful to manage player playlists or to browse directory structure. See detailed description <a href="set-list.html">here.</a> The iconlist can contain icons in front of each list item.</p> <pre>3=Set(list,replace,Shell commands,reboot,shutdown,uptime,dmesg); 3=ExecAndSet(list,replace,Example,more some_file.txt); 3=Set(iconlist,replace,Shell commands,\ launch:reboot,exit:shutdown,question:uptime,question:dmesg);</pre> <h3><a href="set-menu.html">Set(menu ...)</a></h3> <p>Format: <strong>Set(menu,add|replace|clear[,_data_])</strong></p> <p>This command used to manage menues. Custom made menu could be added to each screen of J2ME/Android client. See detailed description <a href="set-menu.html">here.</a></p> <pre>4=Set(menu,add,Random,Repeat,Shuffle); 4=ExecAndSet(menu,add,echo "Random,Repeat,Shuffle");</pre> <h3><a name="sec-layout">Set(layout ...)</a></h3> <p>Format:</p> <p><strong>Set(layout,default|3x4|7x1 [,keypad_only|joystick_only] [,ticker|noticker] [,volume] [,choose,_button_] [,up,_button_] [,down,_button_])</strong></p> <pre>4=Set(layout,default,ticker); 4=ExecAndSet(layout,echo "7x1,joystick_only,\ volume,up,VolUp,down,VolDown");</pre> <table> <tr> <td> <p><img class="float-right" alt="7x1 layout" src="data/jc/amarok-v2.png" /> This command used to choose icon layout to show. There are 2 icon layouts defined: <i>default (3x4)</i> and <i>7x1</i>.</p> <p>If <strong>keypad_only</strong> parameter specified, then it will be possible to send commands only by pressing numeric keys.</p> <p>If <strong>joystick_only</strong> parameter is specified, then it will be possible to send commands only by pressing joystick central button.</p> <p>If <strong>choose,_button_</strong> parameter is specified then initial selection will be set to button with appropriate number. (0-9, *, # are the valid values for the button).</p> </td> </tr> <tr> <td> <p><img class="float-right" alt="16x16 icons" src="data/jc/amarok-16.png" /> If <strong>ticker</strong> parameter is specified then ticker (running text) will be used to show title field instead of static text.</p> <p>If <strong>noticker</strong> parameter is specified then title field will be shown as static text.</p> <p>If <strong>volume</strong> parameter is specified then volume bar will be shown.</p> <p>In 7x1 icon layout if there will be not enough space on phone screen to show all icons, then some of them can be omitted.</p> <p>If J2ME contains all icon sets then if heigth of the screen is less than</p> <ul> <li>220pt. then 16x16 icons will be used by default</li> <li>280pt. then 32x32 icons will be used by default</li> <li>340pt. then 48x48 icons will be used by default</li> <li>400pt. then 64x64 icons will be used by default</li> <li>600pt. then 96x96 icons will be used by default</li> <li>overwise 128x128 icons will be used by default</li> </ul> <p>It is possible to change icon size with <strong><a href="set-parameter.html">Set(parameter,icon_size,...)</a></strong> command. Beware, for J2ME client valid values are only 16/32/48/64/96/128.</p> <p><strong>Note</strong>: to make this command work it needs to use J2ME which contains specified icon set.</p> </td> </tr> <tr> <td> <p><img class="float-right" alt="Default (3x4) layout" src="data/jc/amarok.png" /> <p>In 7x1 icon layout it is possible to specify action to JoystickUp and JoystickDown with help of "up,_button_up_" and "down,_button_down_". If user pushes JoystickUp/JoystickDown then _button_up_/_button_down_ events will be sent.</p> <p><strong>Note</strong>: It is possible to change distance between icons <strong><a href="set-parameter.html">Set(parameter,icon_padding,...)</a></strong> command.</p> </td> </tr> <tr> <td> <img class="float-right" alt="Filemanager screen" src="data/jc/fileManager2.png" /> <h3>Set(filemanager ...)</h3> <p>Format: <strong>Set(filemanager, add|replace|select, left|right, [_data_])</strong></p> <p>This command used to show file manager window. It looks like <a href="http://www.ibiblio.org/mc/">MC</a> and allows to do basic file operations. See detailed description <a href="set-fm.html">here.</a></p> <pre>3=Set(filemanager,add,left,.,..); 4=ExecAndSet(filemanager,add,left,ls -1); </pre> </td> </tr> </table> <h3>Set(fullscreen ...)</h3> <p>Format: <strong>Set(fullscreen,on|off|toggle)</strong></p> <p>Set fullscreen mode on or off.</p> <pre>3=Set(fullscreen,toggle); 4=ExecAndSet(fullscreen,echo on);</pre> <h3>Set(editfield ...)</h3> <p>Format: <strong>Set(editfield,caption_value,label_value,init_value)</strong></p> <p>Shows edit field on phones screen. When used press <strong>Ok</strong> then reply <strong>Ok(0,_entered_value_)</strong> will be sent to server.</p> <pre>3=Set(editfield,Enter parameters,\ Parameters,Enter your data here); 4=ExecAndSet(editfield, echo "Enter parameters,Parameters,Enter your data here");</pre> <p>For example, if user enters, say - new_line - and presses <strong>Ok</strong>, then reply <strong>Ok(0,new_line)</strong> will be sent.</p> <h3>Set(disconnect)</h3> <p>Format: <strong>Set(disconnect)</strong></p> <p>Force J2ME/Android client to disconnect from PC.</p> <pre>0=Set(disconnect);</pre> <h3><a href="set-parameter.html">Set(parameter, ...)</a></h3> <p>Format: <strong>Set(parameter,[_parameter_name_,_parameter_value_]+)</strong></p> <p>This command used to tune J2ME/Android client in some aspects (which could be hardware-dependent). See detailed description <a href="set-parameter.html">here.</a></p> <h3><a name="sec-repaint">Set(repaint)</a></h3> <p>Format: <strong>Set(repaint)</strong></p> <p>This command force J2ME client to repaint the screen.</p> <pre>3=Set(repaint);</pre> <a name="sec-image"></a><h3><a href="set-window.html">Set(image ...)</a></h3> <p>Format:</p> <p><strong>Set(image,window,_image_file_name_)</strong> or</p> <p><strong>Set(image,icon,_icon_name_,_image_file_name_)</strong> or</p> <p><strong>Set(image,show|close|cursor|nocursor|remove_all)</strong></p> <p>This command used to show images on screen of cell phone or upload icons which could be used in <a href="set-icons.html">Set(icons,...)</a> command. See cfg-example/Server-mode/winManager.cfg and cfg-example/Server-mode/iconUpload.cfg for details. See detailed description of <strong>Set(image ...)</strong> <a href="set-window.html">here.</a></p> <pre>3=Set(image,window,/tmp/image.png);</pre> <h3><a name="sec-popup">Set(popup ...)</a></h3> <p>Format:</p> <p><strong>Set(popup,show|hide,_message_)</strong> or</p> <p>This command used to show popup message on screen of cell phone.</p> <pre>4=Set(popup,show,Please wait !);</pre> <h2><a name="data-caching">Data caching</a></h2> <p>To mimimize traffic between PC and J2ME/Android client results of the following commands will be cached:</p> <ul> <li>Set | ExecAndSet(bg,...);</li> <li>Set | ExecAndSet(cover,...);</li> <li>Set | ExecAndSet(fg,...);</li> <li>Set | ExecAndSet(font,...);</li> <li><a href="set-icons.html">Set | ExecAndSet(icons,...);</a></li> <li>Set | ExecAndSet(layout,...);</li> <li>Set | ExecAndSet(status,...);</li> <li>Set | ExecAndSet(title,...);</li> <li>Set | ExecAndSet(volume,...);</li> </ul> <p>Then one of these command will be executed next time, it will be send to J2ME/Android client <strong>only</strong> if command data are <strong>changed</strong>.</p> </div></div> <!-- content --> <div id="foot"> <p>Maintained by <a href="mailto:anyremote@mail.ru">anyRemote</a>. Website by <a href="http://www.martinlettner.info">m.lettner</a>.</p> </div> </body> </html>