Code example for Random

0
   private MediaPlayer mPlayer;
   private Random rnd;
 
   public MediaPlayerInvokeTest() { 
       super("com.android.mediaframeworktest", MediaFrameworkTest.class); 
       rnd = new Random(Calendar.getInstance().getTimeInMillis());
    } 
 
    @Override 
    protected void setUp() throws Exception { 
      super.setUp(); 
      mPlayer = new MediaPlayer();
    } 
 
    @Override 
    protected void tearDown() throws Exception { 
        mPlayer.release();
        super.tearDown(); 
    } 
 
    // Generate a random number, sends it to the ping test player.