Google Cloud Messaging, ASP.NET Web Api and Android client

Pushing message from the server to client so that client doesn’t have to send the request to the server periodically is not a new concept anymore. Earlier when then client wants to check if the server wants to send something to him, he has to send dummy request to server repeatedly to ask for notifications. Although the server has nothing new, he is still overloaded because of handling these kinds of requests. Actively pushing message from the server to client will save him from unnecessary requests of clients. In this concept, the client will connect to the server through a channel and wait there for a new message. When the server wants to notify a client, he just uses the current active channel between him and client, then sends a message through it. The client receives notification and handles it. Server and client don’t have to send ping-pong message to communicate, all they have to do is building up an active channel between them and communicating through that channel.

 

Continue reading Google Cloud Messaging, ASP.NET Web Api and Android client

How to call ASP.Net Web API service from Android?

In my previous posts, I discussed how we can consume the ASP.Net Web API with RestSharp and HttpClient. In this small one, I would like to show how we can make a demo application in Android consuming ASP.Net Web API service. To save time, I already prepare a sample REST web service made by ASP.NET Web API with only one resource at http://restwebserviceforandroid.apphb.com/api/products. You can access the service without any authentication for your testing purposes. On the server, I use Entity Framework to connect to a SQL Server behind with following structure

Continue reading How to call ASP.Net Web API service from Android?

How to get Android emulator working with Fiddler?

If you are trying to call web service within Android emulator, maybe you would like to see how your real HTTP request looks like and was sent to server. Of course there are a lot of ways to hook network interface such as using Wireshark, Microsoft Network Monitor,… However these tools provide low-level-interfaces with packet capturing which aren’t appropriate for TCP/IP data analyzing. Therefore, in this small blog post, I’ll summarize how to configure Fiddler so that he can capture all traffic going through Android emulator. Fiddler can parse JSON/XML format in readable form so that we can validate input/output data in HTTP request.

Continue reading How to get Android emulator working with Fiddler?