Friday, December 19, 2014

Encounter with CTS..!!


So finally coming back to my blog which was long due.

For a software professional like me and that too a bachelor living with his crazy friends in Pune, time is always on the fly. 24 hours seems like nothing for a day and interestingly this feeling remains throughout the year. But writing my thoughts is my happiness dose to myself, be it on nature, emotions, social cause, patriotism, hot issues, any idea or any technology. I have been writing up my thoughts ever since I was in my 9th standard, I am still novice in penning down my thoughts but that does not stop me from transforming my thoughts into my words. After writing previously on love, life and moral duties, this time I am writing on a technical topic for which I got inspiration, motivation and also some persuasion from one of my colleague.

CTS, no I am not referring here to Cognizant Technology Solutions, CTS is a small test suite containing around 99K test cases (latest Android L) to be verified on an Android device to make sure it is compatible to be sold to public. CTS – Compatibility Test Suite. I first came across this term around 2 years back while I was working on a project in my company. At that time my company was trying to make a similar project on a small scale that was specific to some devices which we were working upon in the project. I did some findings about CTS on internet but didn’t take it seriously then. One and a half years later CTS again came into my life and this time I had to take it seriously.

I gained the knowledge of it from my very special friend cum colleague for whom CTS executions was like a mania when he started working on it. I can tell you with all my personal experiences while working on CTS that it is hell to handle the failure cases until you become smart enough with its handling. My colleague somehow managed to make its execution understandable to me. Then I started reading about CTS on internet and I understood its importance. Even though it’s not necessary for one to execute and run CTS each and every day but it’s important for a software professional working in mobile domain company especially on Android Architecture to know what exactly CTS is and what exactly CTS does.


Android OS from Google is used by many device manufacturers all over the world for running their handsets, tablets etc. There are thousands of device based on Android OS that are sold in the market. It would be impossible for Google to verify the compatibility of each and every handset (running on Android) from different companies.  Without a strong compatibility standard, devices can vary so greatly that developers must design different versions of their applications for different devices. So Google came up with CTS, a testing tool which is free, open source and available for download. It is designed to be used for continuous self-testing during the device development process. Android devices will differ in hardware and software capabilities, so the compatibility program also provides the tools needed for distribution systems such as Google Play to implement appropriate filtering. This means users see only the applications they can actually run. The Android compatibility program makes it easy for mobile device manufacturers to develop compatible Android devices.

How does the CTS work?

The CTS is an automated testing harness that includes two major software components:

  • The CTS test harness runs on your desktop machine (linux machine) and manages test execution. 
  • Individual test cases are executed on attached mobile devices or on an emulator. The test cases are written in Java as JUnit tests and packaged as Android .apk files to run on the actual device target.


CTS setup and execution:
  1. Download CTS zip and CTS media files zip (Download CTS zip as per the version of Android device you are using)https://source.android.com/compatibility/downloads.html
  2. Attach a device or an emulator to the machine. Unzip the CTS zip and CTS media zip.
  3. There will be 4 folders after unzipping CTS zip namely docs, repository, resource and tools. Unzip CTS media zip and you will find CTS media files to be used while execution.
  4. Create a new sh file or edit the copy_media.sh file present in CTS media zip to push each and every resolution media files into the device. (basically adb push all the media formats file into the device sdcard)
    For eg: adb push bbb_short/1920x1080 /mnt/sdcard/test/bbb_short/1920x1080
  5. Ensure adb is in system path.
  6. Now from terminal, adb install –r android-cts/repository/testcases/CtsDeviceAdmin.apk
    After that go to device -> Settings -> Security -> Device Administrators
    enable the two android.deviceadmin.cts.CtsDeviceAdminReceiver*
    Note: Make sure the android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver stays disabled in the same menu.
  7. If the device has a memory card slot, make sure the device has an SD card plugged in and the card is empty.
  8. Set up your device with English (United States) as the language (Settings > Language & input > Language).
  9. Turn on the Location setting if there is a GPS or Wi-Fi / Cellular network available.
  10. Connect to a functioning Wi-Fi network.
  11. Make sure no lock pattern is set on the device (Settings > Security > Screen Lock 'None').
  12. Check the "USB Debugging" development option (Settings > Developer options > USB debugging).
  13. Connect the host machine that will be used to test the device, and “Allow USB debugging” for the computer’s RSA key fingerprint.
  14. Check Settings > Developer options > Stay Awake.
  15. Check Settings > Developer options > Allow mock locations.
