Update Fitbot project files and add robot conversation in MainActivity.java
This commit is contained in:
@@ -12,6 +12,6 @@
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-04-24T09:24:05.698446800Z" />
|
||||
<timeTargetWasSelectedWithDropDown value="2024-04-24T11:45:40.185922Z" />
|
||||
</component>
|
||||
</project>
|
@@ -9,6 +9,7 @@ import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.builder.SayBuilder;
|
||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||
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;
|
||||
|
||||
|
||||
@@ -30,13 +31,21 @@ public class MainActivity extends RobotActivity implements RobotLifecycleCallbac
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
// Create a new say action.
|
||||
Say say = SayBuilder.with(qiContext) // Create the builder with the context.
|
||||
.withText("Hallo hoe gaat het?") // Set the text to say.
|
||||
.build(); // Build the say action.
|
||||
String locationName = ("de Hogeschool van Amsterdam");
|
||||
String locationDescription = ("de Hogeschool van Amsterdam");
|
||||
|
||||
// Execute the action.
|
||||
say.run();
|
||||
Phrase namePhrase = new Phrase("This location is " + locationName);
|
||||
Say sayName = SayBuilder.with(qiContext)
|
||||
.withPhrase(namePhrase)
|
||||
.build();
|
||||
|
||||
Phrase descriptionPhrase = new Phrase(locationDescription);
|
||||
Say sayDescription = SayBuilder.with(qiContext)
|
||||
.withPhrase(descriptionPhrase)
|
||||
.build();
|
||||
|
||||
sayName.run();
|
||||
sayDescription.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user