Thursday, November 1, 2012

Zync z1000 review (Budget android tablet)

I own Samsung Omnia 2 smart phone with Windows mobile 6.5 OS. Off late I started dabbling with android and felt the need of owning an android device. I was not willing to swap my current phone with an android phone so I decided to go for an android tablet.


Apart from using it as my lab, I intended to use it for reading books while on bed which i cannot do comfortably with my laptop.

When I started to look for budget tablets I was astonished with the number of options available in Indian market under INR 10000. I was determined to get the best value for whatever little money I was ready to spend so I created my wish list which is as follows.

a. 10 inch screen

b. Support for GSM sim so that I can use it to surf net using Airtel gprs.

c. Latest android – ice cream sandwich or jelly bean

d. Good screen resolution

e. Good battery

f. 1 GB ram

I had almost zeroed in for Iberry Auxus AX03G as it was offering most of what I was looking for e.g. Android 4.0, SIM support, 1 GB RAM.

Recently I across a news article around launch of Zync z1000. Both had same price band of INR 11000 and Zync z100 offered almost everything that Auxus AX03G  had but following additional offerings made me to go for it

a. 9.7 inch display versus 7 inch

b. 1024X768 pixel resolution versus 800X480

c. Bundled accessories - lycra pouch and screen guard

d. Discount of INR 1000 in homeshop18.com



I had gone through many reviews of budget tablets and because of that I was little skeptical of what I am going to get. I must say that I have never used Ipad so my expectations were not very high.

Yesterday I got my Zync z1000 and here is my initial reaction on ZYNC z1000 tablet.


.
As promised box had following:

1. Zync z1000 tablet

2. Lycra pouch

3. Screen guard

4. Ear phone

5. Charger

Specifications

Here is the complete specification as mentioned on the package:

Processor – 1.5 GHZ with Mali 400 GPU

Android – 4.0 Ice Creame Sandwich

Camera – front camera 0.3 MP/Back camera 2.0 MP

Memory – 8GB (internal) Expandable upto 32 GB

Ram – 1 GB DDR3

Battery – 7000mAh/3.7v (polymer battery)

Media – MPEG1/2/4, MJPG, MKV, DIVx,xvid,mov

Sensor – G-sensor

Display – 9.7’’ Multitouch Capactive(1024*768)

Connections – 2 mini usb/ TF card/HDMI/3.5’’ earphone jack/DC port

Network – in built 3G support & WIFI802.11b/g/n

Dimensions – 245*190*13mm

Design of tablet

Overall design and build quality of tablet is ordinary. Front panel is plain with rounded corner. There is one camera on front. Back side is plastic with ordinary finish. There is one camera and speaker on the back.

On one side it has a volume rocker as well as back button. On another side it has following:

a. Power button

b. Sim card slot

c. 2 micro usb port

d. 1 HDMI port

e. 1 3.5’’ear phone jack

f.   DC port

g. 1 card slot



Display screen

Display looks fine and it’s responsive to touch. I didn’t experience any lag. I tried some live wallpapers and color looks decent.


Battery

I fully charged the battery and after that it lasted for around 5 hours. In these five hours I used the tablet extensively for browsing net. I did several downloads and played games.

Calling feature

I inserted my regular Airtel SIM and used it for making few calls and sending SMS. Network reception was good. I tried USSD feature of airtel and it worked fine. I also used airtel gprs for browsing web and it worked well.

Software

It had all software’s as claimed except for angry birds. It’s not an issue as I used Google Play to download angry birds as well as Google Chrome browser.

Overall I feel that my 10000 is well spent and I have got a decent android device!!

Sunday, October 7, 2012

Learning Linux Commands

I always had my development environment on Windows operating system so I never got a good hands-on on unix commands. This becomes a handicap when you have to troubleshoot a production issue once in a while as most of the time production environments are on Linux.

I have always been on the lookout for the ways to get a unix emulator or something similar on Windows. Earlier I tried Cygwin which is a good tool to get Linux look and feel environment on Windows. The only issue with this is that you have to install a large number of tools. On your workstations it may not be possible because of the restrictions imposed by employers.

Recently I stumbled upon another cool site called linuxzoo. I wish I had known about this site earlier. It allows you to have a remote private Linux machine with root access. This machine will be under your complete control, and you have to start it and stop it just like any normal machine!


So, If you are interested in learning Unix/Linux commands and you don't have access to Linux box get yourself registerd on http://linuxzoo.net.   Happy Learning!!

Tuesday, October 2, 2012

Say hello to Groovy - Part 3 (Collections)


In my previous blog i talked about various operators and control structures available in Groovy. Today i am going to talk about Groovy collections. Like Java, we have List and Map in Groovy. Groovy also has something called Range.

 
Lists

List is an ordered collection of objects. Groovy lists are indexed using [] operator. We can use [] to define an empty list and << to add items to a list.

Following code snippet shows how a list is defined in Groovy.

List Methods

Lists support many useful methods. Following code snippet illustrate the usage of some of the list methods.


Maps
Map is a collection of key value pair. We can use [:] to define an empty map. If the keys in a Map is String, it can act as a bean.
Following code snippet shows how to define and use Maps in Groovy.


Map Methods 
Maps support many useful methods. Following code snippet illustrate the usage of some of the Map methods.


Range

Range can be used to specify a list of sequential values. Range is defined using the first and last value of the sequence. Range can also be defined to exclude the last value. Use .. operator to include first and last value. Use ..< operator to exclude last value.

Ranges can be used for any Java object which implements java.lang.Comparable for comparison and also have methods next () and previous() to return the next / previous item in the range.

follwoing code snippet shows how to define and use Range in Groovy.

Range Methods

Like Lists and Maps, Range also support many useful methods. Following code snippet illustrate the usage of some of the Range methods.










Friday, September 7, 2012

Say hello to Groovy – Part 2 (Operators & Control Structures)

In my last blog, I gave an introduction to Groovy. We looked at the typical hello world program in Java as well as Groovy to understand how some of the additional features provided by Groovy helps to cut down on a lot of boilerplate code that you would have otherwise written in Java. In this blog, I will concentrate on some of the operators and control structures which are unique to Groovy.

Groovy Truth

Like Java, Groovy supports standard conditional operators in a Boolean expression. In addition to this, any type can be evaluated as a Boolean expression in Groovy. This is possible because Groovy has rules to convert a non-boolean objects to a Boolean value. E.g. In case of string, non-empty strings evaluate to true


Following are some of the rules that you should know: 
1. Empty collection evaluates to false. 
2. Non-zero numbers evaluates to true. 
3. A non-null object reference evaluates to true. 
4. Non-empty Map evaluates to true. 
5. Iterators/enumerators evaluates to false if it has no further elements. 

Operator Overloading

In Java we use the == operator to see if the variables are referring to the same object instance. Groovy overrides == operator on types such as String, Integer, List etc., to check for content equality rather than object equality. To test if two variables are referring to the same object instance in Groovy we use the is () method.





Elvis Operator (?:)


The "Elvis operator" is similar to Java's ternary operator. It can be used for returning a 'sensible default' value if an expression resolves to false or null. E.g. In below snippet, if username is null or empty, “Anonymous” would get printed. 


Safe Navigation Operator (?.)


In Java, it’s a common practice to check for null, before invoking a method on the object to avoid NullPointerException. In Groovy, this is achieved in lesser lines of code using the Safe Navigation operator. The safe navigation operator will simply return null instead of throwing an exception, e.g: In the below code snippet, null would get printed and no NPE will be thrown.



Looping

In addition to all looping constructs available in Java, Groovy provides some extra ways to loop and execute a piece of code. Groovy extends the Integer class with the step (), upto () and times () methods. If we have a List in Groovy we can loop through the items on the list with the each () and eachWithIndex () methods. We will revisit this with examples when I cover closure and collections.


Exception Handling

Groovy doesn’t force you to handle exceptions within the method signature not even for checking exceptions. You are free to choose how and when you handle the exception. The exception is passed on to the calling code until it is handled. E.g. the following is a valid code in Groovy however if you were to write the same code in Java, the compiler would have forced you to handle java.net.MalformedURLException.


Sunday, September 2, 2012

Say hello to Groovy - Part 1

With this blog, I am starting a series on Groovy. Chances are that you are already aware of what Groovy is but in case you are not; Groovy is an object oriented programming language.

