Permalink
Browse files

inital create of project space

  • Loading branch information...
0 parents commit 7b302916aeda57cf15d916e6effbeb1ba258f51b @cajun-code cajun-code committed Feb 28, 2012
Showing with 46 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +42 −0 prize_draw_notes.txt
@@ -0,0 +1,4 @@
+bin
+deploy
+.metadata
+
@@ -0,0 +1,42 @@
+prize_members1:
+ private TextToSpeech mTts;
+
+prize_members2:
+ private EditText guests;
+ private TextToSpeech mTts;
+ private Random generator;
+
+Create_intent:
+ Intent checkIntent = new Intent();
+ checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
+ startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);
+
+tts1:
+ private TextToSpeech mTts;
+ protected void onActivityResult(
+ int requestCode, int resultCode, Intent data) {
+ if (requestCode == MY_DATA_CHECK_CODE) {
+ if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
+ // success, create the TTS instance
+ mTts = new TextToSpeech(this, this);
+ } else {
+ // missing data, install it
+ Intent installIntent = new Intent();
+ installIntent.setAction(
+ TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
+ startActivity(installIntent);
+ }
+ }
+ }
+
+Test_talk:
+ mTts.speak("Hello, Mobile City", TextToSpeech.QUEUE_FLUSH, null);
+
+Create_random:
+ Random generator = new Random();
+
+pick_prize:
+ int winner = generator.nextInt(Integer.parseInt(guests.getText().toString())) + 1;
+ String message = "The winner is number " + winner;
+ mTts.speak(message, TextToSpeech.QUEUE_ADD , null);
+ Toast.makeText(PrizeDrawActivity.this, message, 2000).show();

0 comments on commit 7b30291

Please sign in to comment.