Posts

Showing posts with the label Web services

Utilizing Http response cache

     A typical mobile application will probably consume some resources from a web server using http requests. This repeated task has some drawbacks: Bandwidth has a cost, polling the same data over and over again results in a waste of user’s quota. the responsiveness and user experience is compromised once the user keeps waiting for data. If the requested data hasn’t changed on the server, then there’s no reason for us to fetch it. Of course, local caching of data is a must, but we also need to be able to refresh the data if it has changed on the server. A simple solution which comes out of the box for API 4+ is http response caching. Http response caching is a mechanism which enables us as developers to save a footprint of the response utilizing the abilities of the Http protocol. Basically, is holds a simple cache of the response which can be defined and enabled in code, and it prevents from fetching unchanged data from the server which was already fetched a...

On{x} – notes from GDG October – Tel Aviv

Image
on{x} is a new product by Microsoft (yes, Microsoft) for Android which is made out of basically two components: 1. An Android app 2. A web interface the web interface allows you to add and send java script based commands to the android app which enable you to automate your smartphone to do something automatically based on events, such as: 1. send an SMS to my wife when I get in my car saying “I’m on my way” 2. start the Waze app when starting to drive for over miles an hour 3. turn on the lights on my garage when I’m 100 feet from there (based on some hardware/software support which must be present at home) this platform uses anode.js which is somewhat an expansion of node.js (Event-driven I/O server-side JavaScript environment) supported by Azure for scalability etc.. the product as weird as it may seem is for developers only, due to the fact that normal everyday users won’t be able to construct js scripts to control different elements on the Android. of course that I can s...

Consuming SOAP web services in Android

Image
     it’s pretty common for android developers to use web services, mmm.. no, let me rephrase, it’s pretty common for every developer to write code which consumes data from a web service, because this is the world we’re living in at the moment, a server serves as a data host for different clients and other servers using data protocols. the most common protocol you’ll use is REST, which means that all the data transferred is basically represented as Json Strings, which is probably the best way to do it, because Json is very easy to understand, parse and generate both on client side, and on server side. Android has great built in support for consuming Restful web services, but it lack support in SOAP web services. Odds are you’ll probably encounter a web service of this sort. so what can we do? A suggested and common solution is to use the free open source library called KSOAP2, which provides us with an easy API for generating requests and parsing responses in a S...