Groovy is one of many JVM languages that compiles to bytecode that runs on the JVM. Groovy is also a dynamic language so it’s not statically typed like Java however it has a Java like syntax.It's also a scripting language so you don't necessarily have to compile the groovy code before executing it.


So why would you choose Groovy over Java or other dynamic languages that runs on the JVM like JRuby? While Java like syntax is definitely a plus, Groovy is designed to seamlessly integrate with Java i.e. you can implement a Java interface using Groovy and vice versa.
One other advantage is that Groovy has many modern programming features which were missing in Java e.g. Closure. If you are a Java developer, learning Groovy would be a cakewalk!

 
Getting Started
In order to get started, perform following steps:
  1. Download the latest version of Groovy from http://groovy.codehaus.org/Download.
  2. Once downloaded, extract the content of the zip file into your location of choice e.g. C:\groovy-2.0.1
  3. Create an environment variable called GROOVY_HOME and set it to C:\groovy-2.0.1
  4. Append  %GROOVY_HOME%/bin to the path environment variable.
Once you are done open a command prompt and type groovy - version. If Groovy's version is displayed in the command prompt you are all set to play with it!

 
Walkthrough of Groovy tools

Now that you have Groovy installed, lets look at the tools that you would need to play with it.

groovy - Use this tool to execute groovy source code (.groovy files).  This is typically used for executing Groovy scripts.

groovyc - Use this tool to compile groovy code to Java class file. You would use this tool so that you Groovy source code is not compiled every time before execution.

groovyConsole - This is a minimal editor that you can use to load, type and exceute Groovy code.



 
Typical Hello World

Introduction to any programming language is incomplete without a Hello World program so lets see how a hello world program looks like in Groovy.While we are at it, we will also see how Groovy cuts down on a lot of boilerplate code from Java. Here is how a typical Hello World program would look like in Java.


Here is the list of Groovy features that we are going to leverage :
  1. Default visibility for methods and fields in Groovy is public.
  2. It is a dynamic language so type information is optional.
  3. Semicolon is optional at the end of a statement.
  4. Paranthesis is optional for top level expression.
  5. Groovy provides println which can be used in place of System.out.println. You can use println "Hello World!" inplace of System.out.println("Hello World!");
Once we factor in all the above mentioned features, this is how a Hello World program would look like in Groovy.

Ok. I also mentioned that Groovy is a scripting language so it automatically wraps a script with a default class and main method. So your hello world program in Groovy can actually be a single line of code.



Enhanced Hello World

Now that you got an idea of how Groovy cuts down the boilerplate code and enhances developer productivity, lets look at an enhanced Hello World program.

Here is the enhanced version of Hello World code in Java



lets leverage some of the Groovy features mentioned below and rewrite the same program in Groovy:
  1. Groovy has a feature called Gstring which allows you to write a string containing an expression that can be evaluated. e.g. instead of "Hello "+getName()+"!" you can use something like "Hello $name!"
  2. It also has something called Groovy Bean i.e. if you have a public field or property in a bean class, Groovy automatically generates getter and setter for it. Groovy also provides shortcut to access and set these properties. e.g. in the above example, instead of hello.setName("world") you can use hello.name = "World"
Ok. So this how it will look in Groovy.

 


that's it in this blog. In my next blog i will do a deep dive on some of the Groovy feature.

Friday, August 17, 2012

Introduction to OAuth – Part 2

In this blog we will discuss how OAuth works. Our focus would be on OAuth 2.0. There are many articles on the internet that talks about OAuth 1.0.


How OAuth 2.0 is different from OAuth 1.0

OAuth 1.0 involved certificates so if you were to code for OAuth 1.0 you would have to know about how to sign the requests using signature methods like HMAC-SHA1 or RSA-SHA1 etc. OAuth 2.0 is much simpler. It relies on SSL instead of signatures.

OAuth 1.0 had only one flow for authentication. OAuth 2.0 defines multiple flows or client profiles for handling authentication e.g. web application, user agent and native.

Actors in OAuth 2.0

Following are the important roles in OAuth 2.0

a. Resource Owner – Person whose data/information is to be shared between two applications.

b. Resource Server – Application that hosts user’s data/information.

c. Client Application – Application that needs to access data from the resource server on the resource owner’s behalf.

