Saturday, March 23, 2013

Create a Poker Game in Android

Firstly i told you a very true its my first running project. When i create that project in beginning i have no basic idea in android. But devloper.android.com its very helpful for me to understand this topic and that subject.
In that project you have lots import these thing like bundle, handler, Message, Activity, Resources, Draw able, Log, Menu, View,and etc.
In that project you know how to handle of C because if you don't have knowledge of  C then firstly you learn the C, XML, Java.
Then we come to my project and get the random number. And i told you in this project i take 56 cards in that project because it have 52 cads of different suits and four joker because in the champion poker game make a pair joker, four pair of joker and if joker came then payment is double.

package com.example.championpoker;

import java.util.Random;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends Activity
{


Button btnShow;
Button btnShow1;
ImageView ivCard1,ivCard2,ivCard3,ivCard4,ivCard5;
Drawable [] ivCardarray=new Drawable[56];
LayerDrawable layerCard;
Resources g_resource;
int suit[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3};
int rank[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
int FinalCardArr[]= new int[5];

public Handler mHandlerBet=new Handler()
{
public void handleMessage(Message msg)
{
Showfunction();


}
};



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

btnShow=(Button)findViewById(R.id.button1);
btnShow1=(Button)findViewById(R.id.button2);


ivCard1=(ImageView)findViewById(R.id.imageView1);
ivCard2=(ImageView)findViewById(R.id.imageView2);
ivCard3=(ImageView)findViewById(R.id.imageView3);
ivCard4=(ImageView)findViewById(R.id.imageView4);
ivCard5=(ImageView)findViewById(R.id.imageView5);
g_resource=getResources();

ivCardarray[0]=g_resource.getDrawable(R.drawable.sa);
ivCardarray[1]=g_resource.getDrawable(R.drawable.s2);
ivCardarray[2]=g_resource.getDrawable(R.drawable.s3);
ivCardarray[3]=g_resource.getDrawable(R.drawable.s4);
ivCardarray[4]=g_resource.getDrawable(R.drawable.s5);
ivCardarray[5]=g_resource.getDrawable(R.drawable.s6);
ivCardarray[6]=g_resource.getDrawable(R.drawable.s7);
ivCardarray[7]=g_resource.getDrawable(R.drawable.s8);
ivCardarray[8]=g_resource.getDrawable(R.drawable.s9);
ivCardarray[9]=g_resource.getDrawable(R.drawable.s10);
ivCardarray[10]=g_resource.getDrawable(R.drawable.sj);
ivCardarray[11]=g_resource.getDrawable(R.drawable.sq);
ivCardarray[12]=g_resource.getDrawable(R.drawable.sk);
ivCardarray[13]=g_resource.getDrawable(R.drawable.joker);
ivCardarray[14]=g_resource.getDrawable(R.drawable.ha);
ivCardarray[15]=g_resource.getDrawable(R.drawable.h2);
ivCardarray[16]=g_resource.getDrawable(R.drawable.h3);
ivCardarray[17]=g_resource.getDrawable(R.drawable.h4);
ivCardarray[18]=g_resource.getDrawable(R.drawable.h5);
ivCardarray[19]=g_resource.getDrawable(R.drawable.h6);
ivCardarray[20]=g_resource.getDrawable(R.drawable.h7);
ivCardarray[21]=g_resource.getDrawable(R.drawable.h8);
ivCardarray[22]=g_resource.getDrawable(R.drawable.h9);
ivCardarray[23]=g_resource.getDrawable(R.drawable.h10);
ivCardarray[24]=g_resource.getDrawable(R.drawable.hj);
ivCardarray[25]=g_resource.getDrawable(R.drawable.hq);
ivCardarray[26]=g_resource.getDrawable(R.drawable.hk);
ivCardarray[27]=g_resource.getDrawable(R.drawable.joker);
ivCardarray[28]=g_resource.getDrawable(R.drawable.da);
ivCardarray[29]=g_resource.getDrawable(R.drawable.d2);
ivCardarray[30]=g_resource.getDrawable(R.drawable.d3);
ivCardarray[31]=g_resource.getDrawable(R.drawable.d4);
ivCardarray[32]=g_resource.getDrawable(R.drawable.d5);
ivCardarray[33]=g_resource.getDrawable(R.drawable.d6);
ivCardarray[34]=g_resource.getDrawable(R.drawable.d7);
ivCardarray[35]=g_resource.getDrawable(R.drawable.d8);
ivCardarray[36]=g_resource.getDrawable(R.drawable.d9);
ivCardarray[37]=g_resource.getDrawable(R.drawable.d10);
ivCardarray[38]=g_resource.getDrawable(R.drawable.dj);
ivCardarray[39]=g_resource.getDrawable(R.drawable.dq);
ivCardarray[40]=g_resource.getDrawable(R.drawable.dk);
ivCardarray[41]=g_resource.getDrawable(R.drawable.joker);
ivCardarray[42]=g_resource.getDrawable(R.drawable.fa);
ivCardarray[43]=g_resource.getDrawable(R.drawable.f2);
ivCardarray[44]=g_resource.getDrawable(R.drawable.f3);
ivCardarray[45]=g_resource.getDrawable(R.drawable.f4);
ivCardarray[46]=g_resource.getDrawable(R.drawable.f5);
ivCardarray[47]=g_resource.getDrawable(R.drawable.f6);
ivCardarray[48]=g_resource.getDrawable(R.drawable.f7);
ivCardarray[49]=g_resource.getDrawable(R.drawable.f8);
ivCardarray[50]=g_resource.getDrawable(R.drawable.f9);
ivCardarray[51]=g_resource.getDrawable(R.drawable.f10);
ivCardarray[52]=g_resource.getDrawable(R.drawable.fj);
ivCardarray[53]=g_resource.getDrawable(R.drawable.fq);
ivCardarray[54]=g_resource.getDrawable(R.drawable.fk);
ivCardarray[55]=g_resource.getDrawable(R.drawable.joker);
layerCard=new LayerDrawable(ivCardarray);


btnShow.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
ivCard1.setImageDrawable(null);
ivCard2.setImageDrawable(null);
ivCard3.setImageDrawable(null);
ivCard4.setImageDrawable(null);
ivCard5.setImageDrawable(null);
//mHandlerBet.obtainMessage(1).sendToTarget();
}

});

btnShow1.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

mHandlerBet.obtainMessage(1).sendToTarget();


}
});

}