Using the CTS:

The real encounter with the “MESS” the so called CTS will start from here.

Launch the CTS console by running the cts-tradefed script from the folder where the CTS package has been unzipped, e.g.

$ ./android­-cts/tools/cts­tradefed

For Android 5.0 CTS, java 7 or above is required.

After running the above command, one will enter into CTS tradefed. You may start default test plan i.e CTS.xml present in android-cts/repository/plans/CTS.xml using the command

cts-tf> run cts  --plan CTS

This command will run all packages present in CTS.xml. Individual package, class or even a method can be run separately.

cts-tf> run cts  --package android.app
cts-tf> run cts  --class android.app.cts.DownloadManagerTest
cts-tf> run cts  --class android.app.cts.DownloadManagerTest –method testDownloadManager

While the test starts do not touch the device and keep it connected via usb to the machine. When all the test cases complete executing a final report in xml format will be generated. Test results are placed in a file and logs are also captured.

/android­-cts/repository/results/<start time>/testResult.xml
/androi­d-cts/repository/logs/<start time>

One can re-run any testcase failed or passed anytime to verify again with different set of conditions.

So this was an initial introduction about CTS and its setup and usage. While working on it, one comes around much informative stuff about Android OS, SEAndroid, Android APIs and many other things. For any detailed information about CTS go through the following links:


I would urge whosoever is interested especially those who are working on handsets/tablets development to setup CTS and run CTS at least once. Some points that I came to know with my experience of CTS
What is Tradefed?
Java version specific to CTS version.
Enforcing mode Permissive mode based on SE Android. Denials, audit logs, etc. 















Monday, May 26, 2014

Moral duties ..

2:47 am, 26th May, 2014

My dear friends, as soon as you will progress reading this shit (many of you wouldn't even read it completely :-) ) written by me some of you might laugh, ignore and not take it seriously because friends never talk seriously with each other and especially when its related to our MORAL DUTIES. Yes today I don’t know from where this came to my mind that I should write something on a citizen’s Moral Duty towards the nation and its development but I am sacrificing my sleep to write this and even if a single person thinks it’s not shit the happiness quotient of mine will rise immensely.

We all , the social networking geeks, the youth of the nation who have lot other things to do in a day than to discuss politics , got involved in the country’s general elections so much that it was a topic from morning newspaper reading to evening news watching on television. From Facebook, twitter to whatsapp everywhere we got involved. We created, received, shared all types of stuff this election season – jokes, slogans, facts, images, etc. etc. all over the social media. Election and its related stuff became an integral part of our daily discussions. These discussions were ubiquitous and even the managers in the office didn't mind this :-).  Infact elections were a topic even a newbie in the office was able to do without any technical training. There were slogans with such a beautiful rhymes that a 5 year old kid use to say it without fail. Stock exchange was rising like temperature use to rise in June month in North India. We even saw a 25K mark first time on BSE. Most of us even don’t know whether sensex’s rise really means development or were just happy to see it rise !!

Everywhere in the country it was like a mandatory thing to post your voting inked finger’s snaps on facebook, whatsapp etc. to complete your Right to Vote :-) This time parents didn't ask their children to vote but the opposite happened and because of this the country’s voting percentage is the highest till now compared to all the previous general elections. The results were also as expected, infact the political party which was expected to get more than 200 seats out of 543 seats emerged as the single largest party with clear majority getting around 280 seats. The Prime ministerial candidate of this party, the hero of the youth Mr. Narendra Modi kept talking about “good governance and development” is the key to nation’s rise all through his election campaign. I personally don’t know much about him (infact I don’t want to discuss even politics) apart from that he was chief minister of Gujarat for more than 10 years, and Gujarat developed very much under their government as he and his party members use to say. But without the contribution of the state citizens was this achievable? I don’t know exactly how much more or less developed it is in comparison to other states. But yes it is developed, and yes he is our new Prime Minister and yes there are lot of hopes from the countrymen this time that whatever we wanted in this country or how we wanted this country to be like, it will become like that in the coming years.

