Error installing Cocoapods: xcrun: Error: could not stat active Xcode path…

In a recently purchased Apple Mac Mini, I proceeded to setup my iOS and Mac OS X developer tools & documentation. Although the tools installed fine and I could carry on working with my existing projects, when I choose to install Cocoapods, I encountered the following error -

Screen Shot 2013-04-19 at 12.43.42 AM

The nature of the error suggested an issue with the path of Xcode. A quick search in Google revealed a number of useful posts in Stackoverflow, the most relevant post suggested using xcode-select to force the correct path of Xcode.app to be used for Cocoapods installation. I proceeded to install the command line tools for Xcode followed by xcode-select and attempted to install Cocoapods. This time, the Cocoapods installation was quick and successful -

Screen Shot 2013-04-19 at 12.42.44 AM

Hope this helps someone else!

DeveloperDeveloperDeveloper! Sydney 2012 Roundup

I had the opportunity to attend the Developer, Developer, Developer Sydney event today (30/June). Other than catching up with people I only met on Twitter (David Burela, John Bristowe, Nick Hodge), catching up with people I have met before (Nick Randolph, David Glover, Brendan Forster, Jose Fajardo) and making new contacts, my main interest was in learning more about Windows 8. I attended sessions focussing on Windows 8 & Windows Azure and Microsoft ASP.NET Web API. Here is a summary of the sessions I attended today, they were all awesome!
Bring your Windows 8 Apps to Life with Push Notifications using Windows Azure by Nick Harris (@cloudnick)

Nick presented on building a Windows 8 C#/XAML application connected to the web. He built a Windows 8 app that used the camera (a webcam connected to his laptop) to take a photo, upload it to Windows Azure & stored as a blob, added geo-location to the photo with a map highlighting where the photo was taken and finally demonstrating how easy it was to implement Tile and Toast Notifications in Windows 8 applications (along with resizing the uploaded photo to fit within a tile). In tandem with the Windows 8 application was a Microsoft ASP.NET Web API application performing tasks such as uploading a photo to Azure Blob Storage, setting up push notifications, etc. Nick showed how to use Shared Access Signature to implement a simple yet powerful access policy for blob storage. Nicks’ talk (silides, recorded video and code) is available for download from - http://www.nickharris.net/2012/06/building-connected-windows-8-apps-with-windows-azure/

Some links relevant to Nick’s talk -

WindowsAzure.Notifications - https://nuget.org/packages/WindowsAzure.Notifications
Windows8.Notifications - https://nuget.org/packages/Windows8.Notifications
WNSRecipe - https://nuget.org/packages/WnsRecipe


ASP.NET Web API – From Web to REST in 60 minutes
by Paul Glavich (@glav)

Paul took everyone in a journey through Microsoft’s new ASP.NET Web API. ASP.NET Web API is Microsoft’s attempt to help developers build RESTful APIs with ASP.NET MVC a breeze. Gone are the days when decorating controller methods with “HttpGet”, “HttpPost”, etc was necessary. Paul explained model binding, action parameters, authorization, logging, documenting an API and also building a task parallel API. The 60 minute talk was full of many takeaways! Pauls’ talk is available online from – http://webapidemo.azurewebsites.net, the source code for the talk is available at - https://bitbucket.org/glav/glav.webapidemo. Couple of recent posts by Paul on ASP.NET Web API are really cool, go check them out now!

Some links relevant to Paul’s talk -

ASP.NET Web API – http://www.asp.net/web-api
Getting started with ASP.NET Web API - http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api

Using non Microsoft JS frameworks with Windows 8 by Nick Hodge (@NickHodgeMSFT)

Nick presented a no nonsense, no slide-deck, code only talk on building a Windows 8 app using Javascript and HTML. He showed how the power of Javascript could be used to build a Windows 8 app that functioned like a traditional “desktop” app in existing/older version of Windows. Nick then demonstrated an application built with Rafael Javascript library. John Bristowe then presented on Telerik’s Metro control suite. A great session, with lot of participation from the audience.

Some links relevant to Nick & Johns’ talk -

Rafael Javascript Library - http://raphaeljs.com/
Telerik RadControls for Metro - http://www.telerik.com/products/windows-metro.aspx


