tags:

views:

35

answers:

1

I m developing a card game in android. i need to show three cards out of 52 cards by button click through animation which should be random cards.

so how can i do that?

+1  A: 

If you are storing the cards in an Array or ArrayList you could easily generate a random number using Randoms nextInt(52) method. This method will give you a random int between 0 and 51 and you can then use this as the index to get the card out of the list.

For the animation that depends on what kind of animation you want and what kind of graphics and Views you have. Have a look at the animation package and come back with a more specific question we would be happy to answer it.

Janusz