Posts tagged ‘API’

Mobile Programming – Cmd line tools for automated tests

Recently I had to perform an automated stress test for a compact framework application using the camera. I remembered MortScript (original web site down) and wrote a script to automate the test.

Another way to run CLI apps and see there output is PocketConsole and PocketCMD. The original web site is down, so please use archive.org to get the files.

Now, as there are sometimes more needs to automate tests, for example for battery performance tests, I decided to mimic the motorola emScript environment. emScript offers a lot of functions you may need on other devices too. Instead of putting all functions into one executable, I decided to have extern command line driven tool set. So I started to develop small tools to perform device functions.

scannerCLI

The first tool is scannerCLI. This tool issues a barcode scan on an intermec handheld device:

Just issue the scanner for a max time of supplied arg default timeout is 1 second:
"ScannerCLI.exe x" will issue a barcode scan with a timeout of x seconds.
x must be > 0 and < 10.
"ScannerCLI.exe" will issue a barcode scan for max 1 second. The scan will be stopped immediately if a barcode is read.
The return code is 0 for no barcode read, 1 for one or more read and negative for an error in barcode scan.

iBacklIghtCLI

This tool is to control or query the backlight settings of intermec devices. As you know the backlight is one of the most battery consuming setting.

arguments  function
on         switch backlight on using current brightness
off        switch backlight off
max        switch backlight brightness to max and on
min        switch backlight brightness to min and on

state      return 0 for is OFF, 1 for ON, -1 for error
level      return current brightness level or -1 for error

1 to max level 
           set new brightness level, returns new level or -1 for 
           error (ie val exceeds max level)

More tools will added here…

The source code for all published tools is be available at code.google.com.

http://code.google.com/p/win-mobile-code/source/browse/#svn%2Ftrunk%2Fcli-tools

Mobile Development: Move your Form

Although I do not yet know a use case for this, here comes some code to make your smartdevice forms being moveable.

As default, Windows forms on mobile devices are created always as maximized forms. There may be situations, where you need a moveable form. The trick in compact framework is to use SetWindowLong with WS_CAPTION style and apply that to your form.

  

To enable you to experminet more with Window Styles there is another demo enabling to check all known window stlyes with a form. Be warned, setting WS_DISABLED or some other styles will make your form inaccessible.

Continue reading ‘Mobile Development: Move your Form’ »

Control the green and orange keyboard shift planes on ITC device

Hello

as this is asked from time to tim, here is a sample and a class in C# (VS2005) that enables you to switch the green and orange keyboard shift plane of the keyboards on ITC CN3, CN3e and possibly other ruggedized ITC handheld devices.

You can control the keyboard shift state and you can subscribe to an event to get information about changes in the keyboard shift panel state. With the latter, you can create an application that is always aware of the active keyboard shift plane.

Continue reading ‘Control the green and orange keyboard shift planes on ITC device’ »

MDIdemo: application to show usage of ITC eMDI API

The attached application uses the ITC MDI API and looks similar to Document Capture. Additionally MDIdemo has a background thread sending files using HTML Form Post (as MDIwatch does) and you can save load settings to/from files for later reference.

Continue reading ‘MDIdemo: application to show usage of ITC eMDI API’ »