Windows 8 Development 101: The basics of XAML and ViewModels
by David Burela (@DavidBurela)

David presented on MVVM & ViewModels and how they can used to build a Windows 8 application. In the last 15 minutes, David demonstrated how easy it is to implement internationalization in a Windows 8 application, very cool! David is a regular presenter in various seminars, user groups and conferences, go check out his blog at http://davidburela.wordpress.com/


What I learnt flying BoxKites  My story of Flying with Windows 8
by Brendan Forster (@shiftkey)

Brendan presented on his experiences on building ‘BoxKites’, a Windows 8 application parts of which will be open-sourced soon. The talk covered the basics on editing a copy of a XAML template, adding icons, testing and certification, etc. Overall a very informative and in-depth talk. Contents of the talk is available at - https://github.com/shiftkey/dddsydney

Some links relevant to Brendan’s talk -

BoxKits.Notifications - http://shiftkey.github.com/BoxKite.Notifications/
SyncFusion MetroStudio - http://www.syncfusion.com/downloads/metrostudio

Build a touch first mobile enterprise app using Metro WinJS & MVC by Cassandra Buono (@CBuono)

In the final talk of the day, Cassandra presented on building a Windows 8 Metro application with WinJS and HTML using the MVC pattern in Javascript. First part of the talk covered the UI design of the application in depth, very useful for developers starting on Metro design. Next part of the talk was on using the mydigitalstructure API to build an ERP application. A comparison of jQuery and WinJS and how web development skills can be leveraged to build a Windows 8 Metro app were key takeaways from the talk. Code and presentation from the talk will be available at - http://mydigitalstructure.com/metro.

Some links relevant to Cassandra’s talk -

mydigitalstructure API signup – http://mydigitalstructure.com/gettingstarted_signup

 

 

To wrap up the event on a high note, I was one of the recipients of a Telerik Ultimate collection from a lucky draw! Thank you Telerik and David for the prize. Lewis and his team did a phenomenal job of organizing and running the event. DDD Sydney (and hopefully other cities) will be in my list of “to attend” events.

I have had a hiatus from blogging. While I have been silent, I have worked extensively on building connected applications with Windows Azure & SQL Azure for mobile applications that run on Apple iOS, Google Android and Windows Phone 7. With an explosive June (Azure, Surface, Windows Phone 8, iOS 6, Android announcements), I aim to blog often staring with this post.

Windows Phone Developer Tools RTM

The Windows Phone 7 developer tools went RTM (Release to Manufacturing) today. This release includes

  • Visual Studio 2010 Express for Windows Phone 7
  • XNA Game Studio for Windows Phone 7
  • Expression Blend 4 for Windows Phone 7
  • Windows Phone 7 Emulator

Go ahead and download them now! In addition to the developer tools, the Silverlight toolkit for Windows Phone 7 was also released today, they can be downloaded here. Microsoft has also released the Mobile Advertising SDK for use within apps to generate revenue.

The Windows Phone 7 Training Kit for Developers has been refreshed for the RTM release, it is available for download here.

Some useful blog posts announcing the release are -

Updgrading Windows Phone 7 projects developed with Beta/CTP tools

All Windows Phone 7 applications developed with the Beta or CTP tools need to be upgraded & compiled with the release tools before submission to the Windows Phone Marketplace. Applications prepared with Beta or CTP tools submitted to the marketplace will fail application certification. There are no breaking changes from the Beta tools release. The release notes (Pete Brown’s post has a nice summary & details) lists the changes.

New Controls in the Developer Tools Release

There are three new controls in the developer tools release -

  • Panorama control – Useful for building an application’s “Home” screen.
  • Pivot control – Useful for building views that show filtered data.
  • Bing Maps control – This control can be used to add a map to your application, it has a free commercial license.

Silverlight controls toolkit for Windows Phone 7

The Silverlight toolkit for Windows Phone 7 has been released with full source with MS-PL license. Tim Heuer’s post and David Anson’s post discuss in detail the controls that are available in the toolkit. Here is a list of the controls -

  • ContextMenu and ContextMenuService
  • DatePicker and TimePicker
  • ToggleSwitch
  • WrapPanel
  • GestureListener and GestureService
  • WrapPanel -

There is a sample application built with the Silverlight toolkit available here, it shows how the controls can be used in an application. John Papa talks to Kirupa Chinnathambi in this Channel 9 video where a Bing web and image search application is build by only using Expression Blend. The application uses the WrapPanel, Panorama and Pivot controls with the Bing search API.

Uninstalling the Beta Tools and Installing the RTM tools

The Beta tools can be uninstalled through “Programs and Features” item in the Control Panel (Windows 7), selecting the “Microsoft Windows Phone Developer Tools Beta – ENU”, right-click and select Uninstall.

Uninstall Beta Tools

The RTM developer tools can be installed with the online installation tool available here. The ISO of the developer tools is available here. The online installer detects installed Visual Studio tools and downloads & installs the right set of tools required for Windows Phone 7 development.

I will be updating the ListBox pagination post to work with the RTM tools. I am working on a number of Windows Phone 7 applications that are user-centric, with a focus on using the applications in the phone as a companion in the user’s daily activities.

Windows Phone 7 ListBox Pagination with MVVMLight & ApplicationBar

I am currently working on a Windows Phone 7 application where MVVMLight forms the foundation of the application. In a certain part of the application, I have the following requirements -

  1. Items in a ListBox to be loaded on demand by the user, with the user having the ability to paginate through the ListBox.
  2. The page number the user is currently viewing should be displayed in the page.
  3. The application requires a “First Page”, “Next Page” and a “Previous Page” button.
  4. While viewing the first page, the “First Page” and “Previous Page” buttons are disabled.
  5. When the user clicks the “First Page” button & arrives at the first page of the list of items, the “First Page” & “Previous Page” button are disabled.
  6. While browsing through the list of items with the “Previous Page” button, the “First Page” and “Previous Page” buttons are disabled when the user at the first page of the list of items.
  7. The application must show an “application is busy” indicator while data  is being loaded after a button is clicked.

In the process of implementing these requirements & building the application, I learned a lot about MVVM pattern and its usage in an application with MVVMLight. In this post, I illustrate how these requirements can be implemented using MVVMLight. I will use a sample data source (Netflix OData Catalog) to illustrate how I implemented these requirements. Please feel free to comment on the post and the source code (available for download below). Please note that I have used Laurent Bugnion’s MVVMLight Windows Phone 7 project templates (with the WP7 hotfix applied) to develop this sample. I generated the proxy class for the Netflix OData services and followed the steps in Shawn’s OData post. More Windows Phone 7 development resources are available here.

Initial attempt to implement the requirements

My initial attempt to implement these requirements was to wrap the ListBox in a UserControl and add a panel with three buttons required for pagination through the ListBox. However, after reading the user interface guidelines and going through a bunch of design considerations, I decided to use the ApplicationBar to place the ListBox pagination buttons.I went ahead with the plan and added the icons and the three buttons -

The biggest challenge in implementing this requirement using the ApplicationBar is that it is not a Silverlight element and hence binding its properties and events is not possible through the view’s XAML (For a detailed explanation, read Peter Torr’s post – “Why are ApplicationBar objects not FrameworkElements?“). Laurent Bugnion proposes a neat way of binding RelayCommands in the ViewModel through the click events of the button and menu item of ApplicationBar. This approach fulfilled my requirement of binding the click event of the buttons in the ApplicationBar. However, to implement the requirements  #4, #5 & #6 above, I had to bind the “IsEnabled” property of the “ApplicationBarIconButton” to the ViewModel. My first attempt at implementing these three requirements was to check the “PageNumber” property of the ViewModel and set the “IsEnabled” property through the Click event handler of the “ApplicationBarIconButton” -


private void FirstButton_Click(object sender, System.EventArgs e)
{
   var vm = DataContext as MainViewModel;
   if (vm != null)
   {
      vm.GetFirstPage.Execute(null);
      UpdateMenuButtons(vm);
   }
}

public void UpdateMenuButtons(MainViewModel vm)
{
   if (vm)
   {
      if (PageNumber == 1) // ViewModel DependencyProperty
      {
         ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = false;
         ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = false;
      }
      else
      {
         ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = true;
         ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = true;
      }
   }
}

A refinement of the above approach

This approach just works fine, however, I didn’t like the fact that the View was tightly coupled to the ViewModel. I spent some time investigating patterns to decouple the View from the ViewModel & Laurent kindly pointed out a nice way to decouple the View from the ViewModel (read his suggestion here). This is how I implemented it -


public MainPage()
{
   InitializeComponent();
   var vm = DataContext as MainViewModel;
   if (vm != null)
   {
     SetBinding(IsUserInFirstPageProperty, new System.Windows.Data.Binding("IsFirstPage") { Source = vm });
   }
}

public bool IsUserInFirstPage
{
   get { return (bool)(GetValue(IsUserInFirstPageProperty)); }
   set { SetValue(IsUserInFirstPageProperty, value); }
}

public static readonly DependencyProperty IsUserInFirstPageProperty =
   DependencyProperty.Register("IsUserInFirstPage", typeof(bool), typeof(MainPage),
          new PropertyMetadata(new PropertyChangedCallback(OnIsFirstPreviousButtonEnabledChanged)));

private static void OnIsFirstPreviousButtonEnabledChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
{
   MainPage m = (MainPage)o;
   m.UpdateMenuButtons(null);
}

public void UpdateMenuButtons()
{
   if (IsUserInFirstPage)
   {
      ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = false;
      ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = false;
   }
   else
   {
      ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = true;
      ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = true;
   }
}

With this approach, the View is no longer tightly coupled with the ViewModel.

Adding a ProgressBar

I decided to use Jeff Wilcox’s PerformanceProgressBar (discussed in detail in this blog post). The progress bar is added in “MainPage.xaml” through the following XAML -


<ProgressBar
    HorizontalAlignment="Center"
    VerticalAlignment="Center"
    Width="400"
    IsIndeterminate="{Binding IsProgressBarVisible}"
    Style="{StaticResource PerformanceProgressBar}"
    Visibility="{Binding IsProgressBarVisible, Converter={StaticResource performanceProgressBarVisibilityConverter}}" />

Note that the progress bar style is added to the application resources in “App.xaml”. The progress bar should be visible when the Netflix OData endpoint is queried and must be invisible after data has been loaded. In order to accomplish this, I have used a dependency property on the ViewModel -


   // Do we show the progress bar?
   public const string IsProgressBarVisiblePropertyName = "IsProgressBarVisible";

   private bool _isProgressBarVisible = true;

   public bool IsProgressBarVisible
   {
      get
      {
         return _isProgressBarVisible;
      }
      set
      {
         if (_isProgressBarVisible == value)
         {
            return;
         }
         var oldValue = _isProgressBarVisible;
         _isProgressBarVisible = value;

         // Update bindings and broadcast change using GalaSoft.MvvmLight.Messenging
         RaisePropertyChanged(IsProgressBarVisiblePropertyName, oldValue, value, true);
      }
   }

This “IsProgressBarVisible” property is updated before the query on the Netflix OData endpoint is issued and after the query completes & the data has been updated in the ListBox -


private void UpdateCatalog()
{
   if (IsInDesignMode) // Create design time data for Blendability
   {
      Titles = new ObservableCollection<Title>();
      for (var index = 0; index < 20; index++)
      {
         var title = new Model.Title
         {
            Name = "Loboris adiptis",
            ShortSynopsis = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu"
         };

         Titles.Add(title);
      }
      CurrentPage = 1;
   }
   else
   {
      IsProgressBarVisible = true;

      NetflixCatalog _catalog = new NetflixCatalog(new System.Uri("http://odata.netflix.com/catalog"));
      var query = _catalog.Titles.Where(t => t.Rating == "PG").OrderByDescending(t => t.AverageRating)
                          .Skip((CurrentPage - 1) * 20) // 20 items to skip
                          .Take(20); // 20 items to fetch
      var dsq = query as DataServiceQuery<Title>;
      dsq.BeginExecute(
            (callback) =>
            {
               var results = dsq.EndExecute(callback);
               DispatcherHelper.CheckBeginInvokeOnUI(() =>
               {
                  Titles.Clear();
                  foreach (var item in results)
                  {
                     Titles.Add(item);
                  }
                  IsProgressBarVisible = false;
               });
            }, null);
    }
}

