Installing Google Play Services in the Microsoft Visual Studio Android Emulator

Installing the Google Play Services in Microsoft’s Visual Studio Android Emulator that comes with Visual Studio 2015 is easy to do. This installs the Google Play store and related services, which makes it possible to install other apps to your Android image.

  1. Download the Google Apps package from the Team Android site. Make sure that you match the version of the apps to the version of Android that your emulator is for. The default emulator is for Kit Kat, but this also works for Lollipop.
  2. Start the Microsoft Visual Studio Android Emulator
  3. Start the Android virtual machine that matches the version of the apps that you downloaded for (default would be Kit Kat).
  4. Unlock the Android VM so you get to the home screen
  5. Drag and drop the downloaded Google Apps package in to the Android VM. You will get a prompt to install the apps that looks like this: Install-Goople-Play-Microsoft-Android-Emulator
  6. Select the “Install and Shut Down” option.
  7. Start the VM again
  8. Click the All Apps button in Android and you will see the Google Play store.
  9. When you open the Google Play store, you will need to login with your Google account and make a new one.

Once you have the Google Play store installed, you should be able to install other common applications. I tested this by installing Chrome and it worked well.

How to update the data in listview in Xamarin.Forms?

First you add a new class as a ViewModel like:

public class RoomViewModel : BaseViewModel
{
   [here following code]
}

If you don't have BaseViewModel try to download from nuget Refractored.MvvmHelpers. Then in your class define an observable collection like

  public ObservableCollection<RoomRecommandation> _roomSuggestionList = 
               new ObservableCollection<RoomRecommandation>();
  
  public ObservableCollection<RoomRecommandation> Recommendations
  {
     get { return _roomSuggestionList; }
  }

In your ContentPage add a listview like:

<ListView ItemsSource="{Binding Recommendations}">
 <ListView.ItemTemplate>
   <DataTemplate>
     <ViewCell>
       <Grid Padding="10" RowSpacing="10" ColumnSpacing="10">
         <Grid.RowDefinitions>
           <RowDefinition Height="" />
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
           <ColumnDefinition Width="Auto" />
           <ColumnDefinition Width="" />
           <ColumnDefinition Width="Auto" />
         </Grid.ColumnDefinitions>
         <controls:CircleImage Grid.Column="0" BorderColor="#DDD3CB" 
                               BorderThickness="3" WidthRequest="66"
                               HorizontalOptions="CenterAndExpand" 
                               VerticalOptions="CenterAndExpand" 
                               Aspect="AspectFill" 
                               Source="{Binding Image}" />
         <Label Grid.Column="1" Text="{Binding Description}" 
                               VerticalOptions="Start" />
         <Label Grid.Column="2" Text="{Binding Price, StringFormat='£{0}'"
                               FontSize="Small" VerticalOptions="Start" />
        </Grid>
      </ViewCell>
    </DataTemplate>
  </ListView.ItemTemplate>
 </ListView>

Then in your ContentPage code:

  RoomViewModel vm = null;
  public RoomPage ()
  {
      InitializeComponent ();
      LoadData();
  }

  public void LoadData()
  {
      if (vm == null)
      {
          vm = new RoomViewModel();
          BindingContext = vm;
      }
  }

Happy coding!

Advertsing

125X125_06

TagCloud

MonthList

CommentList