mind serializer and weblog
[ start | index | login ]
start > MobileControl > MobileControl Application

MobileControl Application

Created by case. Last edited by case, one year and 205 days ago. Viewed 2,844 times. #26
[diff] [history] [edit] [rdf]
labels
attachments
LICENSE.txt (35226)
config-part_1by1player.xml (1988)
config-wmp.xml (4936)

Mobile Control Application

The Mobile Control Application is a Java application, which checks the opened Windows applications and allows remote control of that Windows applications by sending key strokes to them.

The application is part of the MobileControl mini suite.

Setup (MS Windows)

  • Have Java 5 installed (it should work with Java 1.4, too)
  • Download and unpack MobileControl binaries.
  • Setup your bluetooth stack and establish com port for incoming connections
  • Enter com port number to config.xml in unpacked folder (using Wordpad)
  • Start run.cmd from unpacked folder to start the Mobile Control application
  • Run the MobileControl Midlet

Functionality

The current implementation is limited to MS Windows. It uses some Win32 calls (via >>Jawin) and the >>java.awt.Robot to access application windows and window titles. Keystrokes are sent to Windows (ALT+TAB) to iterate through the applications. Keystrokes (keyPress and keyRelease) are sent to window in front to trigger application functions.

Exchange the W32Control class for other platforms is possible by changing the configuration. Used libraries, such as >>JDesktop Integration Components JDIC and >>Java(TM) Communications API also exist for other environments and may be setup to allow operation on non-MS Windows platforms

Known Bugs

  • Version 1.1 does not support multiple modifiers for a keystroke. fixed in 1.2
  • Version 1.2 calls getTitle right after action invocation to Ack an action. Sometimes that should be called with a delay. For delay, a new tag in keyAction <delay> shall be introduced (optional) and specify time in ms to wait before getting a title after action was invoked. fixed in 1.2.1

Interface

UI

After Startup, the application reads in the configuration file (config.xml). Then it tries to get all window handles by using ALT+TAB calls. Finally it nests itself to the System Tray and can be exited using the context menu of the tray icon.

The System Tray icon also allows

  • Display of Log View
  • Deletion of Log entries
  • Dis/Enabling of Logging
The Log View show some basic log events which might help to track down error if new application configurations fail to work.

Errors
If any error occurs during that Startup process, a PopUp is displayed. So if the tray icon does not display, check if a pop up has been opened (probably, it is in the background, as the application iterates through the opened windows).

The error popup will indicate information about the cause.

Errors during runtime might be displayed as tray icon pop ups and are registered in the Log View accessible using the System Tray icon.

If errors occur because an configured application cannot be found or has been closed during runtime, the Mobile Control application tries to reconfigure itself by iterating trough the windows again to allow retries. Such errors will happen, if the mobile sends a request for an application, which is not running or recognized.

Configuration

Configuration is done by updating the config.xml file within the Mobile Control application's directory. You may specify other filenames in run.cmd

Xml file for download

By copying and adjusting the settings, you can easily alter your configuration for your needs:
  • update the portNumber tag with the com port settings of your system

  • insert an appInteraction setting for a new application configuration
  • set a unique name within appInteraction for nameForDisplay tag such as Winamp
  • set a Regular Expressiong within the appInteraction using titleRegEx to find the application window (e.g. .*Winamp.*)
  • insert actionsDefinition Section to define keyAction elements
  • insert multiple keyAction tags within one actionsDefinition to register actions. The description tag is optional.
  • define a keyAction by inserting uniqueName elements, description elements (optional) and keyAsVK (mandatory) and modifierAsVK (optional) tags
  • set keyAsVK tag to define the keystroke with values from the java >>KeyEvent class.
  • set, if needed, modifierAsVK to values such as VK_CONTROL or VK_ALT. Multiple modifiers can be separated by commas (e.g. VK_SHIFT, VK_CONTROL)
  • set, if needed, delay to integer in milliseconds to force waiting after invokation, before retrieving the new window title (helps, if application needs time to update window title after key strokes)
ATTENTION: The file easily gets corrupted, if an editor is used, which changes the layout of the file inserting LineFeed or CarriageReturn characters.
To avoid such problems you might use Microsoft WordPad (write.exe), which will not alter the encoding. The application uses the platforms default encoding, so keep that in mind, if you are changing the file.