But why we have so many hopes on this man and his party this time? Why we think that like previous governments there will be no corruption, no unemployment, no poverty etc etc in India. Is Mr. Narendra Modi a magician who will just rotate his wand and all the problems of India will vanish away? He is not a magician, in fact he is also a common man just like us. No nation can become great on the hopes of hard work from a single person, but collective involvement in nation’s development from every single person can make this country great. Change has come in the nation’s election results almost after 2 decades, to make the nation a superpower, a completely developed nation in each and every field in the coming decade we also need to change and follow the moral duties a citizen should do for her/his nation.

The moral duties as imbibed by me from my parents, I try my best to follow them daily even when in some cases I fail to do follow them, I don’t become habitual in failing to follow them. Some of the very common things which I confront in my daily life –

Traffic Lights and rules: they are not meant to be broken but to be followed. Can’t we Indians stop behind the Zebra crossing or wait for Green signal to actually become Green !!

Electricity: It’s not free, it is made after a lot of effort and depletion of natural resources. Please switch off the electrical appliances when they are not needed. I have seen at my friends and relatives home where fans, tube lights etc are kept on all through the day and energy is wasted even when no one is using it. The current generation parents have become so rich that they don’t imbibe these things in their children !!

Roads and footpath are not meant to throw waste, try to search dustbins nearby. If we can search foot stalls on the roadside it should not be difficult to search dustbins also.

For God’s sake stop spitting on roads and stair corners of government offices. I know most of you don’t do but still we find it everywhere in the country. Ask your elders to stop it.

Bribing: The special thing of our country where a boy or girl will shout with full energy in a protest rally against the corruptions going on in the country but will never hesitate to offer 100 rupees to Traffic police to leave her/him after violating a traffic rule.
Save water: It has become scarce in 21st century. I know 70% of earth is covered with water but only 1 % out of it is drinkable, do not decrease that percentage.

I don’t say that I follow each and every one I mentioned above 100% but I keep trying to achieve 100% and it’s not my habit to not follow the basic duty I should be doing for the betterment of the society. Infact I consider not just voting during the elections completes my duties towards the nation but becoming a better citizen every single day will complete my duties towards the nation. There are many other moral duties which can be listed, some I learnt myself as my parents didn’t imbibed those in me as some problems wasn’t present when I was a kid. So it might be a case with many of you that your parents didn’t taught you the moral duties of a good citizen but don’t consider it their fault. We all are educated and education teaches all good things.


There are many other examples or instances where people used to violate the basic moral duty or rules made for the betterment of the society but the same people expect government to be corruption free, nation to be completely developed and all the good things that they can get from the government. They don’t think that it’s their moral duty not just to vote for a political party but to make India a great nation.

Thursday, April 17, 2014

Life is uncertain and so is Death..!!

8:22 PM, 20th March, 2014

Few days back I saw an article of Ruskin Bond shared on facebook. The name of the author itself brings back to me the thousand of memories of my school days, the English literature, my English teachers, and my love of stories. I started googling about his works, his life and even read some of the stories which I read in my school. The first story that came to my mind was "The Woman on Platform 8" which I read in 9th class. I read the whole story on internet and memories started running through my blood and hitting my brain every millisecond.. Suddenly the next name that came to my mind was of Khushwant Singh, another author whose stories touched me a lot or I can say whose way of writing and narrating story I liked very much. I googled about him also and came to know many things that I wasn't aware of... and I closed my searched tabs on the browser of my laptop.


         Today I opened my Facebook account and was scrolling down through the posts, when suddenly I saw the news feed of Khushwant Singh's death at the age of 99. To me his death was not surprise, but surprise to me was how things relate in a mere coincidence in someone's life. All these years after my school I rarely discussed about the English stories or the authors and googling about them was a rare ocassion. But it happened few days back and today something happened related to the person whom I have read, loved his work and learnt a lot from his work..he died..!! Life is uncertain, you really can't predict what can happen the next day, the next hour, the next minute and even the next second. Value the importance of time, time will live all its moments in everybody's life, we need to learn living every moment of time in our life.

Sunday, January 12, 2014

