Skip to main content

Create Text to speech converter app using Sketchware

Create Text to speech converter app using Sketchware










If you haven't yet watched the video , watch it right now !




Open Sketchware. Create new project .Go to the logic section  . In on Create event , add the following code



t1=new android.speech.tts.TextToSpeech(getApplicationContext(), new android.speech.tts.TextToSpeech.OnInitListener() {
@Override public void onInit(int status) {
if(status != android.speech.tts.TextToSpeech.ERROR) {
t1.setLanguage(Locale.UK); } } });
}android.speech.tts.TextToSpeech t1;
private void nothing(){




 Go to the logic section and tap on Button1 on Click event

Create a string variable named  "speak". Now set the value of that string variable using  blocks.
Please watch the above video for Reference.
Now use add source directly block and add the following code



t1.speak(speak, android.speech.tts.TextToSpeech.QUEUE_FLUSH, null);




 Run the app.






If you have any doubts comment below


























Comments

  1. Replies
    1. Just instead of the first code, insert this t1=new android.speech.tts.TextToSpeech(getApplicationContext(), new android.speech.tts.TextToSpeech.OnInitListener() {
      @Override public void onInit(int status) {
      if(status != android.speech.tts.TextToSpeech.ERROR) { } } });
      }android.speech.tts.TextToSpeech t1;
      private void nothing(){

      Delete

Post a Comment

Did you like this tutorial ?

Popular posts from this blog

Add Edittext Inside Dialog Box

Add Edittext Inside Dialog Box




If you haven`t yet watched the video...Watch it right now!!!


The code used in the above video is available here.
final EditText edittext1= new EditText(MainActivity.this); LinearLayout.LayoutParams lpar = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); edittext1.setLayoutParams(lpar); dialog.setView(edittext1);







textview1.setText(edittext1.getText());






Create Custom Popup Window using Sketchware

Create Custom Popup Window using Sketchware


Refer the video below if  you get stuck. 

1) Add a custom view named window.You can name it according to your wish. 
2)Design your popup window. 
2) Now, In the logic section,In OnCLick event of button.Add the following  code
Create a view
View popupView = getLayoutInflater().inflate(R.layout.window, null);
Popup window 

final PopupWindow popup = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, true);
Initialize 
Button b1 = popupView.findViewById(R.id.button1); Button b2 = popupView.findViewById(R.id.button2);
OnClickListeners
b1.setOnClickListener(new OnClickListener() { public void onClick(View view) { //below code will dismiss the popup window popup.dismiss(); } });
b2.setOnClickListener(new OnClickListener() { public void onClick(View view) {
popup.dismiss(); } });
Show the popup window 
popup.showAtLocation(popupView, Gravity.CENTER, 0, 0);




Add Swipe To Refresh Feature To Your App using Android Studio

Add Swipe To Refresh Feature To Your App Using Android Studio


If you haven't watched the video watch it now!


Source Code
Android Manifest.xml



<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="swiperefresh.com.swipetorefresh"> <uses-permission android:name="android.permission.INTERNET" /> <applicationandroid:allowBackup="true"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>…