Google glass Immersive app icon doesn't show - google-glass

My app icon has disappeared, I've sourced it to the activity alias's I am using. I want them to display as sub menu voice commands so in the manifest I've added the VOICE_TRIGGER action. When I remove this the icon re-appears.
Any ideas for a work around?
Here'a an example of an alias:
<activity-alias
android:label="#string/do_thing"
android:name="#string/do_thing"
android:theme="#android:style/Theme.DeviceDefault"
android:immersive="true"
android:targetActivity="com.x.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<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" />
</activity-alias>

Maybe the text of the menu item is too long? I have had this before and with a long text, my icon also disappeared. When I shortened the menu text, the icon appeared again.

This is because you need to use the voice command in here:
https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/app/VoiceTriggers.Command
if you use the your own voice command, the icon won't show on XE18.3

I believe this is a known issue with 18.3 (https://code.google.com/p/google-glass-api/issues/detail?id=559) and was indicated fixed around July 8th.
So hopefully you aren't seeing this anymore in any release past 18.3.

Related

VersionFromLanguage module crashes on Sitecore 8.0

One of our clients has recently upgraded their sitecore from 7.0 to 8.0 and they used to work with VersionFromLanguage module to duplicate same content to multiple languages. But after upgrade, the content editor crashes with following error if the module gets activated (by enabling its config file):
Could not load type 'Sitecore.Shell.Applications.WebEdit.Commands.WebEditCommand' from assembly 'Sitecore.Client, Version=8.0.5245.0, Culture=neutral, PublicKeyToken=null'
I was thinking about better techniques such as language fallback in long term but is there any quick fix to this module? (It must be something about the way buttons get registered on SPEAK UI comparing to older shell API, I guess)
A quick fix is to switch to Sheer UI.
In Sitecore 8, the Experience editor by default uses SPEAK for the ribbon.
To use old Sheer UI (if is an option for you ) you need to modify Sitecore.ExperienceEditor.config
<pageextenders>
<!-- Uncomment the page extenders below and comment the "Sitecore.ExperienceEditor.Speak.Ribbon.PageExtender.RibbonPageExtender" to switch to old SheerUI-based Experience Editor ribbon. -->
<pageextender type="Sitecore.Layouts.PageExtenders.PreviewPageExtender, Sitecore.ExperienceEditor" />
<pageextender type="Sitecore.Layouts.PageExtenders.WebEditPageExtender, Sitecore.ExperienceEditor" />
<pageextender type="Sitecore.Layouts.PageExtenders.DebuggerPageExtender, Sitecore.ExperienceEditor" />
<pageextender type="Sitecore.Shell.Applications.Preview.SimulatedDevicePreview.PageExtenders.PreviewExtender, Sitecore.ExperienceEditor" />
<!-- Page extender for SPEAK-based Experience Editor ribbon. -->
<!--<pageextender type="Sitecore.ExperienceEditor.Speak.Ribbon.PageExtender.RibbonPageExtender, Sitecore.ExperienceEditor.Speak.Ribbon" />-->
</pageextenders>
On next links you will find information about how to customize ribbons in Sitecore 8 and what steps you need to follow to fix your issues into Sitecore 8.
http://www.programmingbynumbers.com/2015/01/31/creating-a-new-experience-editor-button-in-sitecore-8/
https://doc.sitecore.net/sitecore_experience_platform/the_editing_tools/customize_the_experience_editor_ribbon

Google Glass XE 17.3 - Multiple Actions From One Voice Trigger Broken?

One of my pairs of Glass updated itself to XE 17.3 this morning, and now, any Voice Triggers I have defined that are used for more than one activity no longer work. On previous versions, (and I've tested my code on an XE 17.2 pair I have to make sure I didn't break anything today), if multiple activities were set to use the same Voice Trigger, the system would prompt you to select from a list upon hearing that voice trigger. This is expected behavior (in case two applications use the same trigger), and actually was quite useful for creating a sub-launcher for your application (which is what I was using it for...say main launch name -> get a list of activities to choose from within the app, all automatic and handled by the system).
Now, however, if my Voice Trigger is assigned to two or more activities within my manifest, it will show up in the list, but will never trigger when you say "OK Glass - [voice trigger]" (it does still work with taps, however). As I mentioned, I tested the exact same code on a pair running XE 17.2 and it worked fine. I also removed the trigger from all but one activity, and it works on 17.3 when you do that...so the problem is when you have more than one possible activity that handles a given voice trigger.
The way I have my manifest set up seems correct to me (and works on older versions of the firmware):
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
...
<!-- one of the activities. this is inside the application element, of course -->
<activity
android:name="com.someapp.MainActivity"
android:label="Option 1" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voiceinput_main" />
</activity>
<!-- another activity, again inside the application element, sharing the same trigger -->
<activity
android:name="com.someapp.AnotherActivity"
android:label="Option 2" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voiceinput_main" />
</activity>
And, this manifest works fine on XE 17.2. Anyone know of something that has changed in 17.3 that would break this, or see anything that looks wrong? I know that the <action android:name="android.intent.action.MAIN" /> line isn't necessary, but removing it doesn't fix the problem.
Thanks!
in my case, I change my voice trigger string "all in lower case" thing solved my problem, maybe you could give it a try, custom Voice trigger command XE17.31
This seems to only affect custom voice triggers. I'm seeing the same thing with an app I'm developing where I use "Debug ..." as a trigger to let me do a number of things to reset state or launch test actions.
If you change the trigger to an existing command listed here then it should start working again. If you're using the mechanism in the same way I am, you can probably just pick an obscure existing command to use for testing purposes (I'm using FIND_A_DOCTOR, which seems apropos for debugging purposes).
If you're simply using a custom command as part of normal flow, presumably it will either become an accepted command, or you'll have to switch to an existing command eventually, since the custom commands only work in debugging anyway.

