Basic4PPC and Windows Mobile Emulator

Discussion in 'Tutorials' started by ghale, Aug 8, 2009.

  1. ghale

    ghale Active Member Licensed User

    During the development of your project, you can try directly from Basic4PPC IDE (hitting the F5 key or pressing the Run icon in toolbar) if your application is working good.
    But at a certain stage, you need to try your code on a Device. To do this, you need a Device ;), then!

    But... if you plan to develop your application for a VGA device and you have a QVGA one?
    You can buy a new device or you can always compile your exe with "Device (Auto scale)" option, but sometimes it's better to try your creation on a VGA device.
    Another example: if you need different type of Devices, with different screen resolution or different OS, and you can't efford them, what you have to do?

    You must use an Emulator.

    In this tutorial, I'll show you what to do.

    To begin, simply open your Firefox (or Opera, or Safari, or Exploder), and in the address bar, go to Google (or to another search engine).

    Then, search for "Windows Mobile 6.5 Developer Tool Kit" string.
    One of the first results, will be this address located on Microsoft servers.

    [​IMG]


    On that page, you'll find localized versions of Windows Mobile 6.5 Professional Developer Tool Kit and Windows Mobile 6.5 Standard Developer Tool Kit.


    [​IMG]

    Yo can download a localized version of emulator.
    Actually, these are the locale supported:

    I'll download, for example, the Windows Mobile 6.5 Professional Developer Tool Kit, USA version (225 MB).
    Please consider to use a download manager to download faster the files.

    Once downloaded the file, simply double-click on it and click Next

    [​IMG]

    and then Accept.

    Note: If the install fails with "Setup Wizard ended prematurely" message, install the Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) and restart the Windows Mobile 6.5 Developer Tool Kit package install.

    Click on Next, then on Next again, select the path where to install emulators (or leave the default one), click Next.

    [​IMG]

    Click on Install and the installation will start.

    [​IMG]

    After few minutes, the installation will finish, with this screen:

    [​IMG]

    Click on Finish.

    In your Programs, you'll find "Windows Mobile 6 SDK" group folder.
    You can choose "Standalone Emulator Images" -> language of emulator (for me "US English") -> and then the emulator you want to run.
    I'll choose "WM 6.5 Professional".

    The first run is a bit slow, because the emulator ... emulates a first start of the device.

    [​IMG]

    then, finally:

    [​IMG]

    While the device emulator starts, you can prepare the folder that will be the Storage Device for the emulator.

    Somewhere on your disk, for example on Desktop, create a folder named "WM_Shared", then in the Emulator window choose "File" -> "Configure".

    [​IMG]

    In the first tab, "General", at the bottom click on the "..." button and browse to the folder you just created on Desktop.

    [​IMG]

    Then click Ok.

    Now, you can use the Emulator like a real device.

    From Basic4PPC, simply compile the exe from your project (Alt+1) and choose as destination folder the "WM_Shared" created on the Desktop and click on Save.

    [​IMG]

    On the Emulator, go to File Explorer and browse to "Storage Card".

    [​IMG]

    Here you'll find your just compiled exe, as shown:

    [​IMG]

    Click once on it and you'll execute your application:

    [​IMG]


    [​IMG]

    Obviously you can create CAB files and test it on your new device!

    You can connect and sync the emulator with ActiveSync (for Windows XP or earlier) or Windows Mobile Device Center (for Vista).
    To accomplish this, simply run from your Programs -> "Windows Mobile 6 SDK" -> "Tools" -> "Device Emulator Manager"

    [​IMG]

    If you are running the emulator and you cannot find any running session, click on Refresh.

    Then, right-click on the active connection and choose "Cradle" or from "Actions" menu, choose "Cradle".

    [​IMG]

    After few seconds, the ActiveSync or Windows Mobile Device Center, will connect with your emulator.

    [​IMG]

    Note:
    If ActiveSync don't see the emulator, please assure that you choose DMA setting from "ActiveSync" -> "Connection Settings"
    If Windows Mobile Device Center don't see the emulator, please assure that you choose DMA setting from "Mobile Device Settings" -> "Connection Settings"

    Note:
    It's a good choise to check "Allow data connections on device when connected to PC" in ActiveSync or Windows Mobile Device Center.

    Now, let's connect Windows Mobile Emulator and Cellular Emulator!

    Thanks to:
    derez, Erel

    TutorialsEnjoy, ghale
     
    Last edited: Aug 11, 2009
  2. derez

    derez Expert Licensed User

    Thank you ghale for this tutorial, although I use emulators for a while - I did learn something.

    I want to add that you can connect the emulator to the desktop via Activesync just like a real device.
    you do that by selecting: windows mobile SDK --> tools --> Device emulator manager. Do Refresh and when the device appears in the window - select : Action --> "Cradle" and wait for the connection.
     
    Last edited: Aug 9, 2009
  3. ghale

    ghale Active Member Licensed User

    Yes, derez, you anticipated me.
    I was preparing the update for this thread.
    I'll put online soon the actions to connect to Activesync (XP) or Syhcronization Center (Vista).

    Thanks!
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Thank you for this great and useful tutorial! :sign0098:
     
  5. RiskFour

    RiskFour Member Licensed User

    Hi ghale,

    thanks for the nice work...
     
  6. ghale

    ghale Active Member Licensed User

    :)

    I'm preparing two other tutorials about emulators, I'll create two distinct thread for them, but I'll "link" all three thread togeter.
     
  7. ghale

    ghale Active Member Licensed User

    I've just added more images and fixed something.
     
  8. mjcoon

    mjcoon Well-Known Member Licensed User

    Hi ghale and thanks for a very useful tutorial. I have been using the WM5.0 emulator successfully for a while now.

    But I would like to try with different screen sizes though the emulator comes with only the basic displayWidth="240" displayHeight="320".

    I don't think that you have mentioned getting other screen sizes; could you extend the tutorial to cover this?

    Cheers, Mike.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    The device emulator manager should list several devices including a QVGA, Square and VGA devices.
     
  10. mjcoon

    mjcoon Well-Known Member Licensed User

    But it most definitely does not! In fact it seems the only things it can list at start-up are the saved images that I have made myself when running the emulator. The "Available Emulators" window just shows "Others" and really seems to list the emulator instances that are running, not the configurations that I might choose.

    But as I said I am running the WM5.0 emulator and the Emulator Manager says it is version 8.0.50727.42.

    If I have to download WM6.n to get a choice of devices (per ghale's actual instructions) then I might do that, but it's not trivial! I didn't want to try without someone saying that's why I get the limitation.

    Mike.
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    You should download a WM6.1 or 6.5 emulator. It will include several screen sizes.
     
  12. mjcoon

    mjcoon Well-Known Member Licensed User

    Thanks Erel, I've done that and tried out my Music Player (autoscale compiled) with a VGA emulator screen successfully...

    Cheers, Mike.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice