Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Xamarin Mobile Application Development for Android, Second Edition

You're reading from   Xamarin Mobile Application Development for Android, Second Edition Develop, test, and deliver fully-featured Android applications using Xamarin

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher Packt
ISBN-13 9781785280375
Length 296 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (13) Chapters Close

Preface 1. The Anatomy of an Android App FREE CHAPTER 2. The Xamarin.Android Architecture 3. Creating the Points Of Interest App 4. Adding a List View 5. Adding a Details View 6. Making Your App Orientation-aware 7. Designing for Multiple Screen Sizes 8. Creating Data Storage Mechanisms 9. Making POIApp Location Aware 10. Adding the Camera App Integration 11. Publishing an App to the App Store Index

Hooking up POIListViewAdapter


We have the list layout and adapter ready; let's now proceed to hook up the data in poiListView. We need to switch back to the POIListActivity class and add the following changes:

  1. Declare the following variables inside the POIListActivity class:

    private ListView poiListView;
    private ProgressBar progressBar;
    private List<PointOfInterest> poiListData;
    private POIListViewAdapter poiListAdapter;
  2. Now, in the OnCreate method, instantiate the ListView and ProgressBar:

    poiListView = FindViewById<ListView> (Resource.Id.poiListView);
    progressBar = FindViewById<ProgressBar> (Resource.Id.progressBar);
  3. For now, we will create an Async method that is responsible for downloading the data from the server and displaying it in POIListActivity. Add the following method to the POIListActivity class:

    public async void DownloadPoisListAsync(){
    
    }
  4. Call the DownloadPoisListAsync() method from the OnCreate() activity life cycle callback.

  5. Note that this chapter uses the Android...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image