How do I prevent sitecore from adding a ~ to an image path?

I have a clean install of Sitecore 6.5, DMS 2.0, and the E-Commerce Module and Sample Site (v1.2). When I have the sample site installed, most of the images appear to be broken. The HTML that is rendered includes img src attributes that contain a path that start with /~/. Example:
http://~/media/Images/Ecommerce/Examples/Products/Digital%20SLR/D200.ashx?w=250&as=1
Now, I'm assuming this is either because the sample site hasn't been updated in a while to stay current with Sitecore changes, or there is a configuration for media paths that get returned from it. Here's an example of the XSLT rendering used to write the image:
<img id="product_shot" class="fix" alt="{sc:fld('alt',.)}" title="{sc:fld('alt',.)}" src="/{sc:GetMediaUrl(.)}?w={$ImageWidth}&as=1" />
Does anyone know of a way to prevent the image url from being rendered with a ~ when using XSLT? Did I do something wrong with my initial setup and configuration?
John West gives a great breakdown here: http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2012/12/Sitecore-Idiosyncrasies-Media-URLs.aspx
The important info being a configuration of "Media.MediaLinkPrefix". You can create a patch file, or modify your Web.config to change it to something else. The places I've read have people changing it to a single dash "-/media"
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="Media.RequestExtension">
<patch:attribute name="value"></patch:attribute>
</setting>
<setting name="Media.MediaLinkPrefix">
<patch:attribute name="value">-/media</patch:attribute>
</setting>
</settings>
<customHandlers>
<handler trigger="-/media/" handler="sitecore_media.ashx"/>
</customHandlers>
</sitecore>
</configuration>
Another solution which I can think of is to change your web.config like this:
InvalidItemNameChars: Add “~“
But this will work not only for images but for any content items out there in your Sitecore content tree.
This is more of a workaround than a solution. Since I'm setting this up for demo purposes, it'll do just fine.
In web.config, I changed the value of Media.MediaLinkPrefix to include the hostname and media prefix. Since the Sitecore E-Commerce Example Site XSLT renderings start all calls to sc:GetMediaUrl(.) with a / character and sc:GetMediaUrl(.) itself returns its first character as a /, this causes the src attribute value to be written with the full host name and then correctly resolves:
<img src="//sitecore.local/~/media/Images/Ecommerce/Examples/Products/Digital%20SLR/D200.jpg />
Far from ideal, but for these purposes, this workaround did the trick.

