adding <input> element to <trigger> causes serivce launch to crash? - google-mirror-api

I'll admit, I'm pretty rusty with android development. It's been a few years for me. As a refresher, I wanted to change the countdown app so that i could set the starting time with just my voice.
Simple, right?
I loaded up the sample apps and threw the timer app onto my glass. Everything worked. I was thrilled.
Then, following the instructions here GDK voice input i was able to change the "ok glass" command. Still worked. Cool.
Then, i added the string to trigger the voice transcribing function after 'launching' the timer app. Now, i can "ok glass" to launch the timer app, and i can say a few numbers and see them transcribed, but as soon as i stop the "swipe down to cancel" shows up and then shortly thereafter the app crashes and i end up back at my home screen.
Is there something simple that I have over looked? I added a Log.i() call to the onStartCommand() and it shows up in logcat ... when i remove the <prompt> element from the remind_me.xml file
Here's the excerpt from the manifest:
<service
android:name="com.google.android.glass.sample.timer.TimerService"
android:icon="#drawable/ic_timer"
android:label="#string/app_name"
android:enabled="true"
android:exported="true">
<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/remind_me" />
</service>
WORKING:
<trigger keyword="#string/voice_start_timer">
</trigger>
NOT WORKING:
<trigger keyword="#string/voice_start_timer">
<input prompt="#string/voice_timer_prompt" />
</trigger>
So what am i missing? What additional info do you need?
Thanks for your time and patience. I appreciate it!

I found some free time over the Holiday 2013 break.
Testing this with the new XE12 OS and updated GDK works. problem solved by updating to newest software.

Related

Melt throws “Property without service 'property'”

When building certain mlt files with melt 7.1.0, they run just fine, but when building them with melt 6.24.0, the error message
[producer_xml] Property without service 'property'?
[producer_xml] Property without service 'property'??
appears any number of times. A minimal working example showing this warning precisely twice is the following:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
</mlt>
What is the origin of this error? How can it be fixed?
The documentation is rather sparse on properties and in particular does not seem to mention what it would even mean for a property to have a service. The check for properties without services however is still in the current code (though I have not checked whether the code is dead by now).
Chain services were added in 7.0.0 - they were not supported in 6.24.0 yet.
The XML will not work in 2.24.0 because it uses a chain. You can change "chain" to "producer" to make it work if you do not need to use chain/link features.
Caveat
Before writing this answer, I had not yet gotten around to look at the result. Thus, it stands that no further warnings are given, but with the following approach, only black (and silent) video will be generated.
Old Answer
While I do not understand enough about the internals of the MLT framework to have even an inkling about the origins, I managed to work around this problem by manually reordering the mlt files. In my cases, the error disappeared consistenly when any playlist tag was moved before the first chain tag of the file. In the MWE the error can thus be avoided like this:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
</mlt>

Button does not work on some mobile devices (eg iPhone6, Androids)

