Reputation: 4868
Is it possible to give the user "hints" using voice trigger's input prompt? This is would be similar to what the action "make a call" displays, giving you a list of possible options.
For instance using the following...
<trigger keyword="@string/start_scan" >
<constraints
camera="true"
network="true" />
<input prompt="@string/prompt_scan_what" />
</trigger>
I would like the user flow to be as follows...
------------
"Ok, Glass"
------------
"Scan"
------------
What would you like to scan?
QR Code
Product
Barcode
------------
"Barcode"
Upvotes: 2
Views: 465
Reputation: 5059
Have you tried adding a line feed character (i.e. '/n') after the question mark in the prompt text to get a fresh new line?
Upvotes: 0
Reputation: 4868
Found a workaround with a few cons:
Workflow is more like...
---------
"Ok, Glass"
---------
"Scan"
---------
ok glass, scan...
QR Code
Product
Barcode
---------
"Barcode"
Android Manifest:
<activity android:name="com.cantilsoftware.barcodeeye.LaunchActivity">
</activity>
<activity-alias
android:name="Product"
android:label="Product"
android:targetActivity="com.cantilsoftware.barcodeeye.LaunchActivity" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="@xml/voice_trigger_scan" />
</activity-alias>
<activity-alias
android:name="Barcode"
android:label="Barcode"
android:targetActivity="com.cantilsoftware.barcodeeye.LaunchActivity" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="@xml/voice_trigger_scan" />
</activity-alias>
<activity-alias
android:name="QR Code"
android:label="QR Code"
android:targetActivity="com.cantilsoftware.barcodeeye.LaunchActivity" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="@xml/voice_trigger_scan" />
</activity-alias>
Selection detection:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_launch);
try {
ActivityInfo activityInfo = getPackageManager().getActivityInfo(getComponentName(), 0);
processVoiceAction(activityInfo.loadLabel(getPackageManager()).toString());
} catch (NameNotFoundException e) {
e.printStackTrace();
processVoiceAction(null);
}
}
Upvotes: 1