Friday, June 29, 2012

Android and YouTube

One of my application requires playing YouTube Videos. As always I was probing for the query. And I got a very nice solution and also got to know an interesting fact about how we can extract you tube thumbnail URL from the Video URL.


To play a you tube Video from your application first of all you need the YouTube Video ID which you can easily get from the YouTube Video URL.


For Example you have YouTube URL


http://www.youtube.com/watch?v=aIqzxU6mG8M


Here you have a video ID v = alqzxU6mG8M


So you just need to pass this Video ID to the intent and it will play the video.

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube://" + "aIqzxU6mG8M"));
startActivity(intent);

Now lets see how we can get the YouTube Video thumbnail from this Video ID




You just need to substitute the Video ID to the above URL.

0.jpg is a full sized image. The other two are very small and are taken automatically by YouTube from two certain points in the video.

Friday, May 11, 2012

Trust

"TRUST" A very simple word and also a word that can be easily kept for anyone. In our daily life we meet a number of people. We talk, we laugh, we share and then slowly we develop good relationships. This can be termed as  a law of nature. There is faith, respect, care, understanding and lot more things. But as a matter of fact, its not the same forever. By another law of nature which is called "CHANGE" comes into role. People change, they do change and the change can be for the betterment or it can also be for detriment.

We trust and even develop a kind of bonding that we expect to last forever. And also those sparkling moments we share convince our hearts completely that the person is never going to break the bond and will be there for you, with you, always. Its not at all necessary that all the moments we spend are happening, its very obvious that once you develop trust for someone then you may have a lot of expectations. Yeah now comes the twist. You see I have mentioned a very big word here "EXPECTATIONS". Well what should I say, this word is the creator and this is also the destroyer.

Again if I talk about expectations then its not at all the case that two people have same level of expectations from each other. In fact I have seen some people they don't expect anything from you and that is the best thing to have. But you see, you will always get the best that's not possible. Now the sparkling moments becomes a burden. Things change, respect turns into abasement, understanding becomes misunderstanding, and care is  completely out of question. Now in such an unattractive situation you are not left with any other option and so you end up everything. 

Its very easy to gain someone's "trust" and its much more easier to break someone's "trust" but its very difficult to honor that "trust".