this is my first question here and I was adviced to place this topic here.
I got a responsive website based on the AURA (PI-)theme. For the xs2 breakpoint I do show another slideshow on the homepage, where I have placed an button as call to action (other button type didn't work either)
On older smartphones like iPhone4 and 5 it is working. But on newer device it ain't.
Please take a look onto this test-page.
You can also check within chrome browser emulating such a device. There the click on the "Explore"-button doesn't work either.
Any help is gladly welcome and I appriciate it very much.
Thank you!
It's quite simple. You got a slideshow with a swipe handler which probably sets a preventDefault for swipe and click/tap. If I try to click it on a test device (android 4), it won't work either. But it does work if i hold it down and then press open. So it's not about the z-index (common error) but about the preventDefault. This means you would have to assign the link to the button/s in the slideshow with javascript.
EDIT:
To assign a link to an element using javascript (just javascript, no jquery or any other library), just put something like that into a script tag or javascript file:
document.getElementById("ID-of-your-button").addEventListener("click", function(){window.location.href = "http://link-desti.nation"});
and that should work fine. If there is another problem with it, just write a comment below please. I will reply on it as soon as possible.
P.S.: Sorry for the late edit, I was having hilariously much work on a "do immediately" level the last days.

Ant - Call Target in Loop Once

I have a common build.xml file that contains most of my targets.
There are two satellite build files that import the common file. The difference between the satellites is that one will run the common targets once, whereas the other has a foreach ant-contrib task which loops through subfolders and runs the common targets once per subfolder.
One of my targets in the common file prompts the user to select an area to release to (dev or qa).
For the satellite build that runs once, this works fine.
For the looping satellite build, the prompt appears to the user for each subfolder, but they will all go to the same release area so I only need this prompt to be asked once.
The simple solution is to move the "select-area" target to each of the satellite build files so it only runs once, i.e. it is outside of the loop.
I am interested to know if there is a cleaner way to do it.
My initial thoughts were to call the target outside of the loop, in the looping satellite build (using the ant task) and set a property. I would then add an "unless" attribute to the select-area target in the common build file which checks if the property set in the ant task has been set.
By my reckoning, this would mean the non-looping build runs the select-area target as the property has not been set (which it does).
The looping satellite build runs the target (using the ant task) but then when it loops into the common build file and hits the select-area target it still runs it, even though the property has been set and the select-area target has the unless attribute to check it.
Sample code below:
Extract From Common Build
<target name="select-area" unless="area.selected" description="prompts user what area to deploy to and validates response">
<input message="Which area do you want to deploy to?" validargs="dev,qa" addproperty="deploy.to" />
...
</target>
Looping Satellite Build File
<project name="run-build-file-multi" default="loop-brands">
<import file="../../../common/builds/newbuild.xml"/>
<ant antfile="${ant.file.common} target="select-area">
<property name="area.selected" value="yes" />
</ant>
<target name="loop-brands" depends="select-area" description="loops through each brand folder found in branch folder">
<foreach target="end-confirmation" param="current.brand" inheritall="true">
<path>
<dirset dir=".">
<include name="*"/>
</dirset>
</path>
</foreach>
</target>
</project>
It appears as soon as the ant task has called the target, the area.selected property is no longer set.
I am not sure if I am even going about this the right way but hopefully it is relatively clear what I am trying to achieve.
Any assistance appreciated, thanks.
This seems wrong:
<target name="select-area" unless="area.selected" description="prompts user what area to deploy to and validates response">
<input message="Which area do you want to deploy to?" validargs="dev,qa" addproperty="deploy.to" />
It should be
<target name="select-area" unless="deploy.to" description="prompts user what area to deploy to and validates response">
<input message="Which area do you want to deploy to?" validargs="dev,qa" addproperty="deploy.to" />
i.e. the unless should use the same variable as the input When the variable has been set once, it should stay that way.
Alternatively, in your two build scripts, have the script call select-area once at the beginning (so this is the same code in both) and then start the loop in the recursive build.

Silverlight - Is there a way to have 'variadic' UriMapping?

I'm using the Silverlight Navigation framework, with a single Frame in which I have a UriMapper. As I can have several parameters for one of my pages, I'd like a have a kind of wildcard or variadic mapping to avoid creating all the combinations of parameters.
Here is what it looks like with only three parameters, and some combinations omitted:
<sdk:Frame>
<sdk:Frame.UriMapper>
<sdk:UriMapper x:Name="uriMapper">
<sdk:UriMapping Uri="List/query={query}/sort={sort}" MappedUri="/Views/ListPage.xaml?query={query}&sort={sort}" />
<sdk:UriMapping Uri="List/filter={filter}/sort={sort}" MappedUri="/Views/ListPage.xaml?filter={filter}&sort={sort}" />
<sdk:UriMapping Uri="List/filter={filter}/query={query}/sort={sort}" MappedUri="/Views/ListPage.xaml?filter={filter}&query={query}&sort={sort}" />
<sdk:UriMapping Uri="List/sort={sort}" MappedUri="/Views/ListPage.xaml?sort={sort}" />
<sdk:UriMapping Uri="{}{Page}" MappedUri="/Views/{Page}Page.xaml" />
</sdk:UriMapper>
</sdk:Frame.UriMapper>
</sdk:Frame>
I'd like a way to write all the possible parameters to the 'List' Page with a single line, as they all follow the same rule. Something like (which doesn't work):
<sdk:UriMapping Uri="List/{params}" MappedUri="/Views/ListPage.xaml?{params}" />
So, is there a way to do that in Silverlight?
EDIT: If everything else fails, I might fallback to generating the mapping in code, which would look less ugly than dozens of XAML lines.
EDIT2: Or just forget about mapping URIs and just pass the real page name to Navigate().
This is where the Silverlight navigation framework falls flat on its face, and one of the big reasons I don't use it in production applications. That being said, in Silverlight 4 you can use the INavigationContentLoader to programmatically map all the different params to their correct view, and create your own mapper class that is more robust.
Also note, that this is not available in Windows Phone 7 currently (I see you do a lot of iOS dev, so wanted to point that out). If I recall correctly, it should be available in the Mango update for Windows Phone, which should be available in the next month or so for developers and end of this year for consumers.
Check out these links for more info:
http://blogs.msdn.com/b/dphill/archive/tags/helix/
http://www.davidpoll.com/2009/11/30/opening-up-silverlight-4-navigation-introduction-to-inavigationcontentloader/

How can I configure a netTiers datasource to use a RouteParameter instead of a QueryStringParameter?

NetTiers works fantastic out of the box using querystrings. Eg:
<data:AspnetUsersDataSource ID="AspnetUsersDataSource" runat="server" SelectMethod="GetByUserId">
<Parameters>
<asp:QueryStringParameter Name="UserId" QueryStringField="UserId" Type="String" />
</Parameters>
</data:AspnetUsersDataSource>
However, if I try to change the parameter to instead be:
<asp:RouteParameter Name="UserId" RouteKey="id" Type="String" />
It just see empty textboxes when navigating to my AspnetUsersEdit.aspx page via the routed url:
user/edit/id
My hunch is this isn't a url routing problem but is instead something I'm missing with how NetTiers fundamentally works. If anyone has successfully used url routing within NetTiers, I'd greatly appreciate any input!
I was able to solve my problem by using FormViews (a slight pain, but good enough for me). One important note that took me some time to solve - NetTiers generated the solution such that periods were contained in the virtual path of the project. Unfortunately this caused havoc with routing when testing locally. Altering the virtual path so as to not contain periods fixed things for me.

Resources