Shayari Collection-----“DIL SE”

  •   Aankhein tarasti tumhe dekhne ke liye, aankhein bheeg jaati hai tumse duur hoke, dekho rooth na jaana humse nhi to ye aankhein hi band ho jayengi tumhe khafa dekh ke.

  •  Tere ehsaas se meri subah hoti hai, tere ehsaas se hi meri sham hoti hai, tu saath hai to ye zindagi - zindagi si lagti hai, jo tu saath ni to ye zindagi bhi ek avsaad lagti h.

  •  Hum hi hum hai to kya hum hai, tum hi tum ho kya tum ho, yeh zindagi rahegi to naamo-nishaan rahega, jo ye zindagi hi nhi rahegi to kya tera rahega aur kya mera rahega.
 
  •   Kabhi wo khafa the humse, kabhi hum khafa the unse, zindagi me palat kar jab bhi dekha, to deewane se lagte the kasam se. Wo choti-badi baaton pe roothna aur fir manana, aaj wohi roothne manane ko taraste hai kasam se..

  •  Aadhi raat ka waqt hai, bas chaand ka saath hai, door tak na koi shor hai na koi awaaz hai, bas tumhara hi tumhara khayal hai Aaj khwabon me nahi khayalo me tera ehsaas hai.. kya tera bhi yehi haal hai..

  •  Aaj phir dil ne unko yaad kia, aaj phir dil ne unka Khayal kia..Kuch der phir unko yaad kia, aankhon ko apni num kia..Wo beete pal aankhon ko rula dete hai, unke khayal humko tadpa dete hai, Wo chale to gaye zindagi se hamari, lekin apni yaadein chodd gaye peeche saari, Zindagi me ye to na socha tha ke aise bhi din aayenge, unke bina zindagi hogi, kya aise bhi din aayenge..!! 
    Kabhi dekha tha unko khwabon me apne saare, hosh na laga aur tuut gaye sapne saare..
    Aaj phir Dil ne unko yaad kia, aaj phir Dil ne unka Khayal kia.. Kuch der phir unko yaad kia, aankhon ko apni num kia.

  •  Woh aaye hamari galiyon me kuch iss tarah, ki kabhi hum unko dekhe to kabhi who humein…  nazrein milate- milate na jaane kab dil mil gaye, do anjane ek duje ke deewane ho gaye..

  •  Teri yaadon ke sahare mai jiya ja rha hun, kiya tha tujhse pyaar aaj bhi kiye ja rha hun.. Tu na samjhi mere wo jazbaat , karne chahe the maine izhaar karte huye tujse har ek baat. Aaj unn baaton ko yaad karke, apni mushkuraahaton me aansuo ko peeye ja rha hun.


  •  Dhadkane badha ke sanam, tum humse dhadkano ko thamne ki baat karte ho.. humari to dhadkane ab tumhare deedaar ko tarasti hai.. jaldi aakar sambhal lo inhe kyunki ab ye tumhari udhaar si lagti hai..!!

  •  Manzil ke khone ka darr na ho to safar haseen lagne lagte hain, Saath doston ka ho to faasle kam lagne lagte hain.. Yun to har safar me khushiyaan aur gum milte hain, kabhi khushiyaan kam to kabhi gum jyada milte hai.. Gamo ke milne se safar ko rukne na do, dosto ke saath ko kabhi khone na do.. Dosti to Khuda ka wo tohfa hai, jisse thukrana jannat ko thukraane ke jesa hai..

  •  Chaand ki roshni se aasman jagmaya hua tha, neend ka mujhe kuch pata na tha. Jehan me purane haseen palo ka khayal tha.. Chehre pe mushkurahat aur hasi ka ek shararti milan tha.. Yaadon me teri kuch iss tarah khoya hua sa tha , karwato ko badalne ka silsila kuch iss tarah se chal raha tha, ki subah kab hui kuch pata na tha … bas jab aankh khuli to khud ko akela sa paaya tha , na chaand tha na chaand ki roshni thi.. tere khayalo ne bhi mujhe akela chodd ke alvida keh dia tha..

  •  Ke tere didaar ki hum kbse aas lagaye baithe the.. darr tha ki kahin ye umar na nikal jaye aur hum taraste hi reh jaaye...Par aaj sun li uss Khuda ne hamari... aur nazron ko aakhir dekhne ko mil gai ek pyaari si dost hamari..

  •  Maana k hum tmhare kuch nahi lagte..phir bhi jane anjane ek dusre ko hum h jante.. kabhi aapko hamara khayal aaye ya na aaye.. hamare to aksar khayalon me hmesha aap hi aap nazar aaye.......

  •  Tu hai mere aas paas to khushnaseeb sa mehsus karta hu, teri mushkurahaton ko dekhkar apne dil ko khush karta rhta hun.. Hai teri pyaari si awaaz ka asar mujhpe itna ki apne gamo ko bhi mai hasee me bhula deta hun..