Google Glass GDK Theme for XML layout - google-glass

Is there a theme that we can use in Eclipse or Android Studio for doing XML layouts? I know we should use:
<style name="CustomTheme" parent="#android:style/Theme.DeviceDefault">
to get the Glass theme on the device, but how about while laying out in the editor?

Since it looks like the XML got eaten up in your original post, I'll repeat the tips to get the Glass theme on the device: remove any android:theme attributes that your IDE has automatically inserted, or if you need a custom theme, have it inherit from Theme.DeviceDefault (see GDK: Glass theme and UI widgets).
Eclipse and Android Studio do not yet provide an out-of-the-box exact Glass layout experience. You can approximate it fairly well by creating a device definition in the AVD Manager that matches the screen resolution on Glass (640 × 360, notlong, hdpi) as suggested by this post.
Then, select that device definition in your layout editor. You may also want to select Theme.DeviceDefault.FullScreen.NoActionBar to remove the status bar and action bar in your editor preview.

You might want to look at how I accomplished getting the Glass theme (which is just no theme as discussed in https://developers.google.com/glass/develop/gdk/ui/theme-widgets) in a Hello World app for Glass. Since the ADT in Eclipse creates a Theme by default and assigns it to the application in AndroidManifest.xml, I just had to remove it.
Here is a Git commit that shows this in action: https://github.com/luisdelarosa/HelloGlass/commit/a58208ddef2b9b25ac605735da0dd93860492477
Specifically I looked for this line in AndroidManifest.xml and removed it:
android:theme="#style/AppTheme"
I also removed the res/values/styles.xml since it was not being used anymore - it only had the themes in it.
As for having a graphical editor for Glass layouts, I don't think this is that well supported yet since we are still in Sneak Peek mode. Perhaps once we get to the Developer Preview mode, the Glass team will create editors that will allow us to design for the Glass UI exactly.

Related

How does magnifyingGlass work for Geo Chart?

It sounds that magnifying glass feature is very useful for small countries (e.g. Andorra, Liechtenstein, etc.). However, I never seen any region got magnified in my test. According to the document, the default value is {enable: true, zoomFactor: 5.0}, so it should be enabled by default. Why can't I see the effects? How should I make it work?
BTW: I tried both latest Chrome and Firefox, none of them works.
The magnifying glass appears when the user lingers over a cluttered marker. When the user lingers over a cluttered marker, a magnifiying glass will be opened.
Note: this feature is not supported in browsers that do not support SVG, i.e. Internet Explorer version 8 or earlier.

Siebel Tools can't scroll when editing applet web layout?

I've replaced my old dev laptop with a new one, and my Siebel 7.8 Tools aren't enjoying the change: the applet web layout editor gets frozen when I try to scroll.
The applet loads fine, I can add controls, move them around or remove them... but if I try to scroll, it only does so for a moment and then it gets frozen: everything inside the web layout pane (including the scrollbars) stops responding. I've also noticed a visual glitch when it happens - half of the "InfoButton" placeholder and half of the "Elemento" field are duplicated:
The rest of the Siebel Tools keep working however, I can just close the layout editor and open a new one, which will work without problem... until I try to scroll again.
It happens also if I try to show a bigger applet area without using the scrollbar (for example, if I hide the object explorer with Ctrl+E to have more room), or if I click on Preview. Only in that case, instead of a glitched layout, it shows all blank (and freezes).
It doesn't matter if it's a list applet or a form one; whether I'm connected to my local DBF database or to the server repository; if I run the Siebel Tools with or without administrative privileges...
To make things even weirder, the first time I edited an applet web layout in the new computer, it worked fine (a lot of scrolling included). The issue started with the second applet I tried to edit (but now it happens with the good applet too).
The new computer is running Windows 7 (64bits) with IE8. The old computer had exactly the same, only the 32bits version. Siebel Tools have been properly installed (I didn't just transfer my old folder to the new PC). And I've checked the tools.cfg file, specifically the WebClientSiteDir property, which points to the right folder, C:\Siebel_7.8\Tools\PUBLIC\ENU.
Any ideas, other than reinstall the Tools? Has it happened to anyone before?
Solved! I tried a lot of different things, including a full reinstall of Siebel Tools. In the end, it was much easier to fix: I just needed to enable the option "Run this program in Windows XP compatibility mode", in the Tools shortcut.
I'd swear I didn't have it enabled in my previous computer and it worked just fine, but anyway... that fixed the issue for me.

Not able to select Menu items in NASPT Exerciser using pywinauto

I am using pywinauto to automate NASPT Exerciser tool.
app.IntelNASPerformanceToolkitExerciser.PhotoAlbum.Click().
to click photo album button,
app.IntelNASPerformanceToolkitExerciser.all.Click()
to click all. It's not selecting all buttons.
app.IntelNASPerformanceToolkitExerciser.MenuSelect("Configure->NASPT Tool")
It is throwing error saying can't select Menu to this object.
Is there any other way to achieve above problem?
Can anyone help about this?
This is .NET application. pywinauto has very limited support of .NET controls. So you need to use Windows UI Automation API for such toolbar. Precisely InvokePattern should help with pressing toolbar button.
Or you may try to click button by hard coded coordinates like that:
app.IntelNASPerformanceToolkitExerciser.Children()[54].ClickInput(coords=(300, 10))
This hard-coding way may be better than dealing with quite complicated UI Automation API.
BTW, you may get pywinauto clone with .NET programmatic names support. Just download it as zip and run python setup.py install.
With that mod you can code so:
app.IntelNASPerformanceToolkitExerciser.toolStrip.ClickInput(coords=(300, 10))
I've just checked it. I think hard-coded coordinates is OK here because the software is end-of-lifed and will not be changed. There are not so many unsupported .NET controls.

Is there a list of Android widgets present on Google Glass XE11?

As seen by the GDK sample code, there is a set of Android Widget classes (TextView, etc) that are supported on Google Glass. Has anyone compiled a list? I would love to know what options I am working with prior to the official GDK.
According to what I have gathered, you should be able to use any UI element within your application using GDK (it's simply an Android activity displayed in Glass). There are some services that aren't available though, that is really the only limitation at the moment. Some limitations I've spotted are: SpeechRecognizer not available - use RecognizerIntent instead, GPS might have some issues/limitations.
Since Glass is built on Android, all of the standard Android widgets are available. You should, however, restrict yourself to widgets that provide a high-quality user experience on Glass. For example, buttons and checkboxes aren't very usable since the user can't click on them directly.

How to create screenshot of web browser without chrome in Qt 5.1

It is possible to create screenshot of a Window content in Qt 5? E.g we have web browser and I want to create screen only of the page without chrome (menus window ...). Here is an example:
http://s7.postimg.org/5ekkmpdbd/question.png
Image above represent the feature which I want to implement in my Qt application.
Here is the example:
originalPixmap = QPixmap::grabWindow(QApplication::activeWindow()->winId());
there is a possibility to render only the content (web page) of the browser ang get the image?
The way to deal with the chrome issue depends on what is your goal. The "chrome" you are referring to is a part of the web browser application that you're trying to interact with.
If you're doing this as a quick in-house hack, then you're free to hard code some offsets needed to trim the original pixmap so that the chrome is removed.
If you want something that can grab website screenshots and doesn't care on which browser is being used, you should be using WebKit bundled with Qt. Then you have full control over where the stuff is rendered.
If you want to grab screenshots from a user-provided browser, then one approach is to add an extension into the browser, and implement a server that can receive images from the extension running in the browser. The extension can be written in javascript presumably for everything out there but IE. It will be browser-specific, though.
Another approach is to check if the browser doesn't provide some other APIs that could be used for the purpose, without a need of writing an extension. For all I know, similar extensions should already exist. There surely are open source website testing frameworks out there that let you render a site in multiple browsers; they should provide this "grab from a browser" functionality.
Nitpick: In Qt 5 you should be using QScreen::grabWindow(), not the deprecated QPixmap::grabWindow(). I also hope that you're aware that if there are any windows in front of your window and obscuring it, they'll be grabbed. The grabbing is done from the screen, not directly from the window.