e.g. let’s assume that I want to use friendfeed to browse the photos that I have uploaded to my Flickr account. In this case, I become a resource owner, Flickr becomes a Resource Server and FriendFeed becomes a Client Application.



Getting Ready for OAuth

Before a client application can start accessing resources on the resource server, it needs to register itself with resource server. This registration is a one time activity and once registered client application gets a client id and secret.

During registration, client application also provides a redirect uri to resource server. This redirect url is used during the OAuth authorization flow.

In the above example, FriendFeed would have registered it with Flickr and obtained client id and secret from Flickr.



OAuth authorization flow

Let’s look at Oauth authorization flow for a web application profile.

Continuing with the above example, assume that I am trying to use firendfeed to access my photos that I have uploaded to my Flickr account. At this time FriendFeed will check if it has an access token in order to get photos from Flickr on my behalf. If access token is not found then FriendFeed would initiate OAuth flow which would typically have following steps.



Step 1: User accesses client application.

Step 2: Client application redirects to resource servers authentication page.

Step 3: Resource server authenticates the user and then obtains user's authorization for the data that client application is trying to obtain from the resource server on the user's behalf.

Step 4: The Resource server generates the authorization code and redirects to client application including authentication code. Resource server uses the redirect url that client application provided during registration.

Step 5: Client application sends a request for access token. Client application includes the client id and secret in this request.

Step 6: The Resource server sends the access token. This access token comes with an expiry date.

Step 7: The Client application accesses the services provided by the resource server to access user’s data as long as access token is not expired.



Here we looked at the flow for web application profile. The flow would vary slightly for other profiles.

Sunday, August 12, 2012

Introduction to OAuth - Part One

In my last blog, I talked about OpenID which solves the problem of one having to remember userid and password for multiple websites. Today I will talk about another problem related to passwords.


In today’s world, a lot of our personal information is scattered across multiple websites and many a times you would like all this information to be consolidated at one place e.g. your financial information may be scattered across the websites of multiple banks. We also have lots of social networking sites today and here also we typically use different sites to share different types of information. E.g. instagram to share photos, tripit to share travel plans. Generally what you share in one social networking site is available to others in the same network but most likely you would like this to be available to users of other sites as well. E.g. you would like your instagram photos or your tweets are available to your facebook friends as well.

Now a day’s most of the popular websites provide services and APIs. Websites and applications can use these services and APIs to access and display user’s information from multiple different websites.

If a website or an application needs to pull the user’s data from multiple websites then it would need to store user credentials (userid/password) for all such websites and use them to pull information on the user’s behalf. The Problem with this approach is that not many user’s would be comfortable in sharing their credentials and rightly so.

OAuth is an open protocol that allows websites and applications to securely expose and consume services and APIs. It solves the problem of how one website can access user’s data/information from another website without knowing the user’s credentials.

In my next blog I will get deeper into how OAuth works.

Sunday, August 5, 2012

Introduction to OpenID

When was the last time that you wanted to access the website but you didn’t remember the user name or password? All of us face this situation quite frequently and people have come up with solutions which are quite risky from a security perspective. Some people use the same username and password across all websites. Others keep a note of username and passwords used in different websites.
Another annoying part is filling up the sign up form. Every time you register for a new website, you end up filing pretty much same information again and again.

OpenId is meant to solve these problems. The idea here is to create an id with an openId provider and use that ID to log on to sites that support openId. In an ideal world where all websites support openId you will end up having just one user id and password. Isn’t this amazing!

In terms of adoption, OpenID is used by many large websites including Facebook. If you are using services like Yahoo, Google, Flickr or Myspace, you already have your own OpenID. Additionally there are some dedicated ID provider like myOpenID, verisign and myID.net. Visit http://openid.net/get-an-openid/ for complete list.

Typical actors in OpenId standard are “id provider” and the “relying party”. This standard provides the framework for the two actors to communicate.

Coming to the problem of re-typing the same information again and again, OpenID standard has an extension (OpenID attribute exchange) that allows for transfer of user information from id provider to the relying party. This way you don’t need to retype this information all over every time you sign up to a new website.

OpenID is not free of all evils though. You need to be careful with your OpenID because if your OpenID and password is stolen then all your registered sites become a target! You would be better off if your OpenID service provider supports two factor authentication. VeriSign is one such provider.