Mohit Gogia's weblog

  • Writing smart-device automated tests on standalone Device emulator install with RAPI

    In my previous blog, we discussed on how you can use DEM APIs (with Device Emulator V3 Beta) in association with RAPI to achieve your test automation. But in case you are running Device emulator standalone in absence of Visual Studio and working with your custom images only, the corecon managed APIs won't be available.

    The very first thing you need to do in that case is to enable your custom images and emulator configurations being visible in Device Emulator Managed view. You can achieve this via using Corecon-lite feature. Using this by writing simple .decfg files and placing them appropriately, these will be visible in DEM view. You can now use DEM APIs to enumerate through these emulator configuration and perform various operations like Cradle, Connect, Reset, Shutdown, Clear Save state, Set/Get Configuration etc.

    Since now your custom emulators are accessible using DEM APIs, you can cradle them which will lead activesync to believe a device is connected to it. Once you have cradled you can use rich APIs as provided with RAPI which will allow you to manipulate directories/files, create process etc. The benefit of this approach is that this framework will actually work seamlessly across devices and emulators with slight variations.

    -Thanks,

    Mohit

    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Writing SmartDevice automated tests using DEM Automation Interface with Corecon Managed APIs

    Few days back I presented at Techmela on automating your test cases for Devices using Device Emulator Manager automation interfaces, in association with Corecon Managed APIs (Exposed with Visual Studio 2008 Codename "Orcas") around which this blog is going to be focussed.

    Using Automation Interfaces:- 

    DEM v3 Beta1 (dvcemumanager.exe) has embedded TLB (as well as IDL as part of installation) for DEM Automation interfaces, so if you will do a TLBImp on this exe and view the Interop dll in Object Browser of Visual Studio, you will notice a set of interfaces, namely IDeviceEmulatorManager, IDeviceEmulatorManagerVMID, IEnumManagerSDKs and IEnumVMIDs, being exposed. (Please note with Beta2 based on feedback we will shipping Interop dll directly instead of idl file and embedding TLB in DvcEmuManager).

    IDeviceEmulatorManager interface represents an instance of DEM and you can CoCreate this object (CLSID_DeviceEmulatorManager) as will be discussed in following code. On this object, you can invoke EnumerateSDKs method which will give you an instance of IEnumManagerSDKs which corresponds to Datastore, Others, My Device Emulator and All Device Emulator node in DEM view and logically represents a collection of SDKs. So, for example, if you have Visual Studio installed, first node will be corresponding to Datastore. To move to next node you can invoke MoveNext method on IDEM object. Other methods are ShowManagerUI, Reset, RegisterRefreshEvent, get_Name etc.

    Once you have got an instance of IEnumManagerSDKs, you can use EnumVMIDs method to get an instance of IEnumVMIDs. An instance of IEnumVMIDs represents a collection of Device Emulator instances aka SDK in DEM view (Like Windows Mobile 5 SDKs etc). IEnumManagerSDKs interface also exposes methods like get_Name, MoveNext and Reset which can be used get name and iterate.

    Using this instance of IEnumVMIDs, you can actually invoke method GetVMID and get an instance of IDeviceEmulatorManagerVMID. The instance of IDeviceEmulatorManagerVMID represents an emulator instance on which you can perform operations as exposed from DEM UI like Cradling, Connect, Shutdown, Reset, SetConfiguration, GetConfiguration, Shutdown etc.

     Following is C# code i quickly wrote to illustrate how to connect to an emulator in "Windows Mobile 6 Professional SDK" using DEM APIs

            public void Connect(string szName)
            {
                IDeviceEmulatorManager manager = new DeviceEmulatorManager();

                do
                {
                    IEnumManagerSDKs sdk = manager.EnumerateSDKs();
                    System.Console.WriteLine("DEM " + sdk.get_Name());

                    if (sdk.get_Name().Contains("Windows Mobile 6 Professional SDK"))
                    {
                        IEnumVMIDs vmids = sdk.EnumerateVMIDs();
                        do
                        {
                            IDeviceEmulatorManagerVMID vmid = vmids.GetVMID();
                            if (vmid.get_Name().Equals(szName))
                            {
                                vmid.Connect();
                                break;
                            }
                            try
                            {
                                vmids.MoveNext();
                            }
                            catch (Exception ex)
                            {
                                break;
                            }
                        } while (true);
                    }

                    try
                    {
                        sdk.MoveNext();
                    }
                    catch (Exception ex)
                    {
                        break;
                    }
                } while (true);

            }

    Quick view of Corecon Managed API:-

    Since this blog is focussed on DEM APIs so we will not discuss in detail about Corecon APIs. As part of Orcas, Corecon exposed managed APIs which provides Raw transport services, ability to Send a file from desktop to device (or emulator), Receive a file, Execute an app and other rich set of functionality without you needed to worry about transport details. So suppose you wanted to Send a file to an emulator in Windows Mobile 6 Professional SDK, you can use code similar to following piece of code which i wrote very quickly.

            public void SendFile(int localeId, string szEmuName)
            {
                DatastoreManager dsmgrObj = new DatastoreManager(1033);

                //Get Collection of platforms entries present in Data store
                IEnumerable<Platform> platformcollection = dsmgrObj.GetPlatforms();

                //Iterate through Collection of platforms
                foreach (Platform objplatform in platformcollection)
                {
                    System.Console.WriteLine(objplatform.Name);
                    if (objplatform.Name.Contains("Windows Mobile 6 Professional SDK"))
                    {
                        IEnumerable<Device> pdeviceCollection = objplatform.GetDevices();
                        foreach (Device objdevice in pdeviceCollection)
                        {
                            System.Console.WriteLine("\t" + objdevice.Name);
                            //Check if the device is an emulator
                            if (objdevice.IsEmulator() == true &&
                                objdevice.Name.Equals(szEmuName))
                            {

                                 FileDeployer fileDeploy;
                                fileDeploy = m_device.GetFileDeployer();
                               fileDeploy.SendFile(szDesktopPath, szDevicePath);
                            }
                        }
                    }
                }
            }

    OK-OK enough of API details but how is it useful to me in writing automation:-

    Ok, we'll walk through a scenario where your application is battery aware and you want to test it.

    1. Start you test automation framework.

    2. It will use Corecon APIs to copy you app executable on a Device emulator and execute it.

    3. Now you can use the DEM APIs SetConfiguration method and modify the battery charge to 60% from 100% or A/c power mode (Look into XML schema in previous post).

    4. Your app should ideally be responding to this change in battery level (It can register with State and Notification broker in Windows Mobile to get power state change notifications). You can either dump this change logs in a log file or use Corecon APIs device agent mechanism to communicate it back on desktop side.

    5. Similarly now you use to reduce the charge further to Low battery and critical battery levels and accumulate the info in the logs as appropriate.

    6. Once your test finishes, you can match your logs with golden file to see your app continues to work great during development phases.

    You can see from this battery example, how easy it becomes to automate these scenarios where this is very difficult to even manually repro in association with actual device. Here i chose C# but DEM APIs provides you flexibility to use them from managed code, VB Script or native code. In addition, even in case of stand-alone installation of DE all Corecon-lite nodes (See previous post) are visible perfectly from DEM APIs, so you can use DEM APIs in stand-alone mode or with Visual Studio installed. However, please note that in stand-alone installation Corecon Managed APIs won't be available so you can Cradle the emulator and rely on rich set of APIs from RAPI.

     We hope you will like this feature. Please use http://connect.microsoft.com/ to give us your feedback or report us any issues you find. Your feedback is very important to us to make this produce better than itself.

    -Namaste,

    Mohit

    This posting is provided "AS IS" with no warranties, and confers no rights.

  • What is Corecon-lite?

    So as promised, first in the series of discussions for Device Emulator V3 features is Corecon-lite. In short Corecon-lite adds capability for managing your custom emulator images (or custom emulator configurations) using Device Emulator Manager even if you don't have Visual Studio installed. This is especially useful in scenario of Marketing folks who want a very light weight installation of custom emulator configurations to show demos.

    For this feature we need to understand the concept of response files to Device Emulator (called as DECFG files) and some special directories where storage of these decfg files will lead to lighting up of custom emulator configurations in Device Emulator Manager view.

     Response Files to Device Emulator:-

    In Device Emulator v3.0, we added the capability that Device Emulator can take response file in addition to usual way of passing command-line options. So suppose we have a response file named PocketPCBatteryEnabled.decfg file which contains the configuration of the emulator, we want emulator to start with, we can invoke following command-line

    deviceemulator.exe "@PocketPCBatteryEnabled.decfg"

    These response files are named as decfg files and schema for the same is discussed in Appendix1. One sample decfg file is

    <?xml version="1.0" encoding="utf-8"?>

    <!-- Comment -->

    <DeviceEmulator xmlns="http://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg">

    <Platform>Windows Embedded CE 6.0</Platform>

    <Emulator>

    <VmName>DecfgDeviceEmlator</VmName>

    <Language>1033</Language>

    <AlwaysOnTop>true</AlwaysOnTop>

    <VMID>{bc8ea444-9068-48c3-8f03-e7b0c333d97f}</VMID>

    </Emulator>

    <Board>

    <OSImage>%programfiles%\Microsoft Visual Studio 9.0\SmartDevices\emulators\images\pocketpc\2003\1033\PPC_2003_SE_WWE_ARMv4.bin</OSImage>

    <MemSize>128</MemSize>

    </Board>

    <Peripherals>

    <SharedFolder Enabled="true">c:\</SharedFolder>

    <Battery Charge="80"/>

    </Peripherals>

    </DeviceEmulator>

    If you will use this response file to DE, it will launch emulator with Shared-folder mapped to "c:\" and battery being enabled with charge @80% and name of "DecfgDeviceEmulator".

    Special Directories DEM recognizes as Corecon-lite directories:-

    Device Emulator Manager looks in two special directories - "CSIDL_PERSONAL\My Device Emulators" and "CSIDL_COMMON_DOCUMENTS\All Device Emulators" - for the presence of any .decfg files as discussed above and displays them in Device Emulator Manager view under a root level node named {All Device Emulators, My Device Emulators}. So if you named the above decfg file to be "MyCoreconLiteEmulator" and placed it in "CSIDL_PERSONAL\My Device Emulators" directory, it will light up in Device Emulator Manager view as

    - My Device Emulators

    - Windows Embedded CE 6.0

    - MyCoreconLiteEmulator

    Now you can access this MyCoreconLiteEmulator node in DEM view similar to you access any of the emulator nodes present with Visual Studio installed on your m/c.

    There are few points which need to be taken care with the corecon-lite decfg files

    1. Presence of VMID element:- DECFG files in corecon-lite nodes should have VMID element. This is needed because for DEM, device emulator VMID is the primary key using which DEM figures out the state of emulators. So whenever an emulator starts, it registers itself in a ROT and DEM uses this to know the state of emulator.
    2. Colliding VMID resolution:- If there are multiple decfg files with the same VMID (or VMID collides with Corecon emulator), then DEM will display only one emulator node for which the priority order is Datastore emulator, My Device Emulators, All Device Emulators and then Others node (Others node is basically running emulator registered in ROT which doesn't belong to any of above categories). For example, if there is a MyDevEmu.decfg file in "My Device Emulators" directory with VMID X and a AllDevEmu.decfg in "All Device Emulators" directory with the same VMID X, then in DEM view only MyDevEmu node will be shown but not AllDevEmu node. In a perticular directory, the order of selection is not deterministic.

    On Win-XP the CSIDL mapping is (To know more about CSIDL mappings http://msdn2.microsoft.com/en-us/library/ms649274.aspx)

    • CSIDL_PERSONAL ~ c:\documents and settings\<user name>\My Documents.
    • CSIDL_COMMON_DOCUMENTS ~ C:\Documents and Settings\All Users\Documents

    Can i use decfg file in an arbitrary location?

    Yes, you can launch decfg file from any arbitrary location using the File->Open menu of Device Emulator Manager.

     Hope you will like this feature.

    -Mohit

     This posting is provided "AS IS" with no warranties, and confers no rights. 
     

    Appendix 1:- Schema for decfg files.

    Following is the schema you can use for decfg files

    <?xml version="1.0" encoding="utf-8"?>

    <!-- Microsoft Device Emulator 1.0 Configuration Schema -->

    <xs:schema targetNamespace="http://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg" xmlns:mstns="http://schemas.microsoft.com/DeviceEmulator/2006/01/DeCfg" xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="DeviceEmulator">

    <xs:complexType>

    <xs:sequence>

    <xs:element name="PlatformName" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    The inner text specifies the name of the platform node to display this configuration in.

    </xs:documentation>

    </xs:annotation>

    </xs:element>

    <xs:element name="Emulator">

    <xs:annotation>

    <xs:documentation>

    Defines the configuration of the emulator itself.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:sequence>

    <xs:element name="AllowPassiveKitl" type="xs:boolean" default="false">

    <xs:annotation>

    <xs:documentation>

    Allow KITL to connect in passive mode

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="Language" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Specifies the UI language, as a decimal LangID.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="AlwaysOnTop" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

    <xs:annotation>

    <xs:documentation>

    Keeps the emulator window always on top.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="false" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="ConsoleWindow" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

    <xs:annotation>

    <xs:documentation>

    Creates and displays a console window to show output from Serial Port 1.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="HostKey" type="xs:string" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Specifies host key, where the inner text can be "None", "Left-Alt", or "Right-Alt".

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="Rotation" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" default="0">

    <xs:annotation>

    <xs:documentation>

    Rotates the display by degrees, where the inner text angle can be 0, 90, 180, or 270.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="VMID" type="xs:string" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Virtual Machine Identifier GUID.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="VMName" type="xs:string" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Specifies the window title.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="SaveState" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Savestate configuration. The optional inner text specifies the savestate filename.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="NoSecurityPrompt" minOccurs="0" maxOccurs="1" type="xs:boolean" default="false">

    <xs:annotation>

    <xs:documentation>

    Do not prompt for unsafe peripherals.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="DefaultSave" type="xs:boolean" default="false" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Use VMID to find save-state location. SaveState and Default elements are mutually exclusive

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="Zoom" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

    <xs:annotation>

    <xs:documentation>

    Zooms the display to 2x normal size.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="Video" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Video configuration, unless overridden by the presence of a skin. Skin and Video are mutually exclusive.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:sequence>

    </xs:sequence>

    <xs:attribute name="Height" type="xs:nonNegativeInteger" />

    <xs:attribute name="Width" type="xs:nonNegativeInteger" />

    <xs:attribute name="BitsPerPixel" type="xs:nonNegativeInteger" />

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="Skin" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Skin configuration. The inner text is the skin XML filename.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="ToolTips">

    <xs:annotation>

    <xs:documentation>

    Enables or disables tooltips.

    </xs:documentation>

    </xs:annotation>

    <xs:simpleType>

    <xs:restriction base="xs:string">

    <xs:enumeration value="on" />

    <xs:enumeration value="off" />

    <xs:enumeration value="delay" />

    </xs:restriction>

    </xs:simpleType>

    </xs:attribute>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="FuncKey" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" default="0">

    <xs:annotation>

    <xs:documentation>

    Specifies the func-key to be used by Emulator.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    <xs:element name="Board">

    <xs:annotation>

    <xs:documentation>

    Defines the configuration of the emulated motherboard.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:sequence>

    <xs:element name="OSImage">

    <xs:annotation>

    <xs:documentation>

    Specifies the file name of the OS image file (.bin or .nb0) as the inner text.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="Address" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Specifies the base address to load the OS image file at, if it is .nb0 format.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="Flash">

    <xs:annotation>

    <xs:documentation>

    NAND Flash settings. The optional inner text specifies the flash-memory storage filename.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="MemSize" type="xs:nonNegativeInteger" minOccurs="0" maxOccurs="1" default="64">

    <xs:annotation>

    <xs:documentation>

    Sets emulated RAM size, where size is in megabytes.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="CpuCore" type="xs:string" default="armv4">

    <xs:annotation>

    <xs:documentation>

    Specifies the cpu core type. An unknown value means armv4

    </xs:documentation>

    </xs:annotation>

    <xs:simpleType>

    <xs:restriction base="xs:string">

    <xs:enumeration value="armv4" />

    <xs:enumeration value="armv5" />

    <xs:enumeration value="armv6" />

    <xs:enumeration value="armv7" />

    </xs:restriction>

    </xs:simpleType>

    </xs:element>

    <xs:element name="CpuOptions" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Specifies what CPU features to enable.

    </xs:documentation>

    </xs:annotation>

    <xs:simpleType>

    <xs:restriction>

    <xs:enumeration value="e"/>

    <xs:enumeration value="E" />

    <xs:enumeration value="M" />

    <xs:enumeration value="m" />

    </xs:restriction>

    </xs:simpleType>

    </xs:element>

    <xs:element name="vfp" type="xs:boolean" default="false">

    <xs:annotation>

    <xs:documentation>

    Specifies whether VFP is enabled or not

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:complexType>

    </xs:element>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    <xs:element name="Peripherals">

    <xs:annotation>

    <xs:documentation>

    Defines the configuration of the emulated peripheral devices.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:sequence>

    <xs:element name="Battery" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Battery/AC configuration.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:sequence>

    </xs:sequence>

    <xs:attribute name="Charge" type="xs:nonNegativeInteger" default="100">

    <xs:annotation>

    <xs:documentation>

    Emulated battery charge percentage.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="IsOnACPower" type="xs:boolean" default="true">

    <xs:annotation>

    <xs:documentation>

    Set to "true" to run on AC, or "false" to run on battery.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="SerialPort" minOccurs="0" maxOccurs="3">

    <xs:annotation>

    <xs:documentation>

    Maps a guest serial port to a Windows serial port.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="UARTNumber" type="xs:nonNegativeInteger">

    <xs:annotation>

    <xs:documentation>

    Guest serial port number (0-2).

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="SharedFolder" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Mounts the directory specified in the inner text as a storage card. A empty string specifies disable folder-share.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="CS8900_Networking" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Configures the emulated CS8900 network card. The optional inner text specifies the host MAC address to bind to.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="EnableNetwork" type="xs:boolean" default="true">

    <xs:annotation>

    <xs:documentation>

    Enables or disables the emulated CS8900 network card.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="Enabled" use="optional" default="true" type="xs:boolean" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="false" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="NE2000_Networking" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Configures the emulated NE2000 PCMCIA network card. The optional inner text specifies the host MAC address to bind to.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:simpleContent>

    <xs:extension base="xs:string">

    <xs:attribute name="EnableNetwork" type="xs:boolean" default="true">

    <xs:annotation>

    <xs:documentation>

    Enables or disables the emulated NE2000 network card.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean " fixed="true" use="optional" />

    </xs:extension>

    </xs:simpleContent>

    </xs:complexType>

    </xs:element>

    <xs:element name="HostOnlyNetworking" type="xs:boolean" minOccurs="0" maxOccurs="1" default="false">

    <xs:annotation>

    <xs:documentation>

    Sets host-only routing for network packets.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional" />

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    <xs:element name="Speakerphone" minOccurs="0" maxOccurs="1">

    <xs:annotation>

    <xs:documentation>

    Configures the speakerphone emulation.

    </xs:documentation>

    </xs:annotation>

    <xs:complexType>

    <xs:sequence>

    </xs:sequence>

    <xs:attribute name="Speakerphone" type="xs:boolean" default="false" />

    <xs:attribute name="CarKit" type="xs:boolean" default="false" />

    <xs:attribute name="Headset" type="xs:boolean" default="false" />

    <xs:attribute name="Enabled" type="xs:boolean" default="true" use="optional"/>

    <xs:attribute name="Reconfigurable" type="xs:boolean" fixed="true" use="optional" />

    </xs:complexType>

    </xs:element>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    </xs:schema>

     

  • What's new with Device Emulator V3 Beta

    As you are aware Visual Studio "Orcas" Beta1 just released few days back. Here's Soma's blog http://blogs.msdn.com/somasegar/archive/2007/04/19/visual-studio-orcas-and-net-fx-3-5-beta1-shipped.aspx which contains link to dowload Visual Studio "Orcas" Beta1. With Orcas beta1, Device Emulator V3 Beta was packaged.

     During Device Emulator V3, we tried to focus on the automation and manageability aspect. Following are the list of features we introduced in V3. In future blog posts, i'll go through each of them in detail and explore various scenarios in which you can make use of these.

    1. Corecon Lite:-  Do you have custom emulator configurations and custom images which you want to see in Device Emulator Manager and get all the benefits of Device Emulator Manager - like Cradling, then this is the feature you would be interested in. In addition you can make use of this capability even if there is no Visual Studio installed - so your custom images are visible in DEM with the added benefits of following features.

    2. Automation Interfaces:- Did you ever wished that there are APIs using which you can perform various tasks as is done by Device Emulator Manager? Automation Interfaces is the feature which adds this capability - it exposes the functionality provided by DEM through various APIs, so you can browse through the list of emulators available to you and perfom various tasks like Connect, Cradle, Reset, Shutdown, Reconfigure, Save configuration of an emulator. This API becomes very powerful tool when you use this in association with RAPI (http://msdn2.microsoft.com/en-us/library/aa458022.aspx), so you can effectively write you own test automation framework.

    3. Dynamic Reconfiguration:- File->Configure dialog in emulator provides some capability where you can modify the emulator configuration or guest OS properties but that is totally a manual operation or you write framework using SendKeys (which may not be reliable). With V3, we have added API as well in DEM UI functionality using which you can save the configuration of an emulator, modify it according to your needs and apply it to the emulator. Let us say you wanted to test your application behavior in various battery conditions - and write automation for it - you can save the configuration of the emulator, enable battery and set the charge and then apply this to Device Emulator (all using API...:)), and then monitor your application behavior. In addition, you can save the configuration of the emulator and create an altogether different emulator by modifying this configuration in association Coreconlite feature discussed above - so you can have five different emulator configurations equivalent to 5 different devices in Device Emulator Manager view (as well as through API interface).

     So stay tuned on detailed discussions on these new features.

    And as always you feedback is pretty important to us - please keep the comments coming and we'll trying our best to make sure you derive best of capabilities and productivity boost out of Device Emulator. In addition, please report any issues you find through Microsoft Ladybug system http://connect.microsoft.com/site/sitehome.aspx?SiteID=210

     Namaste.

    Mohit Gogia

    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Device Emulator V2 is released

    Device Emulator V2 is just released at http://www.microsoft.com/downloads/details.aspx?FamilyID=dd567053-f231-4a64-a648-fea5e7061303&displaylang=en. This release contains a set of new exciting features

    • Runtime binding of NE2000 card.
    • Speakerphone, headset and carkit support.
    • Battery support.
    • Much improved JIT performance.
    • Vista cradling support.
    • And many more small fixes.

    Cradling with Vista:- To be compatible with the new Windows Mobile Device Center in Windows Vista (known as ActiveSync on Windows XP), we have taken a redesign of our DMA plugin (SerDMAASPlugin.dll). Before you cradle your emulator on Vista, you will need to install the Windows Mobile Device Center application (select the 32-bit or 64-bit version, as appropriate).

    Cradling on Vista x64 systems:- This release has cradling issues on Vista x64 systems. We are working in full steam to release a patch very soon for the same.

    We are waiting to hear your feedback on the release.

     -Mohit

     

  • VMNet driver not working with Device Emulator

    I have seen many people hitting into issues where they had installed VMNet driver but it is not working - device emulator complaining it's absence. I found this good blog posted by Virtual PC team which points few things to try out http://blogs.msdn.com/virtual_pc_guy/archive/2007/01/15/fixing-broken-virtual-networking.aspx.

    Hopefully this should solve your Device Emulator networking issues.

  • How to Get Command line to device emulator

    A lot of time you must be interested in finding out the full command-line using which Visual Studio launches the device emulator. I find this utility to be very handy to find out the same http://win32.mvps.org/processes/remthread.html.

     

    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Build Error with Device Emulator BSP and Windows CE6.0

    I found this build failure problem for Device Emulator BSP reported by a customer on some forum. Thanks to Dean Ramsier for posting the solution.

    Issue:-

    If you cloned Device Emulator BSP with WinCE6.0 to say MyBSP and getting error like "Can't find kitl.dll"  then you are probably hitting into this issue. The cloning tool has a bug and is not renaming a file DeviceEmulator-preri.bat to MyBSP-preri.bat in MyBSP\files directory. Although this is an optional file but device emulator build depends on it.

    Fix:-

    The fix is simple just to rename DeviceEmulator-preri.bat in MyBSP\files directory to MyBSP-preri.bat.

    Hopefully this will work.

  • Windows Mobile 5.0 MSFP Images for Device Emulator

    Windows mobile 5.0 images for Device Emulator released at http://www.microsoft.com/downloads/details.aspx?FamilyID=c62d54a5-183a-4a1e-a7e2-cc500ed1f19a&displaylang=en

    Quickly grab a copy now.

    -Mohit

  • Introduction

    My name is Mohit Gogia and i am part of R&D team as developer at Microsoft India Development Center at Hyderabad. My posts will be oriented towards Device Emulator shipped with Visual Studio 2005 and as a standalone release.

    You can grab V2 CTP of the emulator from http://www.microsoft.com/downloads/details.aspx?FamilyId=13F5DE85-30CD-4506-9C5B-A2068FA1EE9E&displaylang=en

    Please feel free to drop your suggestions to me. Also questions can be posted at http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=76&SiteID=1

    -Thanks,

    Mohit

  • Visual Studio 2005 Device Emulator and Webservice

    I have seen few people finding difficulties with the testing their web service with the device emulator. In the following we will

    1. Create a simple "Hello Mobile" web service using Visual Studio 2005.

    2. Create a smart-device application that will access this web service from Device Emulator.

    "Hello Mobile" web service using Visual Studio 2005

    Visual Studio 2005 has made life luxurious for developers. It is really very simple to create an ASP.NET web service using Visual Studio 2005.

    1.      Go to menu File->New->Web Site in Visual Studio 2005. It will open up a dialog as shown following. Select the ASP .NET Web Service and in the "Language" drop-down select your preference language. I will select Visual C# as my preference language.

    2.      Now click OK. This will create the web service and open up a App_Code\Service.cs file. I will modify the HelloWorld method in this file to return string “Hello Mobile”. Now in the solution explorer, right click on the website solution and click “Build Web Site”

    3.      From the solution explorer, right click on the web-site project and select “View in Browser”. This will start the ASP .NET development server and opens in Internet explorer directory listing. For me the Root URL to the service is http://localhost:1607/WebSite12. This will differ for you.

    Now we are ready with a “Hello Mobile” web service. We will create a smart-device application from which we will access this web service.

    Smart-device application to access the “Hello Mobile” web service

    1.      In the Solution Explorer, right click on the solution and select Add->New Project. Now create a Visual C# Smart Device application.

    2.      Now we will add a button to the form-designer using tool-box as shown following.

    3.      Double click on the button in the form-designer window; this will take you to event handling code for the button click.

    4.      Now right click on the Device Application in solution explorer and click “Add Web Reference”. In the “Add Web Reference” dialog, select “Web Services in this solution”; it will show the web service we created above. Select it and click on the “Add Reference” button.

    5.       Now add following code to access the web service, so that I get a MessageBox with the string from the web service. Note the gocha in the Url, it refers to your machine name and not localhost as was used when accessing web service from desktop.

               localhost.Service service = new DeviceApplication1.localhost.Service();
                service.Url = "http://<machine name>:1607/WebSite12/Service.asmx";
                string str = service.HelloWorld();
                MessageBox.Show(str)

    6.       Using the Tool->Connect to Device, start PPC 2003 SE emulator. Also Cradle it using Device Emulator Manager. Set the Device Project as the start-up project. Use F5 to deploy and run the application on PPC 03 SE.

    7.       Now in the application in PPC 03 emulator, click on the button and it pops up a message box with the string “Hello Mobile” returned from web service.

     


© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker