Wednesday, May 15, 2013

Android Studio

Introducing Android Studio .

Android Studio is a new Android development environment based on IntelliJ IDEA. Similar to Eclipse with the ADT Plugin, Android Studio provides integrated Android developer tools for development and debugging. On top of the capabilities you expect from IntelliJ, Android Studio offers:

http://developer.android.com/sdk/installing/studio.html#side-nav

For Tips and Tricks

http://developer.android.com/sdk/installing/studio-tips.html

The Complete keymap about Intellij Idea as follows below

http://www.jetbrains.com/idea/documentation/index.jsp

Wednesday, May 8, 2013

REST and SOAP


SOAP - "Simple Object Access Protocol"
SOAP is a method of transferring messages, or small amounts of information, over the Internet. SOAP messages are formatted in XML and are typically sent using HTTP (hypertext transfer protocol).

  • SOAP builds an XML protocol on top of HTTP or sometimes TCP/IP.
  • SOAP describes functions, and types of data.
  • SOAP is a successor of XML-RPC and is very similar, but describes a standard way to communicate.
  • Several programming languages have native support for SOAP, you typically feed it a web service URL and you can call its web service functions without the need of specific code.
  • Binary data that is sent must be encoded first into a format such as base64 encoded.
  • Has several protocols and technologies relating to it: WSDL, XSDs, SOAP, WS-Addressing


Rest - Representational state transfer
Rest is a simple way of sending and receiving data between client and server and it doesn't have any much standards defined. You can send and receive data as JSON, XML or even plain text. It's light weighted compared to SOAP.
  • REST need not be over HTTP but most of my points below will have an HTTP bias.
  • REST is very lightweight, it says wait a minute, we don't need all of this complexity that SOAP created.
  • Typically uses normal HTTP methods instead of a big XML format describing everything. For example to obtain a resource you use HTTP GET, to put a resource on the server you use HTTP PUT. To delete a resource on the server you use HTTP DELETE.
  • REST is a very simple in that it uses HTTP GET, POST and PUT methods to update resources on the server.
  • REST typically is best used with Resource Oriented Architecture (ROA). In this mode of thinking everything is a resource, and you would operate on these resources.
  • As long as your programming language has an HTTP library, and most do, you can consume a REST HTTP protocol very easily.
  • Binary data or binary resources can simply be delivered upon their request.


enter image description here

Tuesday, May 7, 2013

Announcing OkHttp for Open source Android and Java


Android has two HTTP clients built-in:
  • Apache HTTP Client is stable yet basic.
  • HttpURLConnection supports advanced features, but suffers a few annoying bugs on older devices.
At Square, we want it all: advanced features that work right on every device. We also want to ship new tech without waiting for new Android releases.
OkHttp is our new open source HTTP client for Android and Java. Our goal is to build the most robust, most efficient HTTP client.



Robust

Flaky networks are a fact of life, especially on mobile. OkHttp employs a few strategies to automatically recover should a connection fail.
For example, if your web service is hosted in multiple data centers for redundancy, OkHttp will attempt each IP address until it finds one that works. It also recovers from failed TLS handshakes and troublesome proxy servers.
The code is based on the latest version of Android’s HttpURLConnection, which has been battle-tested against real-world web servers.

Efficient

The fastest download is the one you don’t have to make. OkHttp includes an integrated response cache. Unlike an application-level cache, the integrated cache uses conditional requests to extend the life of stale resources.
When OkHttp does hit the network, it uses transparent response compression and a sophisticated connection pool. These on-by-default optimizations save bandwidth and reduce latency.
My favorite feature is the SPDY backend. This is Google’s efficient new wire transport layer that is the starting point for the new HTTP 2.0 draft. SPDY enables multiple concurrent requests to share a single socket. This lowers the cost of HTTPS so you no longer have to choose between security and performance.

Give it a try!

If you’ve written an Android app, OkHttp may improve the speed & reliability of your networking. It supports both the HttpURLConnection and HttpClient APIs so you can upgrade painlessly.
If you’re writing a new app, the project website has code examples to get you started.
Get OkHttp from Maven or download it from the project website.