Showing posts from 2014

Facebook Android Sdk : Serialize GraphUser object

If you check at the Facebook sdk GraphUser object documentation , it does not implements the as a result of which you can pass the GraphUser object through activities.

Though if you like to pass GraphUser to other activities, you can do it by saving GraphUser json string in a String instance and then pass it,

// Save GraphUser json information in String instance and pass to another activity using intent
List<GraphUser> selectedUsers = friendPickerFragment.getSelection();
List<GraphUser> selectedUsersJson = new ArrayList<String>();
for (GraphUser graphUser : selectedUsers) { selectedUsersJson.add(graphUser.getInnerJSONObject().toString()); }

// Re-initialize the GraphUser from the saved graph user json from the intent List<GraphUser> selectedUsers = new ArrayList<GraphUser>();
for (String graphUserJson : selectedUsersJson) { selectedUsers .add(GraphObject.Factory.create(new JSONObject(graphUserJson),GraphUser.class)); }

Happy Serializin…

Download Android SDK offline

Many of you interested in Android development or automation, must have downloaded Android SDK installer and have noticed once you install the SDK on your machine, you still need to download some more file using the Android SDK Manager like :

Android SDK Tools
Android Platform Tools
Android API's

In some case you may not have the fast internet connection/bandwidth to download this much stuff.( Same with me :D ). So, here is the solution i am sharing with you guys how you can download with stuff from an high internet connection machine and then cut and paste to your development machine :)
Navigate to the link in browser. [ Note this is the last updated link at the time of writing this post.In future you will need to check the latest page by +1 increment to digit shown in url. Example next updated version should have 'respository-10.xml' in end ] Search for the sdk-tools/platform-tools/other stuff in the page like:  Fo…

Adding Windows PowerShell Cmdlets

You may all have seen some error like below when running a command on Windows PowerShell. This usually occurs when the command PowerShell snap-in is not added.

The term 'Get-SPWebApplication' is not recognized as the name of a cmdlet, function, script file, or operable program.

Solution:  How to add the required snap-in if not already added from the PowerShell script itself.

# Example to add SharePoint Cmdlets [ SharePoint should be installed on machine ]
if ( (Get-PSSnapin -Name Microsoft.Sharepoint.Powershell -ErrorAction SilentlyContinue) -eq $null )
    Add-PsSnapin Microsoft.Sharepoint.Powershell
    Write-Output "`n Snap-in Microsoft.SharePoint.PowerShell added."
    Write-Output "`n Snap-in Microsoft.SharePoint.PowerShell already added."
}  # Example to add SQL Cmdlets [ SQL management tools should be installed on machine ]
if ( (Get-PSSnapin -Name SqlServerCmdletSnapin100 -ErrorAction SilentlyContinue) -eq $null )
    Add-PsSnapin SqlSe…

Address is invalid on local machine, or port is not valid on remote machine

This issue is caused generally when your Java attempts to use an IPV6 address, where either OS does not support it or its not set up properly. You may get this issue while running your java program from CMD, Java IDE or when downloading jar dependency using maven etc.

So, to resolve this you just need to tell your java code to use IPV4 instead of IPV6 :)

"To fix when running from Command prompt. Just add the properly as: "
java <Your Java Class to Run>

" TO fix when running from Java IDE. Suppose Intellij IDEA: "
Set the property under Run -> Edit Configuration

Hide photos videos on your Android mobile without any software

So, everybody may have got the issue with hiding personal videos or images on their mobile phones. And also there are lot of software to serve the purpose but the problem with them is that either good ones are paid or not that good.

Here i will show you the way to hide any files mainly images/videos from your android gallery.

1. On your Android mobile phone, first download and install a File manager if you does not have already.  Here, i have used the 'ES File Explorer' which you can download freely from the Google play.

2. Open the File Explorer -> Go to its Settings ->  Set 'Show Hidden Files' to 'ON'

3. Create a new folder in File Manager with name ".hide". You can see that created folder is faded as compared to other folders with does not start with a "."

                                 [ Here you can pick any name but is should start with a "." ]

3.Move you all the files images/videos to ".hide" folder, Go an…

How to Disable Selenium HtmlUnitDriver logging

Recently, while working on a project using Selenium HtmlUnitDriver, i found that it generates too much log messages by default to output console which really fills the screen with non wanted messages.

