Book Image

Xamarin Mobile Application Development for Android

By : Mark Reynolds
Book Image

Xamarin Mobile Application Development for Android

By: Mark Reynolds

Overview of this book

<p>Technology trends come and go, but few have generated the excitement, momentum, or long-term impact that mobile computing has. Mobile computing impacts people’s lives at work and at home on a daily basis. Many companies and individual developers are looking to become a part of the movement but are unsure how to best utilize their existing skills and assets. The Xamarin suite of products provides new opportunities to those who already have a significant investment in C# development skills and .NET code bases, and would like to enter into this new, exciting world.</p> <p>This example-oriented guide provides a practical approach to quickly learning the fundamentals of Android app development using C# and Xamarin.Android. It will lead the readers through building an Android app step-by-step with steadily increasing complexity.</p> <p>This book begins with an overview of the Android and Xamarin platforms to provide you with a solid understanding of the environment you will be working in. You will then be gradually walked through building and testing an Android app using C# and the Xamarin.Android product. You will learn the basics of interacting with some of the more interesting aspects of Android devices including location services, the camera, and maps. You will also be given the opportunity to work with three different layout managers to gain an understanding of the various options available for arranging controls and content. The book ends with a discussion on the final steps involved in preparing apps for deployment to the various Android app stores.</p> <p>In a relatively short period of time, developers familiar with C# and rich client technologies such as WPF and Silverlight will be effectively developing, testing, and delivering Android apps.</p>
Table of Contents (16 chapters)
Xamarin Mobile Application Development for Android
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Extending the data service


Another topic we need to consider is which new features we require from the data service. Since we will be using an external camera app to capture the picture, we will have it save the picture in the same location as the JSON using a naming scheme like poiimage<id>.jpg. The data service will not be responsible for saving the images, but it would be convenient for it to provide a location and filename. Also, since the data service deletes POIs, it would be a good idea for it to also delete corresponding POI images, if they exist.

Defining GetImageFilename()

As we previously mentioned, the filename and location is something we should obtain from the data service. To do so, we will first add a method to the IPOIDataService interface and then implement it in POIJsonServices. The following listing shows the method we need to add to IPOIDataService:

public interface IPOIDataService
{
...
string GetImageFilename (int id);
}

Implementing GetImageFilename()

Now, we need...