Alternative approach

Nicolas Humman recently published a post where he showed how to wrap the ApplicationBar into a control to provide binding through XAML. While this alternative approache may be suitable for my requirements, I didn’t feel confident that wrapping a non-FrameworkElement into a control is considered good practice.

Summary

In this post, I have highlighted a few key points that a Windows Phone 7 developer may encounter while s/he develops an application -

  • Data and Event binding through XAML, minimum code-behind approach.
  • Blendability – allows designers to work independent of the developer. (Note that in my approach, I have constructed the design-time data in code-behind, an alternative is use XAML provide design-time data.)
  • Decoupling of Views and ViewModels.
  • Usage of ApplicationBar for navigating through pages in a ListBox.
  • Usage of PerformanceProgressBar and applying the IsIndeterminate property.

Resources I have referred while working with MVVM & MVVMLight on Windows Phone 7 -

This post does not illustrate –

  • Dependency injection and is usage in ViewModelLocator (@kellabyte has two excellent posts that illustrate how to use NInject and MEF to use dependency injection in ViewModelLocator).
  • Data virtualization best practices (Peter Torr’s post & Shawn Oster’s post are good references for this).
  • Unit testing and testability of a Windows Phone 7 application.

Source Code

The source code for this sample application is available here. Please rename the file to .zip and uncompress.

Screenshots


Quick tip – Set the correct time in Windows Phone 7 emulator

I have been working on building a Windows Phone 7 application that retrieves JSON data from a popular programming community site (Blog post and app source coming soon). I wrote a time span converter and used it to bind the value of the timespan of the occurrence of an event from the current time to a Textblock element in a page in the app. I was surprised to see the converter fail to cast the timespan value to the right format. Debugging through the converter, I found that the current time used for calculation of timespan was 1/08/2010 01:45:23 while the current time was 17/08/2010 23:30:00!

I wanted to make sure DateTime.Now returned the correct value when required. I created a simple single page app for Windows Phone 7, added a button & an event handler for its Click event. The Click event handler formatted the current date & time and set it in the textblock. I compiled & ran the app, clicked on the button and saw the current date to be 01/08/2010 02:02:48 -

I started looking around for clues and recalled the time when I installed the Beta developer tools on the PC I was working on, it was the 1st of August! I started looking for any configuration or settings files that is used by the emulator during the boot process. I ended up finding these files which looked interesting -

I shutdown the emulator, copied out the two files to a safe location and deleted the two files in C:\ProgramData\Microsoft\XDE. I restarted the emulator to see it doing a complete OS boot -

I tried running the test application and found the time was correct -

This seems to a be a bug in the Beta developer tools where the Windows Phone emulator does not pick up the current time from the host operating system or elsewhere. Until the issue is fixed, the workaround is to delete the two saved state files from C:\ProgramData\Microsoft\XDE (Note: The drive letter may be different for your installation) and start the emulator every time you are working with the emulator.

Quick tip : Compile & run Windows Phone 7 Foursquare App with a Bing Maps Key

Foursquare is a popular social application these days. The awesome folks at Foursquare built a Windows Phone 7 application and released the source code to the public. The source code (actually, a fork) was recently updated to work with the Windows Phone 7 Beta Tools, the fork is available here. If you have downloaded and compiled the source code and loaded it on the Windows Phone 7 emulator to run, you will see the following error if you click on any of the links in the main page -

If you head to the URL shown in the message box, sign in with your Live ID and create an AppId, set the AppId in the  “MapHelper.cs” file, expecting that the App to work afterwards, you might be disappointed to the see an exception raised in “ImageryService.cs” (in the method “EndGetMapUri”).

In order to compile and run the Foursquare app on the Windows Phone 7 Emulator, we will need a “Bing Maps API Key” from www.bingmapsportal.com. Once you have logged in with your Live ID, you can create a new key and copy the key into “MapHelper.cs” file, compile the application and run it -

Hope this helps someone.

More Windows Phone 7 development resources

Vodafone Australia, Huawei E220 and K3765

