Added new libraries and made it so it can speak dutch
This commit is contained in:
@@ -9,7 +9,11 @@ import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
|||||||
import com.aldebaran.qi.sdk.builder.SayBuilder;
|
import com.aldebaran.qi.sdk.builder.SayBuilder;
|
||||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||||
import com.aldebaran.qi.sdk.design.activity.conversationstatus.SpeechBarDisplayStrategy;
|
import com.aldebaran.qi.sdk.design.activity.conversationstatus.SpeechBarDisplayStrategy;
|
||||||
|
import com.aldebaran.qi.sdk.object.conversation.Phrase;
|
||||||
import com.aldebaran.qi.sdk.object.conversation.Say;
|
import com.aldebaran.qi.sdk.object.conversation.Say;
|
||||||
|
import com.aldebaran.qi.sdk.object.locale.Language;
|
||||||
|
import com.aldebaran.qi.sdk.object.locale.Locale;
|
||||||
|
import com.aldebaran.qi.sdk.object.locale.Region;
|
||||||
|
|
||||||
|
|
||||||
public class MainActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
public class MainActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||||
@@ -30,13 +34,24 @@ public class MainActivity extends RobotActivity implements RobotLifecycleCallbac
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRobotFocusGained(QiContext qiContext) {
|
public void onRobotFocusGained(QiContext qiContext) {
|
||||||
// Create a new say action.
|
String locationName = ("Krijg de tyfus");
|
||||||
Say say = SayBuilder.with(qiContext) // Create the builder with the context.
|
String locationDescription = ("Je bent een teringlijer");
|
||||||
.withText("Hallo hoe gaat het?") // Set the text to say.
|
Locale locale = new Locale(Language.DUTCH, Region.NETHERLANDS);
|
||||||
.build(); // Build the say action.
|
|
||||||
|
|
||||||
// Execute the action.
|
Phrase namePhrase = new Phrase("This location is " + locationName);
|
||||||
say.run();
|
Say sayName = SayBuilder.with(qiContext)
|
||||||
|
.withPhrase(namePhrase)
|
||||||
|
.withLocale(locale)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
Phrase descriptionPhrase = new Phrase(locationDescription);
|
||||||
|
Say sayDescription = SayBuilder.with(qiContext)
|
||||||
|
.withPhrase(descriptionPhrase)
|
||||||
|
.withLocale(locale)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
sayName.run();
|
||||||
|
sayDescription.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user