Magento - catalog.xml not using correct template

Noob developing a Magento theme and I can't seem to figure out why Magento is not using the path I specify in the setTemplate action on catalog.xml.
I've got my own theme in /app/design/frontend/default/mycustomtheme and I've been patching files over from the base and making changes.
I've copied over /app/design/frontend/base/default/layout/catalog.xml to my custom theme at /app/design/frontend/default/mycustomtheme/layout/catalog.xml. I've set the template to be a specific phtml file...
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2column.phtml</template></action>
</reference>
Yet it's not working. Can someone spot what the problem might be? I've got all cache disabled and other changes I make I can see immediately, just not this one.
edit: I should note, if I change something else in the catalog_product_view xml node I see those changes are reflected. For instance if I remove <action method="addJs"><script>varien/product.js</script></action> then I see the reference is removed in the rendered html file.
edit2: Adding images to address questions ...
did you setup-up / configured the theme from your store backend?
Yes, and it's actually loading the correct header and footer, and it's properly styled.
Are you sure you have such template under /app/design/frontend/default/mycustomtheme/template/page/ directory?
Yes, I can confirm the file is there
OMG. The (one and only) product I was testing on had a specific layout set under the "Design" section. So I guess that was overriding anything I had set in catalog.xml
I'd like to have the 3 hours of my life back.

Magento - How can I move the Navigation Block to be in the right column?

I've been editing Magento's default CSS to change the look and have come to a point where I want to move around some content blocks.
I've killed off the left column through CSS
.col-left { display: none; }
And then increased the width of the main content part to create a 'two column layout'. What I want to do now is move the navigation for the categories into the right column. I just have no idea how...
How do I move content blocks around in Magento? :/
Making large moves like that in Magento is best accomplished by modifying the layout XML files, rather than hacking through CSS. In the file catalog.xml, here are the relevant lines:
<reference name="top.menu">
<block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
</reference>
<reference name="left">
<!--<block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
<action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
<action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action>
<action method="setLinkUrl"><url>checkout/cart</url></action>
</block>-->
</reference>
<reference name="right">
<!--<block type="core/template" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>-->
<!--<block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml"/>-->
</reference>
To render the topnav, move that catalog/navigation line into the left or right column blocks and the navigation will be rendered as such.
Hope that helps!
Thanks,
Joe
Magento has four "standard" layouts: 1col, 3col, 2col-left and 2col-right, but you can add more if you like. You'll want to change the layout used on the page your editing instead hacking around with CSS. That's definitely the wrong way to do it.
As Joseph points out, Magento's templating system is comprised of blocks, or templates, which are positioned by layout files. Templates are standard php, though are prefixed with .phtml, and layouts are xml. You'll find large groups of these files in app/design/frontend/$interface/$theme/(template|layout).
Magento is pretty renown for it's poor documentation, but you may want to checkout their Designer's Guide which covers the concept of templates and layouts in a little detail, including how to move blocks around.
The syntax of a layout file is far from straightforward but, pretty much, all you're going to need to know at this stage is that in order to reference blocks in the right hand, left hand and content columns look out for:
<reference name="(right|left|content)"></reference>
Moving the <block /> declarations from one to another with cause the blocks to move.
Another key one to remember is to look out for:
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
Using the setTemplate action when referencing the root container will allow you to switch templates to 1column, 2columns-left, 2columns-right or 3columns easily. The layout templates themselves can be found in template/page/.