After quitting my full-time work career and starting as an independent consultant in May/2007, I started telecommuting on customer engagements. I got a chance to work in my own private space flexibly, in cafes, libraries, Starbucks, sometimes in shopping malls. During the initial days, I had to depend on free Wi-Fi for internet connectivity in my laptop. I slowly started feeling the need of having an internet connection that I could use anywhere I like. Thus began the crusade…

I joined Vodafone Australia in January 2008 on a A$39/month post-paid mobile broadband contract for 24 months. In those days, the Huawei E220 USB dongle (branded Vodafone) felt like a luxury item! Vodafone had a generous 5Gb per month data allowance which was more than sufficient for me over the two years. I was on a direct debit plan on my VISA credit card and everything went well flawlessly for the billing. I did have teething issues with coverage during the two years. Vodafone was working hard to build their own 3G infrastructure in the Sydney Metro area and I acknowledged it by tolerating frequent dropouts, several hours of no connectivity in CBD areas in Sydney, and so on.

In January 2010, the contract expired. I continued using the Huawei E220 and Vodafone kept billing me every month. End of March 2010, I got a call from Vodafone, offering me a 6Gb/month plan at the same price with a new Vodaone K3765 modem on a 24 month contract. While I didn’t really shop around for cheaper/better mobile broadband plans, I had my eye on Telstra’s 3Gb/month mobile broadband plan. While on the phone, I was somehow sold this new contract with the assurance that I do not need to call anyone at Vodafone since I have given the authority to record the conversation which is as good as signing a document. I was told that existing billing details will be ‘carried over’ to the new contract and everything will progress smoothly after I activate the new SIM which will be shipped with a K3765 modem. I received the SIM and the new modem, activated & started using the new connection from April 15. Until the latest VISA credit card bill, I could see Vodafone charging me $39 every month for the mobile broadband service. Yesterday, 9/July, when I tried to connect to internet after plugging in the modem, I got an error popup and Internet Explorer was trying to open an URL – ipc.vodafone.com.au/insufficient_funds.

I called Vodafone customer service, tried my best to get rid of the “friendly” IVR prompts and managed to talk  to someone within the first 10 minutes – thats’ a win, I thought. After completing the identification formalities, I was told that my account has been suspended due to non-payment of charges! I was shocked. The account history showed that I haven’t paid Vodafone since April 15 when I started using the account. I spoke 5 different customer service agents in the 1hr20mins I was on the phone – I got Vodafone to cancel the accounts. Vodafone accepted the fault and advised that $11.60 that I am owed will be credited back to my VISA credit card.

Next, I wanted to check if the E220 modem (which I can use since the contract was over and I have already paid for it) and the K3765 modem will work with another prepaid SIM (I am considering Virgin since they use the Optus network). I started searching on the internet for help with testing whether the modems are locked/unlocked and how to unlock them if they are locked. Through the Whirlpool Australia forums, I found a link to the GSM forums where one could post their IMEI and get an unlock code. A kind soul sent me the unlock code for the K3765, however, I was advised that the E220 can not be unlocked by inserting a unlock code. I did find this link to unlock the E220, but, I was keen to unlock the K3765. I then downloaded the “dc unlocker client” version & installed it in my Windows 7 Ultimate 64 bit Macbook Pro laptop. I have VMC Lite version 9.4.3.16284 installed when I setup the K3765. I plugged in my E220 I shut down the “MobileConect” and “VMC” services through the task manager and fired up the dc unlocker. dc unlocker detected the E220 and returned – “SIM Lock status     : unlocked”. Next, I inserted the K3765 and repeated the process, this time,  I saw a “SIM Lock status     : Locked (Card Lock)”. With the unlock code for the K3765 ready for use, I started looking for a program to use the unlock code with the K3765. I found this pack from a forum post here. I used the “code.exe” to add the code (after asking it to detect the K3765 in a COM port) and unlock the K3765. Next, I ran dc unlocker and it reported “SIM Lock status     : unlocked”. HURRAY!

Next on – I plan to get a Virgin pre-paid SIM card and use with one of the two unlocked modems, preferably the K3765. I hope by following the steps in this post, I will be able to use one of the two modems and have mobile broadband for my laptop. I’ll post an update on my attempt to use Virgin with the modems.