I am totally new to the Xamarin and mobile development. My first question is architecture wise is it a good practise to use the existing Rest api to transfer the data with mobile client end.
I dig the google ,Xamarin Azure cloud documents but didn’t find any satisfied article. Furthermore we have a ember front end application that consumed REST apis from Azure.
If this information not enough please ask from me and if it is duplicate please don’t hesitate to mark it as duplicate with proper link. Thanks guys please help and share your great experience.
Thanks
Few Links that I went through
https://azure.microsoft.com/en-us/documentation/learning-paths/appservice-mobileapps/
http://www.davevoyles.com/asp-net-web-api-vs-azure-mobile-services/
https://azure.microsoft.com/en-us/blog/azure-mobile-services-why-should-asp-net-developers-care/
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-value-prop/
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-ios-get-started/
If you just want to consume your existing server REST API, the obvious step is to build a REST client in Xamarin. Forget Azure mobile services client for Xamarin or anything related because that will require changes at your server code.
Regarding how to build the REST client, there are multiple alternatives, but I recommend Refit as the easier and faster way to do it. For instance, you declare your REST methods in a simple interface:
public interface IGitHubApi
{
[Get("/users/{user}")]
Task<User> GetUser(string user);
}
The magic is that all required code will be generated at compile time, thus you can focus on your API methods rather than the implementation itself and build your client in minutes, not hours or days. Then you can use that interface like this:
var gitHubApi = RestService.For<IGitHubApi>("https://api.github.com");
var octocat = await gitHubApi.GetUser("octocat");
The downside of not using Azure Mobile Service client is that if you need any offline/online syncronization you´ll have to make it by your own. But in my experience, client-server data sync is an edge-case, not needed at all in the vast majority of apps.