So, like me some of you may also get this and wanted to resolve the same. What i did is added the below code statements to suppress the logging messages.
LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log","org.apache.commons.logging.impl.NoOpLog"); java.util.logging.Logger.getLogger("com.gargoylesoftware.htmlunit").setLevel(Level.OFF); java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF); and it Worked :) :)

Setup your code respository on Github

1. Sign up first on the for your free account.

2. After login, click on the 'New Repository' as shown in the image below:

3. Then, on next page provide your new repository -
- Repository Name [ anything you like]
- Description [ This is optional. You can provide some basic overview of your repository so people can     understand your work from there.]
Repository Visibility Type [ Here if you want to make your repository PRIVATE then you need to upgrade your github account, otherwise you can go with PUBLIC repository.]
 - Check the option "Initialize this repository with a README"
-  Add .gitignore file [ For this select your project language, for example here i selected java]
Add a License [ You may add a license if u like and as per your requirement, here i am adding MIT ]
- Then just click on 'Create Repository' button

4. So, here is your repository created:

5. From the above screenshot, you can see a unique HTTPS Clone URL is gene…

ISTQB - CTFL Cleared!!! :)

So, finally i got a mail from ISQI with my ISTQB Foundation Level exam results. I passed with 85% i.e 34 out of 40 question :)

I decided to write this blog, for those who like to take this examination without formal or no formal training. Well, i didn't took any.

How To Register:1. Either give exam from your country Testing board. For India you can go to, register and schedule your exam.
2. Second option is to give through other exam providers like Prometric or PearsonVue.

Well, i gave through PearsonVue. You can go to and schedule your exam.

Results Declaration [ PearsonVue ISQI ]:Well after completion, the attended at the examination center gave me the result with PASS status but it didn't had any score. Then after 1 week i got a mail from the ISQI with my results and now i am waiting for the my certificate :) As they said it will may take around 6 week to max :|

Study Material to Follow/I Followed [ Collected from and internet…

SharePoint 2013 - Enable Sign in as a Different User

1. Find and open the following file from the Sharepoint 15 hive
 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx'

2. Add the following control code before the control having ID 'id="ID_RequestAccess"' and save the file.
<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"

3. Reload the SharePoint web application and check again. 'Sign in as a Different User' should be visible now :)

Handle Sharepoint HTTP basic window authentication - using selenium webdriver java

import org.openqa.selenium.Alert;
import java.awt.*; import java.awt.datatransfer.StringSelection; import java.awt.event.KeyEvent;
// Switch to alert window. Alert authenticationWindow = driver.switchTo().alert();
// Type the username/email. authenticationWindow.sendKeys("<username/email address>");
// Shift cursor focus to password input text field. Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_TAB);
// Type the password in password field. [ Selenium does not know at this point that the cursor focus is shifted, so calling Alert class instance sendKeys() will cause password to be typed in username field. So, we are copying the password first to windows clipboard and then pasting it directly into the password field using  Robot class instance ] StringSelection stringSelection = new StringSelection("<user password>"); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection,null); robot.keyPress(KeyEvent.VK_CONTROL); robot.key…

How i tricked IntelliJ IDEA ultimate edition to keep running even after the trial period.

Jetbrains IntelliJ IDEA Ultimate edition allow to use its IDE for 30 days for free but after that it ask you to register else it get closed after every 30 minutes run, which is bad bad bad :(

So what i noticed and did to overcome this, i wanted to share with you all.Actually, i noticed that its IDE saves the current system time and on basis of that it gets closed after 30 minutes.

So i created a batch script which reset the time every 20 minutes so the IDE run time does not over and you get it running till you want :) :) :) :)

Copy and save the below commands with name 'tReset.bat' and start after starting your Intellij ultimate edition. <!-Code Start--->
@echo off :start REM : Save the current time in a variable FOR /F %%G IN ('time /t') DO Set cTime=%%G REM Displaye current time echo %cTime% REM Sleep for 20 minutes Sleep 20 REM Reset the time time %cTime% goto start <!-Code End--->
Thanks :) :) :)

NOTE:  You can use it the above solution at you…

Selenium Webdriver Java Tests Framework

Selenium Webdriver Tests framework implemented with Java, TestNG and Maven.

Project Git url and Details :