public void Showfunction()
{

/*int   i,k;
  int uniqNoArr[] = new int[10];
  int ranNoArr[] = new int [10];
      //int FinalCardArr[] =  new int[5];
  for(i = 0; i <= 9;)
{
 uniqNoArr[i] = ranNoArr[i] = (int) Math.random() % 52;
for(int j= 0; j < i; j++)
{
if(ranNoArr[j] == ranNoArr[i])
{
 uniqNoArr[i] = ranNoArr[i] = (int)Math.random() % 52;
 j= -1;
}
}
 i++;
}
  FinalCardArr [0] = uniqNoArr[0];
  FinalCardArr [1] = uniqNoArr[1];
  FinalCardArr [2] = uniqNoArr[2];
  FinalCardArr [3] = uniqNoArr[3];
  FinalCardArr [4] = uniqNoArr[4];
for(int x=0;i<5 i="i" p="p"> Log.d("random number", Integer.toString(FinalCardArr[i]));
*/


int n=0;
Random r=new Random();
int[]number=new int[5];
/*for(int i=0;i<5 i="i" p="p"> {
n=r.nextInt(56);
if(i > 0)
{
for(int j=0;j<=i;j++)
{
if (n == number[j])
{
i--;
continue;
}
}

}
number[i]=n;
}*/
int i=0;
boolean data=false;
do
{
data=false;
n=r.nextInt(56);
if(i > 0)
{
for(int j=0;j<=i;j++)
{
if (n == number[j])
data=true;
}

}
if(!data)
{
number[i]=n;
i++;
}

}while(i<5 p="p">


for(i=0;i<5 i="i" p="p"> Log.d("random number", Integer.toString(number[i]));


ivCard1.setImageDrawable(layerCard.getDrawable(number[0]));
ivCard2.setImageDrawable(layerCard.getDrawable(number[1]));
ivCard3.setImageDrawable(layerCard.getDrawable(number[2]));
ivCard4.setImageDrawable(layerCard.getDrawable(number[3]));
ivCard5.setImageDrawable(layerCard.getDrawable(number[4]));

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

}

Thursday, February 21, 2013

Android Error

It is the error on my log on eclipse software. And its is that error is ANDROID emulator error.
RANDOM  is my emulator name.

02-21 16:49:08.555: D/ddm-heap(249): Got feature list request
02-21 16:51:48.455: D/random number(249): 41
02-21 16:51:48.455: D/random number(249): 34
02-21 16:51:48.455: D/random number(249): 12
02-21 16:51:48.455: D/random number(249): 53
02-21 16:51:48.455: D/random number(249): 52
02-21 16:51:48.774: D/dalvikvm(249): GC freed 11976 objects / 417944 bytes in 68ms
02-21 16:51:50.015: D/random number(249): 5
02-21 16:51:50.015: D/random number(249): 14
02-21 16:51:50.015: D/random number(249): 2
02-21 16:51:50.015: D/random number(249): 10
02-21 16:51:50.015: D/random number(249): 11
02-21 16:51:53.075: D/dalvikvm(249): GC freed 17270 objects / 606984 bytes in 69ms
02-21 16:51:57.725: D/dalvikvm(249): GC freed 16235 objects / 578120 bytes in 69ms
02-21 16:52:02.175: D/dalvikvm(249): GC freed 16098 objects / 570368 bytes in 66ms
02-21 16:52:06.625: D/dalvikvm(249): GC freed 16095 objects / 569912 bytes in 72ms
02-21 16:52:10.855: D/dalvikvm(249): GC freed 16112 objects / 570992 bytes in 67ms
02-21 16:52:15.236: D/dalvikvm(249): GC freed 16067 objects / 569224 bytes in 62ms
02-21 16:52:19.715: D/dalvikvm(249): GC freed 16081 objects / 569640 bytes in 102ms
02-21 16:52:24.015: D/dalvikvm(249): GC freed 16116 objects / 571368 bytes in 62ms
02-21 16:52:28.374: D/dalvikvm(249): GC freed 16107 objects / 570312 bytes in 64ms
02-21 16:52:32.865: D/dalvikvm(249): GC freed 16085 objects / 570144 bytes in 70ms
02-21 16:52:37.015: D/dalvikvm(249): GC freed 16106 objects / 570200 bytes in 68ms
02-21 16:52:41.595: D/dalvikvm(249): GC freed 16071 objects / 569520 bytes in 65ms
02-21 16:52:45.865: D/dalvikvm(249): GC freed 16130 objects / 571352 bytes in 69ms
02-21 16:52:50.245: D/dalvikvm(249): GC freed 16072 objects / 569424 bytes in 86ms
02-21 16:52:54.625: D/dalvikvm(249): GC freed 16113 objects / 571336 bytes in 67ms
02-21 16:52:55.595: D/random number(249): 32
02-21 16:52:55.595: D/random number(249): 44
02-21 16:52:55.595: D/random number(249): 27
02-21 16:52:55.595: D/random number(249): 9
02-21 16:52:55.595: D/random number(249): 53
02-21 16:52:56.725: D/random number(249): 4
02-21 16:52:56.725: D/random number(249): 0
02-21 16:52:56.725: D/random number(249): 3
02-21 16:52:56.725: D/random number(249): 20
02-21 16:52:56.725: D/random number(249): 24
02-21 16:52:58.735: D/dalvikvm(249): GC freed 15966 objects / 567672 bytes in 71ms
02-21 16:53:03.294: D/dalvikvm(249): GC freed 16222 objects / 576936 bytes in 87ms
02-21 16:53:11.144: D/dalvikvm(249): GC freed 15834 objects / 570992 bytes in 79ms
02-21 16:53:16.035: D/dalvikvm(249): GC freed 15974 objects / 569848 bytes in 79ms
02-21 16:53:20.655: D/dalvikvm(249): GC freed 16083 objects / 569672 bytes in 241ms
02-21 16:53:26.805: D/dalvikvm(249): GC freed 15945 objects / 570704 bytes in 209ms
02-21 16:53:31.715: D/dalvikvm(249): GC freed 15963 objects / 570176 bytes in 64ms
02-21 16:53:35.985: D/dalvikvm(282): GC freed 996 objects / 70376 bytes in 74ms
02-21 16:57:34.925: D/dalvikvm(282): GC freed 12122 objects / 420792 bytes in 65ms
02-21 16:57:35.714: D/random number(282): 15
02-21 16:57:35.714: D/random number(282): 29
02-21 16:57:35.714: D/random number(282): 33
02-21 16:57:35.714: D/random number(282): 41
02-21 16:57:35.714: D/random number(282): 16
02-21 16:57:38.455: D/random number(282): 8
02-21 16:57:38.466: D/random number(282): 25
02-21 16:57:38.466: D/random number(282): 10
02-21 16:57:38.466: D/random number(282): 33
02-21 16:57:38.466: D/random number(282): 1
02-21 16:57:39.425: D/dalvikvm(282): GC freed 17055 objects / 601032 bytes in 71ms
02-21 16:57:40.955: D/random number(282): 10
02-21 16:57:40.955: D/random number(282): 23
02-21 16:57:40.955: D/random number(282): 48
02-21 16:57:40.955: D/random number(282): 46
02-21 16:57:40.968: D/random number(282): 3
02-21 16:57:43.395: D/dalvikvm(282): GC freed 16173 objects / 574000 bytes in 67ms
02-21 16:57:44.245: D/random number(282): 12
02-21 16:57:44.245: D/random number(282): 41
02-21 16:57:44.245: D/random number(282): 17
02-21 16:57:44.245: D/random number(282): 11
02-21 16:57:44.245: D/random number(282): 44
02-21 16:57:46.085: D/random number(282): 46
02-21 16:57:46.095: D/random number(282): 51
02-21 16:57:46.095: D/random number(282): 28
02-21 16:57:46.095: D/random number(282): 53
02-21 16:57:46.095: D/random number(282): 12
02-21 16:57:46.986: D/dalvikvm(282): GC freed 16178 objects / 572712 bytes in 66ms
02-21 16:57:48.325: D/random number(282): 20
02-21 16:57:48.325: D/random number(282): 41
02-21 16:57:48.325: D/random number(282): 39
02-21 16:57:48.325: D/random number(282): 24
02-21 16:57:48.325: D/random number(282): 26
02-21 16:57:50.685: D/dalvikvm(282): GC freed 16127 objects / 571192 bytes in 216ms
02-21 16:57:52.826: D/random number(282): 51
02-21 16:57:52.835: D/random number(282): 50
02-21 16:57:52.856: D/random number(282): 0
02-21 16:57:52.865: D/random number(282): 11
02-21 16:57:52.865: D/random number(282): 43
02-21 16:57:55.006: D/dalvikvm(282): GC freed 18262 objects / 642968 bytes in 93ms
02-21 16:57:55.225: D/random number(282): 30
02-21 16:57:55.225: D/random number(282): 35
02-21 16:57:55.225: D/random number(282): 28
02-21 16:57:55.225: D/random number(282): 5
02-21 16:57:55.225: D/random number(282): 26
02-21 16:57:57.498: D/random number(282): 8
02-21 16:57:57.498: D/random number(282): 17
02-21 16:57:57.498: D/random number(282): 22
02-21 16:57:57.498: D/random number(282): 34
02-21 16:57:57.498: D/random number(282): 53
02-21 16:57:58.354: D/dalvikvm(282): GC freed 16519 objects / 582608 bytes in 66ms
02-21 16:58:00.295: D/random number(282): 42
02-21 16:58:00.295: D/random number(282): 47
02-21 16:58:00.305: D/random number(282): 24
02-21 16:58:00.305: D/random number(282): 31
02-21 16:58:00.305: D/random number(282): 16
02-21 16:58:01.430: D/dalvikvm(282): GC freed 16690 objects / 587352 bytes in 66ms
02-21 16:58:02.295: D/random number(282): 42
02-21 16:58:02.295: D/random number(282): 32
02-21 16:58:02.295: D/random number(282): 47
02-21 16:58:02.295: D/random number(282): 12
02-21 16:58:02.295: D/random number(282): 48
02-21 16:58:04.675: D/dalvikvm(282): GC freed 16741 objects / 586696 bytes in 206ms
02-21 16:58:05.045: D/random number(282): 45
02-21 16:58:05.045: D/random number(282): 27
02-21 16:58:05.045: D/random number(282): 20
02-21 16:58:05.045: D/random number(282): 48
02-21 16:58:05.045: D/random number(282): 12
02-21 16:58:06.914: D/random number(282): 55
02-21 16:58:06.914: D/random number(282): 18
02-21 16:58:06.914: D/random number(282): 35
02-21 16:58:06.914: D/random number(282): 54
02-21 16:58:06.914: D/random number(282): 40
02-21 16:58:07.825: D/dalvikvm(282): GC freed 16455 objects / 580712 bytes in 70ms
02-21 16:58:09.125: D/random number(282): 24
02-21 16:58:09.125: D/random number(282): 40
02-21 16:58:09.125: D/random number(282): 1
02-21 16:58:09.125: D/random number(282): 13
02-21 16:58:09.125: D/random number(282): 27
02-21 16:58:10.745: D/dalvikvm(282): GC freed 16626 objects / 585072 bytes in 66ms
02-21 16:58:11.095: D/random number(282): 33
02-21 16:58:11.095: D/random number(282): 31
02-21 16:58:11.095: D/random number(282): 50
02-21 16:58:11.095: D/random number(282): 49
02-21 16:58:11.095: D/random number(282): 32
02-21 16:58:13.135: D/random number(282): 35
02-21 16:58:13.135: D/random number(282): 5
02-21 16:58:13.135: D/random number(282): 3
02-21 16:58:13.135: D/random number(282): 41
02-21 16:58:13.135: D/random number(282): 11
02-21 16:58:13.845: D/dalvikvm(282): GC freed 16866 objects / 590016 bytes in 69ms
02-21 16:58:14.915: D/random number(282): 12
02-21 16:58:14.915: D/random number(282): 50
02-21 16:58:14.915: D/random number(282): 54
02-21 16:58:14.915: D/random number(282): 32
02-21 16:58:14.915: D/random number(282): 2
02-21 16:58:16.615: D/dalvikvm(282): GC freed 16740 objects / 588440 bytes in 78ms
02-21 16:58:17.335: D/random number(282): 49
02-21 16:58:17.335: D/random number(282): 33
02-21 16:58:17.335: D/random number(282): 0
02-21 16:58:17.335: D/random number(282): 9
02-21 16:58:17.335: D/random number(282): 14
02-21 16:58:18.935: D/random number(282): 7
02-21 16:58:18.935: D/random number(282): 36
02-21 16:58:18.935: D/random number(282): 2
02-21 16:58:18.944: D/random number(282): 25
02-21 16:58:18.944: D/random number(282): 4
02-21 16:58:19.265: D/dalvikvm(282): GC freed 16701 objects / 583800 bytes in 86ms
02-21 16:58:20.965: D/random number(282): 54
02-21 16:58:20.965: D/random number(282): 37
02-21 16:58:20.965: D/random number(282): 2
02-21 16:58:20.965: D/random number(282): 5
02-21 16:58:20.965: D/random number(282): 15
02-21 16:58:21.805: D/dalvikvm(282): GC freed 17030 objects / 595120 bytes in 73ms
02-21 16:58:23.355: D/random number(282): 20
02-21 16:58:23.355: D/random number(282): 4
02-21 16:58:23.365: D/random number(282): 5
02-21 16:58:23.365: D/random number(282): 0
02-21 16:58:23.365: D/random number(282): 23
02-21 16:58:24.285: D/dalvikvm(282): GC freed 16920 objects / 590456 bytes in 79ms
02-21 16:58:24.435: D/AndroidRuntime(282): Shutting down VM
02-21 16:58:24.435: W/dalvikvm(282): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
02-21 16:58:24.435: E/AndroidRuntime(282): Uncaught handler: thread main exiting due to uncaught exception
02-21 16:58:24.445: E/AndroidRuntime(282): java.lang.ArrayIndexOutOfBoundsException
02-21 16:58:24.445: E/AndroidRuntime(282):       at com.example.championpoker.MainActivity.Showfunction1(MainActivity.java:496)
02-21 16:58:24.445: E/AndroidRuntime(282):       at com.example.championpoker.MainActivity$1.handleMessage(MainActivity.java:69)
02-21 16:58:24.445: E/AndroidRuntime(282):       at android.os.Handler.dispatchMessage(Handler.java:99)
02-21 16:58:24.445: E/AndroidRuntime(282):       at android.os.Looper.loop(Looper.java:123)
02-21 16:58:24.445: E/AndroidRuntime(282):       at android.app.ActivityThread.main(ActivityThread.java:4363)
02-21 16:58:24.445: E/AndroidRuntime(282):       at java.lang.reflect.Method.invokeNative(Native Method)
02-21 16:58:24.445: E/AndroidRuntime(282):       at java.lang.reflect.Method.invoke(Method.java:521)
02-21 16:58:24.445: E/AndroidRuntime(282):       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-21 16:58:24.445: E/AndroidRuntime(282):       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-21 16:58:24.445: E/AndroidRuntime(282):       at dalvik.system.NativeStart.main(Native Method)
02-21 16:58:24.462: I/dalvikvm(282): threadid=7: reacting to signal 3
02-21 16:58:24.462: E/dalvikvm(282): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
02-21 16:58:26.375: I/Process(282): Sending signal. PID: 282 SIG: 9
02-21 17:00:09.775: D/dalvikvm(5720): GC freed 1018 objects / 71232 bytes in 53ms
02-21 17:00:13.425: D/random number(5720): 40
02-21 17:00:13.434: D/random number(5720): 47
02-21 17:00:13.434: D/random number(5720): 53
02-21 17:00:13.434: D/random number(5720): 28
02-21 17:00:13.434: D/random number(5720): 29
02-21 17:00:14.895: D/random number(5720): 11
02-21 17:00:14.895: D/random number(5720): 0
02-21 17:00:14.895: D/random number(5720): 41
02-21 17:00:14.895: D/random number(5720): 15
02-21 17:00:14.895: D/random number(5720): 20
02-21 17:00:15.265: D/dalvikvm(5720): GC freed 11726 objects / 414048 bytes in 67ms
02-21 17:00:16.455: D/random number(5720): 44
02-21 17:00:16.468: D/random number(5720): 4
02-21 17:00:16.468: D/random number(5720): 33
02-21 17:00:16.468: D/random number(5720): 46
02-21 17:00:16.468: D/random number(5720): 34
02-21 17:00:18.356: D/random number(5720): 50
02-21 17:00:18.356: D/random number(5720): 53
02-21 17:00:18.356: D/random number(5720): 10
02-21 17:00:18.356: D/random number(5720): 5
02-21 17:00:18.356: D/random number(5720): 21
02-21 17:00:19.145: D/dalvikvm(5720): GC freed 16817 objects / 592608 bytes in 73ms
02-21 17:00:20.505: D/random number(5720): 5
02-21 17:00:20.505: D/random number(5720): 32
02-21 17:00:20.505: D/random number(5720): 24
02-21 17:00:20.505: D/random number(5720): 47
02-21 17:00:20.505: D/random number(5720): 36
02-21 17:00:22.795: D/dalvikvm(5720): GC freed 16181 objects / 576000 bytes in 104ms
02-21 17:00:24.655: D/random number(5720): 54
02-21 17:00:24.655: D/random number(5720): 1
02-21 17:00:24.655: D/random number(5720): 15
02-21 17:00:24.655: D/random number(5720): 16
02-21 17:00:24.655: D/random number(5720): 10
02-21 17:00:26.195: D/dalvikvm(5720): GC freed 16407 objects / 578328 bytes in 76ms
02-21 17:00:26.485: D/random number(5720): 21
02-21 17:00:26.485: D/random number(5720): 0
02-21 17:00:26.485: D/random number(5720): 17
02-21 17:00:26.485: D/random number(5720): 41
02-21 17:00:26.485: D/random number(5720): 54
02-21 17:00:28.376: D/random number(5720): 48
02-21 17:00:28.376: D/random number(5720): 44
02-21 17:00:28.376: D/random number(5720): 29
02-21 17:00:28.376: D/random number(5720): 27
02-21 17:00:28.376: D/random number(5720): 1
02-21 17:00:29.355: D/dalvikvm(5720): GC freed 16442 objects / 579928 bytes in 68ms
02-21 17:00:29.915: D/random number(5720): 47
02-21 17:00:29.915: D/random number(5720): 46
02-21 17:00:29.915: D/random number(5720): 55
02-21 17:00:29.915: D/random number(5720): 48
02-21 17:00:29.915: D/random number(5720): 36
02-21 17:00:31.455: D/random number(5720): 3
02-21 17:00:31.455: D/random number(5720): 33
02-21 17:00:31.455: D/random number(5720): 16
02-21 17:00:31.455: D/random number(5720): 43
02-21 17:00:31.455: D/random number(5720): 51
02-21 17:00:32.915: D/dalvikvm(5720): GC freed 17898 objects / 633440 bytes in 71ms
02-21 17:00:33.315: D/random number(5720): 51
02-21 17:00:33.325: D/random number(5720): 26
02-21 17:00:33.325: D/random number(5720): 46
02-21 17:00:33.325: D/random number(5720): 39
02-21 17:00:33.325: D/random number(5720): 40
02-21 17:00:34.755: D/random number(5720): 22
02-21 17:00:34.755: D/random number(5720): 37
02-21 17:00:34.755: D/random number(5720): 26
02-21 17:00:34.755: D/random number(5720): 7
02-21 17:00:34.755: D/random number(5720): 2
02-21 17:00:35.614: D/dalvikvm(5720): GC freed 16802 objects / 590936 bytes in 65ms
02-21 17:00:36.675: D/random number(5720): 22
02-21 17:00:36.675: D/random number(5720): 39
02-21 17:00:36.675: D/random number(5720): 30
02-21 17:00:36.675: D/random number(5720): 5
02-21 17:00:36.675: D/random number(5720): 28
02-21 17:00:38.095: D/random number(5720): 7
02-21 17:00:38.095: D/random number(5720): 38
02-21 17:00:38.095: D/random number(5720): 21
02-21 17:00:38.095: D/random number(5720): 41
02-21 17:00:38.095: D/random number(5720): 6
02-21 17:00:38.275: D/dalvikvm(5720): GC freed 16602 objects / 583872 bytes in 71ms
02-21 17:00:39.685: D/random number(5720): 8
02-21 17:00:39.685: D/random number(5720): 4
02-21 17:00:39.685: D/random number(5720): 18
02-21 17:00:39.685: D/random number(5720): 53
02-21 17:00:39.685: D/random number(5720): 1
02-21 17:00:40.935: D/dalvikvm(5720): GC freed 16826 objects / 590448 bytes in 70ms
02-21 17:00:42.946: D/random number(5720): 31
02-21 17:00:42.946: D/random number(5720): 20
02-21 17:00:42.956: D/random number(5720): 22
02-21 17:00:42.956: D/random number(5720): 43
02-21 17:00:42.956: D/random number(5720): 38
02-21 17:00:43.465: D/dalvikvm(5720): GC freed 16688 objects / 582528 bytes in 71ms
02-21 17:00:45.125: D/random number(5720): 3
02-21 17:00:45.135: D/random number(5720): 44
02-21 17:00:45.135: D/random number(5720): 7
02-21 17:00:45.135: D/random number(5720): 23
02-21 17:00:45.135: D/random number(5720): 50
02-21 17:00:46.055: D/dalvikvm(5720): GC freed 17031 objects / 596024 bytes in 68ms
02-21 17:00:48.166: D/random number(5720): 5
02-21 17:00:48.166: D/random number(5720): 24
02-21 17:00:48.166: D/random number(5720): 51
02-21 17:00:48.166: D/random number(5720): 31
02-21 17:00:48.166: D/random number(5720): 37
02-21 17:00:48.555: D/dalvikvm(5720): GC freed 16769 objects / 584296 bytes in 71ms
02-21 17:00:50.826: D/random number(5720): 38
02-21 17:00:50.826: D/random number(5720): 41
02-21 17:00:50.826: D/random number(5720): 18
02-21 17:00:50.826: D/random number(5720): 8
02-21 17:00:50.835: D/random number(5720): 13
02-21 17:00:51.025: D/dalvikvm(5720): GC freed 16999 objects / 592976 bytes in 66ms
02-21 17:00:53.485: D/random number(5720): 52
02-21 17:00:53.485: D/random number(5720): 34
02-21 17:00:53.485: D/random number(5720): 46
02-21 17:00:53.485: D/random number(5720): 31
02-21 17:00:53.485: D/random number(5720): 33
02-21 17:00:53.565: D/dalvikvm(5720): GC freed 16964 objects / 592096 bytes in 76ms
02-21 17:00:56.035: D/dalvikvm(5720): GC freed 16976 objects / 591920 bytes in 71ms
02-21 17:00:57.145: D/random number(5720): 45
02-21 17:00:57.155: D/random number(5720): 17
02-21 17:00:57.155: D/random number(5720): 35
02-21 17:00:57.155: D/random number(5720): 12
02-21 17:00:57.155: D/random number(5720): 49
02-21 17:00:58.585: D/dalvikvm(5720): GC freed 16964 objects / 592392 bytes in 73ms
02-21 17:00:59.165: D/random number(5720): 27
02-21 17:00:59.165: D/random number(5720): 9
02-21 17:00:59.165: D/random number(5720): 28
02-21 17:00:59.165: D/random number(5720): 38
02-21 17:00:59.165: D/random number(5720): 13
02-21 17:01:01.054: D/random number(5720): 6
02-21 17:01:01.054: D/random number(5720): 39
02-21 17:01:01.054: D/random number(5720): 16
02-21 17:01:01.054: D/random number(5720): 2
02-21 17:01:01.054: D/random number(5720): 48
02-21 17:01:01.159: D/dalvikvm(5720): GC freed 16843 objects / 588488 bytes in 73ms
02-21 17:01:02.715: D/random number(5720): 24
02-21 17:01:02.715: D/random number(5720): 45
02-21 17:01:02.715: D/random number(5720): 47
02-21 17:01:02.724: D/random number(5720): 49
02-21 17:01:02.724: D/random number(5720): 29
02-21 17:01:03.855: D/AndroidRuntime(5720): Shutting down VM
02-21 17:01:03.855: W/dalvikvm(5720): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
02-21 17:01:03.855: E/AndroidRuntime(5720): Uncaught handler: thread main exiting due to uncaught exception
02-21 17:01:03.934: D/dalvikvm(5720): GC freed 16693 objects / 591136 bytes in 73ms
02-21 17:01:03.934: E/AndroidRuntime(5720): java.lang.ArrayIndexOutOfBoundsException
02-21 17:01:03.934: E/AndroidRuntime(5720):     at com.example.championpoker.MainActivity.Showfunction1(MainActivity.java:496)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at com.example.championpoker.MainActivity$1.handleMessage(MainActivity.java:69)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at android.os.Looper.loop(Looper.java:123)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at android.app.ActivityThread.main(ActivityThread.java:4363)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at java.lang.reflect.Method.invokeNative(Native Method)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at java.lang.reflect.Method.invoke(Method.java:521)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-21 17:01:03.934: E/AndroidRuntime(5720):     at dalvik.system.NativeStart.main(Native Method)
02-21 17:01:03.945: I/dalvikvm(5720): threadid=7: reacting to signal 3
02-21 17:01:03.975: E/dalvikvm(5720): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
02-21 17:02:55.285: D/dalvikvm(13134): GC freed 1040 objects / 72088 bytes in 52ms
02-21 17:03:00.906: D/dalvikvm(13134): GC freed 11941 objects / 418752 bytes in 66ms
02-21 17:03:02.705: D/random number(13134): 17
02-21 17:03:02.705: D/random number(13134): 15
02-21 17:03:02.705: D/random number(13134): 53
02-21 17:03:02.705: D/random number(13134): 35
02-21 17:03:02.705: D/random number(13134): 28
02-21 17:03:04.688: D/random number(13134): 12
02-21 17:03:04.688: D/random number(13134): 16
02-21 17:03:04.688: D/random number(13134): 27
02-21 17:03:04.688: D/random number(13134): 4
02-21 17:03:04.688: D/random number(13134): 35
02-21 17:03:05.025: D/dalvikvm(13134): GC freed 17133 objects / 602296 bytes in 70ms
02-21 17:03:06.465: D/random number(13134): 13
02-21 17:03:06.475: D/random number(13134): 16
02-21 17:03:06.485: D/random number(13134): 53
02-21 17:03:06.485: D/random number(13134): 46
02-21 17:03:06.485: D/random number(13134): 10
02-21 17:03:08.166: D/random number(13134): 33
02-21 17:03:08.166: D/random number(13134): 28
02-21 17:03:08.166: D/random number(13134): 12
02-21 17:03:08.166: D/random number(13134): 5
02-21 17:03:08.166: D/random number(13134): 41
02-21 17:03:08.445: D/dalvikvm(13134): GC freed 16037 objects / 569736 bytes in 77ms
02-21 17:03:09.625: D/random number(13134): 48
02-21 17:03:09.639: D/random number(13134): 51
02-21 17:03:09.639: D/random number(13134): 16
02-21 17:03:09.639: D/random number(13134): 28
02-21 17:03:09.639: D/random number(13134): 30
02-21 17:03:11.055: D/random number(13134): 11
02-21 17:03:11.055: D/random number(13134): 19
02-21 17:03:11.055: D/random number(13134): 1
02-21 17:03:11.055: D/random number(13134): 35
02-21 17:03:11.055: D/random number(13134): 13
02-21 17:03:11.955: D/dalvikvm(13134): GC freed 16126 objects / 573728 bytes in 70ms
02-21 17:03:12.595: D/random number(13134): 50
02-21 17:03:12.595: D/random number(13134): 44
02-21 17:03:12.595: D/random number(13134): 19
02-21 17:03:12.595: D/random number(13134): 18
02-21 17:03:12.595: D/random number(13134): 23
02-21 17:03:14.125: D/random number(13134): 10
02-21 17:03:14.125: D/random number(13134): 47
02-21 17:03:14.125: D/random number(13134): 51
02-21 17:03:14.125: D/random number(13134): 32
02-21 17:03:14.125: D/random number(13134): 5
02-21 17:03:14.924: D/dalvikvm(13134): GC freed 16219 objects / 573280 bytes in 69ms
02-21 17:03:15.655: D/random number(13134): 19
02-21 17:03:15.655: D/random number(13134): 49
02-21 17:03:15.655: D/random number(13134): 40
02-21 17:03:15.655: D/random number(13134): 13
02-21 17:03:15.655: D/random number(13134): 41
02-21 17:03:17.267: D/random number(13134): 42
02-21 17:03:17.267: D/random number(13134): 37
02-21 17:03:17.267: D/random number(13134): 14
02-21 17:03:17.267: D/random number(13134): 20
02-21 17:03:17.267: D/random number(13134): 50
02-21 17:03:18.135: D/dalvikvm(13134): GC freed 17970 objects / 634408 bytes in 70ms
02-21 17:03:18.875: D/random number(13134): 55
02-21 17:03:18.875: D/random number(13134): 1
02-21 17:03:18.875: D/random number(13134): 14
02-21 17:03:18.875: D/random number(13134): 12
02-21 17:03:18.875: D/random number(13134): 24
02-21 17:03:20.825: D/dalvikvm(13134): GC freed 16754 objects / 590184 bytes in 72ms
02-21 17:03:21.145: D/random number(13134): 10
02-21 17:03:21.145: D/random number(13134): 25
02-21 17:03:21.145: D/random number(13134): 18
02-21 17:03:21.145: D/random number(13134): 38
02-21 17:03:21.145: D/random number(13134): 34
02-21 17:03:22.987: D/random number(13134): 7
02-21 17:03:22.987: D/random number(13134): 47
02-21 17:03:22.987: D/random number(13134): 24
02-21 17:03:22.987: D/random number(13134): 54
02-21 17:03:22.987: D/random number(13134): 5
02-21 17:03:23.545: D/dalvikvm(13134): GC freed 16707 objects / 584776 bytes in 72ms
02-21 17:03:24.405: D/random number(13134): 16
02-21 17:03:24.405: D/random number(13134): 37
02-21 17:03:24.405: D/random number(13134): 19
02-21 17:03:24.405: D/random number(13134): 45
02-21 17:03:24.405: D/random number(13134): 42
02-21 17:03:25.895: D/random number(13134): 52
02-21 17:03:25.895: D/random number(13134): 17
02-21 17:03:25.895: D/random number(13134): 53
02-21 17:03:25.895: D/random number(13134): 6
02-21 17:03:25.895: D/random number(13134): 42
02-21 17:03:26.215: D/dalvikvm(13134): GC freed 16746 objects / 588616 bytes in 64ms
02-21 17:03:27.505: D/random number(13134): 5
02-21 17:03:27.505: D/random number(13134): 32
02-21 17:03:27.505: D/random number(13134): 7
02-21 17:03:27.505: D/random number(13134): 11
02-21 17:03:27.505: D/random number(13134): 20
02-21 17:03:28.815: D/dalvikvm(13134): GC freed 16674 objects / 585560 bytes in 76ms
02-21 17:03:29.195: D/random number(13134): 35
02-21 17:03:29.205: D/random number(13134): 31
02-21 17:03:29.205: D/random number(13134): 27
02-21 17:03:29.205: D/random number(13134): 51
02-21 17:03:29.205: D/random number(13134): 0
02-21 17:03:30.785: D/random number(13134): 54
02-21 17:03:30.785: D/random number(13134): 37
02-21 17:03:30.785: D/random number(13134): 24
02-21 17:03:30.785: D/random number(13134): 2
02-21 17:03:30.785: D/random number(13134): 16
02-21 17:03:31.625: D/dalvikvm(13134): GC freed 16860 objects / 590488 bytes in 73ms
02-21 17:03:32.505: D/random number(13134): 28
02-21 17:03:32.505: D/random number(13134): 49
02-21 17:03:32.505: D/random number(13134): 36
02-21 17:03:32.505: D/random number(13134): 3
02-21 17:03:32.505: D/random number(13134): 41
02-21 17:03:34.165: D/dalvikvm(13134): GC freed 16840 objects / 590976 bytes in 74ms
02-21 17:03:34.875: D/random number(13134): 49
02-21 17:03:34.875: D/random number(13134): 25
02-21 17:03:34.875: D/random number(13134): 14
02-21 17:03:34.875: D/random number(13134): 46
02-21 17:03:34.875: D/random number(13134): 41
02-21 17:03:36.745: D/dalvikvm(13134): GC freed 16779 objects / 586696 bytes in 76ms
02-21 17:03:37.245: D/random number(13134): 52
02-21 17:03:37.245: D/random number(13134): 53
02-21 17:03:37.245: D/random number(13134): 8
02-21 17:03:37.255: D/random number(13134): 14
02-21 17:03:37.255: D/random number(13134): 4
02-21 17:03:39.255: D/dalvikvm(13134): GC freed 16931 objects / 590952 bytes in 77ms
02-21 17:03:40.005: D/random number(13134): 44
02-21 17:03:40.005: D/random number(13134): 24
02-21 17:03:40.005: D/random number(13134): 22
02-21 17:03:40.005: D/random number(13134): 11
02-21 17:03:40.005: D/random number(13134): 18
02-21 17:03:41.415: D/random number(13134): 50
02-21 17:03:41.415: D/random number(13134): 13
02-21 17:03:41.415: D/random number(13134): 26
02-21 17:03:41.415: D/random number(13134): 17
02-21 17:03:41.415: D/random number(13134): 15
02-21 17:03:41.975: D/dalvikvm(13134): GC freed 16925 objects / 591312 bytes in 73ms
02-21 17:03:42.996: D/random number(13134): 40
02-21 17:03:42.996: D/random number(13134): 50
02-21 17:03:42.996: D/random number(13134): 26
02-21 17:03:42.996: D/random number(13134): 28
02-21 17:03:42.996: D/random number(13134): 24
02-21 17:03:44.545: D/random number(13134): 47
02-21 17:03:44.545: D/random number(13134): 25
02-21 17:03:44.545: D/random number(13134): 40
02-21 17:03:44.545: D/random number(13134): 45
02-21 17:03:44.545: D/random number(13134): 23
02-21 17:03:44.624: D/dalvikvm(13134): GC freed 16887 objects / 591832 bytes in 74ms
02-21 17:03:46.265: D/random number(13134): 43
02-21 17:03:46.265: D/random number(13134): 14
02-21 17:03:46.265: D/random number(13134): 49
02-21 17:03:46.265: D/random number(13134): 37
02-21 17:03:46.265: D/random number(13134): 55
02-21 17:03:47.214: D/dalvikvm(13134): GC freed 16915 objects / 592656 bytes in 78ms
02-21 17:03:48.115: D/random number(13134): 41
02-21 17:03:48.115: D/random number(13134): 51
02-21 17:03:48.115: D/random number(13134): 7
02-21 17:03:48.115: D/random number(13134): 36
02-21 17:03:48.115: D/random number(13134): 44
02-21 17:03:49.777: D/dalvikvm(13134): GC freed 16853 objects / 589464 bytes in 76ms
02-21 17:03:49.977: D/random number(13134): 36
02-21 17:03:49.977: D/random number(13134): 28
02-21 17:03:49.977: D/random number(13134): 34
02-21 17:03:49.977: D/random number(13134): 30
02-21 17:03:49.977: D/random number(13134): 26
02-21 17:03:51.565: D/random number(13134): 3
02-21 17:03:51.565: D/random number(13134): 14
02-21 17:03:51.565: D/random number(13134): 21
02-21 17:03:51.565: D/random number(13134): 23
02-21 17:03:51.565: D/random number(13134): 36
02-21 17:03:52.565: D/dalvikvm(13134): GC freed 16915 objects / 592120 bytes in 71ms
02-21 17:03:53.495: D/random number(13134): 46
02-21 17:03:53.505: D/random number(13134): 23
02-21 17:03:53.505: D/random number(13134): 40
02-21 17:03:53.505: D/random number(13134): 3
02-21 17:03:53.505: D/random number(13134): 52
02-21 17:03:55.065: D/random number(13134): 4
02-21 17:03:55.065: D/random number(13134): 19
02-21 17:03:55.065: D/random number(13134): 3
02-21 17:03:55.065: D/random number(13134): 36
02-21 17:03:55.065: D/random number(13134): 21
02-21 17:03:55.285: D/dalvikvm(13134): GC freed 16948 objects / 593632 bytes in 72ms
02-21 17:03:56.824: D/random number(13134): 17
02-21 17:03:56.824: D/random number(13134): 7
02-21 17:03:56.824: D/random number(13134): 48
02-21 17:03:56.824: D/random number(13134): 1
02-21 17:03:56.824: D/random number(13134): 39
02-21 17:03:58.055: D/dalvikvm(13134): GC freed 16980 objects / 595312 bytes in 69ms
02-21 17:03:58.555: D/random number(13134): 28
02-21 17:03:58.555: D/random number(13134): 6
02-21 17:03:58.555: D/random number(13134): 17
02-21 17:03:58.555: D/random number(13134): 11
02-21 17:03:58.555: D/random number(13134): 24
02-21 17:04:00.235: D/random number(13134): 40
02-21 17:04:00.235: D/random number(13134): 16
02-21 17:04:00.235: D/random number(13134): 43
02-21 17:04:00.235: D/random number(13134): 44
02-21 17:04:00.235: D/random number(13134): 19
02-21 17:04:00.815: D/dalvikvm(13134): GC freed 16948 objects / 592288 bytes in 75ms
02-21 17:04:01.826: D/random number(13134): 9
02-21 17:04:01.826: D/random number(13134): 26
02-21 17:04:01.826: D/random number(13134): 48
02-21 17:04:01.826: D/random number(13134): 46
02-21 17:04:01.826: D/random number(13134): 8
02-21 17:04:03.544: D/dalvikvm(13134): GC freed 16951 objects / 593304 bytes in 69ms
02-21 17:04:03.585: D/random number(13134): 38
02-21 17:04:03.585: D/random number(13134): 23
02-21 17:04:03.585: D/random number(13134): 13
02-21 17:04:03.585: D/random number(13134): 2
02-21 17:04:03.585: D/random number(13134): 52
02-21 17:04:05.455: D/random number(13134): 36
02-21 17:04:05.455: D/random number(13134): 34
02-21 17:04:05.455: D/random number(13134): 22
02-21 17:04:05.455: D/random number(13134): 39
02-21 17:04:05.465: D/random number(13134): 52
02-21 17:04:06.065: D/dalvikvm(13134): GC freed 16989 objects / 593168 bytes in 69ms
02-21 17:04:06.935: D/random number(13134): 22
02-21 17:04:06.935: D/random number(13134): 21
02-21 17:04:06.935: D/random number(13134): 28
02-21 17:04:06.935: D/random number(13134): 29
02-21 17:04:06.935: D/random number(13134): 54
02-21 17:04:08.585: D/dalvikvm(13134): GC freed 17075 objects / 597184 bytes in 68ms
02-21 17:04:08.835: D/random number(13134): 44
02-21 17:04:08.835: D/random number(13134): 36
02-21 17:04:08.835: D/random number(13134): 55
02-21 17:04:08.835: D/random number(13134): 11
02-21 17:04:08.835: D/random number(13134): 15
02-21 17:04:10.715: D/random number(13134): 6
02-21 17:04:10.715: D/random number(13134): 15
02-21 17:04:10.715: D/random number(13134): 39
02-21 17:04:10.715: D/random number(13134): 20
02-21 17:04:10.715: D/random number(13134): 3
02-21 17:04:11.225: D/dalvikvm(13134): GC freed 17016 objects / 593464 bytes in 76ms
02-21 17:04:12.435: D/random number(13134): 28
02-21 17:04:12.435: D/random number(13134): 49
02-21 17:04:12.435: D/random number(13134): 52
02-21 17:04:12.435: D/random number(13134): 15
02-21 17:04:12.435: D/random number(13134): 26
02-21 17:04:13.815: D/dalvikvm(13134): GC freed 17063 objects / 597008 bytes in 140ms
02-21 17:04:14.324: D/random number(13134): 37
02-21 17:04:14.324: D/random number(13134): 44
02-21 17:04:14.324: D/random number(13134): 40
02-21 17:04:14.324: D/random number(13134): 12
02-21 17:04:14.324: D/random number(13134): 5
02-21 17:04:16.095: D/random number(13134): 19
02-21 17:04:16.095: D/random number(13134): 31
02-21 17:04:16.095: D/random number(13134): 45
02-21 17:04:16.095: D/random number(13134): 32
02-21 17:04:16.095: D/random number(13134): 2
02-21 17:04:16.355: D/dalvikvm(13134): GC freed 17010 objects / 593192 bytes in 77ms
02-21 17:04:17.925: D/random number(13134): 35
02-21 17:04:17.925: D/random number(13134): 15
02-21 17:04:17.925: D/random number(13134): 10
02-21 17:04:17.925: D/random number(13134): 45
02-21 17:04:17.935: D/random number(13134): 2
02-21 17:04:18.925: D/dalvikvm(13134): GC freed 17197 objects / 601752 bytes in 71ms
02-21 17:04:19.695: D/random number(13134): 7
02-21 17:04:19.695: D/random number(13134): 21
02-21 17:04:19.695: D/random number(13134): 50
02-21 17:04:19.695: D/random number(13134): 46
02-21 17:04:19.695: D/random number(13134): 6
02-21 17:04:21.455: D/dalvikvm(13134): GC freed 17117 objects / 596296 bytes in 71ms
02-21 17:04:21.645: D/random number(13134): 12
02-21 17:04:21.645: D/random number(13134): 42
02-21 17:04:21.645: D/random number(13134): 2
02-21 17:04:21.645: D/random number(13134): 50
02-21 17:04:21.645: D/random number(13134): 4
02-21 17:04:23.325: D/random number(13134): 43
02-21 17:04:23.325: D/random number(13134): 15
02-21 17:04:23.325: D/random number(13134): 29
02-21 17:04:23.325: D/random number(13134): 53
02-21 17:04:23.325: D/random number(13134): 25
02-21 17:04:24.145: D/dalvikvm(13134): GC freed 17099 objects / 596424 bytes in 69ms
02-21 17:04:25.385: D/random number(13134): 45
02-21 17:04:25.385: D/random number(13134): 33
02-21 17:04:25.385: D/random number(13134): 32
02-21 17:04:25.385: D/random number(13134): 51
02-21 17:04:25.385: D/random number(13134): 6
02-21 17:04:26.745: D/dalvikvm(13134): GC freed 17051 objects / 596400 bytes in 72ms
02-21 17:04:27.045: D/random number(13134): 5
02-21 17:04:27.045: D/random number(13134): 53
02-21 17:04:27.045: D/random number(13134): 22
02-21 17:04:27.045: D/random number(13134): 28
02-21 17:04:27.045: D/random number(13134): 2
02-21 17:04:28.895: D/random number(13134): 52
02-21 17:04:28.895: D/random number(13134): 5
02-21 17:04:28.895: D/random number(13134): 40
02-21 17:04:28.895: D/random number(13134): 4
02-21 17:04:28.895: D/random number(13134): 16
02-21 17:04:29.375: D/dalvikvm(13134): GC freed 17052 objects / 594720 bytes in 73ms
02-21 17:04:30.675: D/random number(13134): 49
02-21 17:04:30.685: D/random number(13134): 19
02-21 17:04:30.685: D/random number(13134): 26
02-21 17:04:30.685: D/random number(13134): 21
02-21 17:04:30.685: D/random number(13134): 36
02-21 17:04:31.915: D/dalvikvm(13134): GC freed 17138 objects / 598560 bytes in 78ms
02-21 17:04:32.475: D/random number(13134): 21
02-21 17:04:32.475: D/random number(13134): 22
02-21 17:04:32.475: D/random number(13134): 13
02-21 17:04:32.475: D/random number(13134): 0
02-21 17:04:32.475: D/random number(13134): 5
02-21 17:04:34.325: D/random number(13134): 45
02-21 17:04:34.325: D/random number(13134): 41
02-21 17:04:34.334: D/random number(13134): 55
02-21 17:04:34.334: D/random number(13134): 51
02-21 17:04:34.334: D/random number(13134): 8
02-21 17:04:34.525: D/dalvikvm(13134): GC freed 17102 objects / 595512 bytes in 71ms
02-21 17:04:36.095: D/random number(13134): 15
02-21 17:04:36.095: D/random number(13134): 45
02-21 17:04:36.095: D/random number(13134): 32
02-21 17:04:36.095: D/random number(13134): 35
02-21 17:04:36.095: D/random number(13134): 5
02-21 17:04:37.075: D/dalvikvm(13134): GC freed 17225 objects / 602368 bytes in 69ms
02-21 17:04:37.946: D/random number(13134): 16
02-21 17:04:37.946: D/random number(13134): 37
02-21 17:04:37.946: D/random number(13134): 55
02-21 17:04:37.946: D/random number(13134): 6
02-21 17:04:37.946: D/random number(13134): 48
02-21 17:04:39.565: D/dalvikvm(13134): GC freed 17024 objects / 592664 bytes in 73ms
02-21 17:04:39.565: I/dalvikvm-heap(13134): Grow heap (frag case) to 4.601MB for 8208-byte allocation
02-21 17:04:39.705: D/dalvikvm(13134): GC freed 0 objects / 0 bytes in 138ms
02-21 17:04:40.094: D/random number(13134): 22
02-21 17:04:40.094: D/random number(13134): 15
02-21 17:04:40.094: D/random number(13134): 32
02-21 17:04:40.094: D/random number(13134): 44
02-21 17:04:40.094: D/random number(13134): 12
02-21 17:04:42.125: D/dalvikvm(13134): GC freed 17271 objects / 605752 bytes in 68ms
02-21 17:04:42.165: D/random number(13134): 49
02-21 17:04:42.165: D/random number(13134): 28
02-21 17:04:42.165: D/random number(13134): 18
02-21 17:04:42.165: D/random number(13134): 5
02-21 17:04:42.165: D/random number(13134): 1
02-21 17:04:44.285: D/random number(13134): 14
02-21 17:04:44.285: D/random number(13134): 26
02-21 17:04:44.285: D/random number(13134): 16
02-21 17:04:44.285: D/random number(13134): 17
02-21 17:04:44.285: D/random number(13134): 3
02-21 17:04:44.604: D/dalvikvm(13134): GC freed 17122 objects / 597560 bytes in 72ms
02-21 17:04:46.185: D/random number(13134): 25
02-21 17:04:46.185: D/random number(13134): 42
02-21 17:04:46.185: D/random number(13134): 40
02-21 17:04:46.185: D/random number(13134): 30
02-21 17:04:46.185: D/random number(13134): 50
02-21 17:04:47.086: D/dalvikvm(13134): GC freed 17333 objects / 605328 bytes in 78ms
02-21 17:04:47.355: D/AndroidRuntime(13134): Shutting down VM
02-21 17:04:47.355: W/dalvikvm(13134): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
02-21 17:04:47.355: E/AndroidRuntime(13134): Uncaught handler: thread main exiting due to uncaught exception
02-21 17:04:47.355: E/AndroidRuntime(13134): java.lang.ArrayIndexOutOfBoundsException
02-21 17:04:47.355: E/AndroidRuntime(13134): at com.example.championpoker.MainActivity.Showfunction1(MainActivity.java:496)
02-21 17:04:47.355: E/AndroidRuntime(13134): at com.example.championpoker.MainActivity$1.handleMessage(MainActivity.java:69)
02-21 17:04:47.355: E/AndroidRuntime(13134): at android.os.Handler.dispatchMessage(Handler.java:99)
02-21 17:04:47.355: E/AndroidRuntime(13134): at android.os.Looper.loop(Looper.java:123)
02-21 17:04:47.355: E/AndroidRuntime(13134): at android.app.ActivityThread.main(ActivityThread.java:4363)
02-21 17:04:47.355: E/AndroidRuntime(13134): at java.lang.reflect.Method.invokeNative(Native Method)
02-21 17:04:47.355: E/AndroidRuntime(13134): at java.lang.reflect.Method.invoke(Method.java:521)
02-21 17:04:47.355: E/AndroidRuntime(13134): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-21 17:04:47.355: E/AndroidRuntime(13134): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-21 17:04:47.355: E/AndroidRuntime(13134): at dalvik.system.NativeStart.main(Native Method)
02-21 17:04:47.365: I/dalvikvm(13134): threadid=7: reacting to signal 3
02-21 17:04:47.365: E/dalvikvm(13134): Unable to open stack trace file '/data/anr/traces.txt': Permission denied

Solution: Close your Program or Shut the emulator

Friday, January 18, 2013

Implement A Image Listener In Android

In the ANDROID development you use this code. It's helpful for you. If you use any image like button then by java coding you use that implement. It is call a image listener. Firstly you have a project in android application who called package com.example.imagebutton (example) then you export these things like Bundle, Activity, Menu, Motion event (Because on touch you call the listener) , View (for image) , On touch listener and etc. Then u use that Java code and enjoy you first app using image listener.




package com.example.imagebutton;


import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;

import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class Imagebutton extends Activity {

ImageView ivCard;
TextView editText;
boolean isPressed=false;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_imagebutton);

addListenerOnImage();

}


public void addListenerOnImage()
 {
// TODO Auto-generated method stub
ivCard=(ImageView)findViewById(R.id.imageView1);

ivCard.setOnTouchListener(new OnTouchListener()
{

@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
if(isPressed){
ivCard.setBackgroundResource(R.drawable.ic_launcher);

}
else{
ivCard.setBackgroundResource(R.drawable.cancelglow);
Toast.makeText(Imagebutton.this,
"ImageButton is clicked!", Toast.LENGTH_SHORT).show();
}
isPressed=!isPressed;
return false;
}
});
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_imagebutton, menu);
return true;
}


}

Tuesday, January 15, 2013

How to Call a Image as a Button in Android

In this project how i call a image as a button . Then i use the  button and in this button i call the touch listener who call the image on the screen then you already use that code it is tested. You believe that.



package com.example.imagebutton;


import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageButton;
import android.widget.ImageView;

public class Imagebutton extends Activity
{
ImageView ivCard;
boolean isPressed=false;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_imagebutton);

addListenerOnImage();

}

public void addListenerOnImage()
 {
// TODO Auto-generated method stub
ivCard=(ImageView)findViewById(R.id.imageView1);

ivCard.setOnTouchListener(new OnTouchListener()
            {

@Override
public boolean onTouch(View v, MotionEvent event)
                {
// TODO Auto-generated method stub
if(isPressed)
                                       {
ivCard.setBackgroundResource(R.drawable.ic_launcher);

}
else{
ivCard.setBackgroundResource(R.drawable.cancelglow);
Toast.makeText(Imagebutton.this,
"ImageButton is clicked!", Toast.LENGTH_SHORT).show();
        }
isPressed=!isPressed;
return false;
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
 {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_imagebutton, menu);
return true;
}


}