Patrial sample view of config.xml:

<!-- This file holds the Configuration for the Application Control tool
     version: $Id: config.xml,v 1.4 2005/05/08 21:49:35 marcus Exp $

Modify this file with an editor, which does not change any control characters such as CarriageReturn or LineFeed (WordPad servers fine on MS Windows)

<portNumber> must be set to the COM port configured within the Bluetooth Config.

To enter a new application, insert an <appInteraction> section within the <applications> tag.

<modifierAsVK> tags are optional. The content can be a single VK_ code or multiple VK_ codes separated by commas.

<delay> tag (optional) specifies time in ms to wait after action invocation before updating title.

--> <AppControlConfig> <portNumber>7</portNumber> <appControlClass>de.wintermute.w32util.W32Control</appControlClass> <applications> <appInteraction> <nameForDisplay>PPT Presentation</nameForDisplay> <titleRegEx>.*Bildschirmpr.*</titleRegEx> <actionsDefinition> <keyAction> <uniqueName>next slide</uniqueName> <description>next slide</description> <keyAsVK>VK_RIGHT</keyAsVK> </keyAction> <keyAction> <uniqueName>prev slide</uniqueName> <description>previous slide</description> <keyAsVK>VK_LEFT</keyAsVK> </keyAction> </actionsDefinition> </appInteraction> <appInteraction> <nameForDisplay>Winamp</nameForDisplay> <titleRegEx>.*Winamp.*</titleRegEx> <actionsDefinition> <keyAction> <uniqueName>play</uniqueName> <description>start playback</description> <keyAsVK>VK_X</keyAsVK> <modifierAsVK></modifierAsVK> </keyAction> <keyAction> <uniqueName>stop</uniqueName> <description>stop playback</description> <keyAsVK>VK_V</keyAsVK> </keyAction> <keyAction> <uniqueName>pause</uniqueName> <description>pause playback</description> <keyAsVK>VK_C</keyAsVK> </keyAction> <keyAction> <uniqueName>next</uniqueName> <description>go to next song</description> <keyAsVK>VK_B</keyAsVK> </keyAction> <keyAction> <uniqueName>previous</uniqueName> <description>go to previous song</description> <keyAsVK>VK_Z</keyAsVK> </keyAction> <keyAction> <uniqueName>first</uniqueName> <description>go to first song</description> <keyAsVK>VK_Z</keyAsVK> <modifierAsVK>VK_CONTROL</modifierAsVK> <delay>200</delay> </keyAction> <keyAction> <uniqueName>last</uniqueName> <description>go to last song</description> <keyAsVK>VK_B</keyAsVK> <modifierAsVK>VK_CONTROL</modifierAsVK> </keyAction> ...snip… </actionsDefinition> </appInteraction> </applications> </AppControlConfig>

Change Log

Version 1.2.1

  • Introduce <delay> tag for delay after action invokation before getting new window title

Version 1.2

  • Show Version Number
  • Allow multiple VK_ codes in config for modifiers

Version 1.1

  • Code Review
  • Included Log and Log View with basic log events

Version 1.0

  • Initial Version, first build
no comments | post comment
Quick Links
WhatIsThis about?
Midlets (mobile apps)
TimeLine
Charley a dog's life
MovieReview
Impressum
Project (internal)

Logged in Users: (2)
… and 5 Guests.

< September 2008 >
SunMonTueWedThuFriSat
123456
78910111213
14151617181920
21222324252627
282930

Icon-Snip more changes...

Blogs
>>++ vox.machina ++
>>Zitate - Sprüche - Aphorismen
>>Wil Wheaton
>>Mathematische Kleinigkeiten
>>William Gibson
>>instant-thinking
>>Over heard in NY

nearby  sites
link=http://www.mozilla.org/products/firefox/central.html
link=http://www.nutellausa.com/
link=http://snipsnap.org
link=http://www.amazon.de/exec/obidos/registry/wishlist/ref=cs_nav_top_2/028-7651535-0049343
RSS Feed RSS Feed
post to del.icio.us

Stats: 1176 snips by 16 users
created 5 years and 236 days ago

Powered by
>>SnipSnap 1.0b2-uttoxeter
with SnipScale 1.1.0



This work is licensed under a
>>Creative Commons License.

SEARCH