One place for android professionals and hobyists. Get access to the latest news, tutorials, tips, FAQs on android development and information about great android apps.
Monday, October 25, 2010
Some Latest Stats about Android Apps
Saturday, October 23, 2010
Text To Speech Example In Android
I had the opportunity to incorporate Text To Speech feature in E-Book apps in Android at Salsoft Technologies for Feel Social.Here is a neat example how to use the android.speech.tts.TextToSpeech
library.
Take an Edit Text Box and a Button and run the following code and feel free to leave your comments:
package az.tts;
import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class TexttoSpeech extends Activity implements OnInitListener {
/** Called when the activity is first created. */
private EditText text;
private TextToSpeech tts;
private String str="";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tts = new TextToSpeech(this, this);
text = (EditText) findViewById(R.id.EditText01);
//text.setText("Press me");
str = text.getText().toString();
Button btn = (Button)findViewById(R.id.Button01);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
str = text.getText().toString();
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onInit(int status) {
// TODO Auto-generated method stub
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
}
library.
Take an Edit Text Box and a Button and run the following code and feel free to leave your comments:
package az.tts;
import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class TexttoSpeech extends Activity implements OnInitListener {
/** Called when the activity is first created. */
private EditText text;
private TextToSpeech tts;
private String str="";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tts = new TextToSpeech(this, this);
text = (EditText) findViewById(R.id.EditText01);
//text.setText("Press me");
str = text.getText().toString();
Button btn = (Button)findViewById(R.id.Button01);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
str = text.getText().toString();
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onInit(int status) {
// TODO Auto-generated method stub
tts.speak(str, TextToSpeech.QUEUE_FLUSH, null );
Toast.makeText(TexttoSpeech.this, text.getText().toString(), Toast.LENGTH_SHORT).show();
}
}
Thursday, October 14, 2010
FunBalls – Funny Android Balls
The game has two modes
-’Lines’ mode: Arrange the colored balls into lines of the same color and gain the score.
-’Block’ mode: Arrange the colored balls into square 2×2 balls of the same color and gain score.
Go to setting to change game speed.
Warning: Change settings, change game mode will cause the game reload!
Version 0.9.0:
- First release!
Tuesday, October 12, 2010
Subscribe to:
Posts (Atom)