WP7

For the purposes of this exercise, the program instance you create will:

  • Register itself to the Linxter ISB
  • Retrieve its configuration settings
  • Activate itself
  • Create a communication channel request to itself and automatically accept it
  • Send a message (to itself)
  • Receive a message back from the ISB
  1. You will need to download the Linxter SDK before you can begin this section. You will also need to download the Hello World solution.
  2. Next you will need to download the preconfigured database file for your program, as well as copy your program's Activity ID (assigned when you registered it to the ISB).
  3. Open Visual Studio.
  4. Open your Hello World solution. Be sure to have your Solution Explorer view open (View – Solution Explorer)
  5. Click Add Reference as illustrated below and add the LinxterSDK.WP7.dll (found in your Linxter SDK download).

  6. Next, set the Copy Local property to True as illustrated below.
  7. Now, add the preconfigured database you downloaded for your Program to this project. Copy it into the project, click the “Refresh” icon, and then the “Show All Files”.
  8. Right click the “LinxterSDKDB” file and select “Include In Project”.
  9. Right click the “LinxterSDKDB” file again and select “Properties”, and change the“Build Action” to “Resource”
  10. You will now need to open the MainPage.xaml.cs file and replace the ActivityId string value with the Activity ID assigned to your program when you registered it to the ISB.
  11. You are now ready to run your Hello World program. Running the program will open the Windows Phone 7 Emulator.

    Sending and Receiving Messages

    Scheduled sending and receiving are automatically enabled when instances of your program are running. All of the timing code for the scheduled sending and receiving is taken care of for you within the SDK. The settings for these events can be dynamically updated through Web Manager. Sending and receving messages is asynchronous and non-blocking to your program. This means your program instance can keep on doing what it is doing and not worry about getting hung while processing a send or receive operation.

    Optional: In your code, you can also send and receive on-demand using the SendNow() and ReceiveNow() method calls.

  12. When your program instance receives a message back from the ISB, it will display the message that was sent to it.
  13. That’s it! You have now created your first Linxter enabled program, and sent and received a message over a secure, reliable, dynamic communication channel.
  14. When you run your program again, it will be faster because it does not need to register itself onto the Linxter ISB and retrieve its settings.

You can have Hello World send multiple messages to itself. However, if you want to experiment with message sending and retrieval speed, check out our open source Performance Tester.