Commit b85c6f7a authored by Martin LOISEAU's avatar Martin LOISEAU 🎄
Browse files

Fix use of deprecated tts function, add camera permission to manifest

parent 0dee671b
......@@ -34,4 +34,7 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.zxing:core:3.2.1'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qrquest" >
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
......
package com.example.qrquest;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;
......@@ -109,8 +111,12 @@ public class MainActivity extends AppCompatActivity {
}
public boolean PlayDemoTTS() {
tts.speak("Bonjour et bienvenue dans QR Quest", TextToSpeech.QUEUE_ADD, null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
tts.speak("Bonjour et bienvenue dans QR Quest",TextToSpeech.QUEUE_FLUSH,null,null);
} else {
tts.speak("Bonjour et bienvenue dans QR Quest", TextToSpeech.QUEUE_FLUSH, null);
}
return true;
}
}
......@@ -24,6 +24,12 @@ allprojects {
}
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment