How to get the current state of the tablet - nao-robot

Is there a way to get the current state of the tablet - if it is in sleep mode, in screen saver mode or if a picture is loaded - to get the name of the loaded picture for example. I didn't find anything in ALTabletService API, but judging on ALTabletService::resetTablet() - Reset the tablet as if no one used it before, i.e. clean the stack of activities, the web browser content, and the web browser cache. there is a stack of tablet activities and perhaps there is what I am looking for.

I don't think you can actually do that. You have to assume it's doing the right thing. If you need to check if your webview is loaded properly, why not raising an Event every 15s from the javascript and subscribe to it from Python? then as soon as Python does not receive this event for 15s, it can reload the page !

Related

Xamarin forms - Periodic list view data refresh

We are building Xamarin forms app to run on iOS, Android and Windows 10. We are data binding view model to UI which has List View control. We want the data to be refreshed from rest service, every 3-5 seconds when user is viewing the app. We don't want the data to refresh when app is in background, but refresh the data as soon as app is foreground. I tried using Xamarin.Forms.Device.StartTimer and await Task.Delay, but this does not seem to be working very well, sometimes the data does not refresh when not in interactive debug mode especially with Xamarin.Forms.Device.StartTimer , I am not sure what is going wrong as I am not able to do logging on device. On using await Task.Delay, sometimes the Task gets cancelled. In app onresume event, code makes rest service call which fails with connection refused error.
So I wanted to know which is the best way to handle data refresh, any ideas?
Thanks in advance
At last to do periodic refresh, i used Task.Delay and a boolean variable to known whether refresh needs to be performed or not. If user navigates away from the page, i set the boolean variable to false to stop the refresh.

How to load data at launching Chrome App?

What's the best practice of loading data at launching Chrome App?
The landing page of my Chrome App is dependent on some configuration data, which I've stored in the chrome local storage. However, reading chrome local storage is an asynchronous process. Hence, after the App has launched, there is a period of time when the landing page doesn't show correctly.
To avoid this blank time (due to the asynchronous process of reading local storage), I'm thinking about reading data at background JS. However, I haven't googled out what's the best practice to do it.
Anybody has any comments? Thanks.
just listen to the onLaunched event
chrome.app.runtime.onLaunched.addListener(function() {
// load your data
});
Here's one piece of helpful suggestion I've got from the Google Group. Share here so that someone with the same problem might refer to it:
You can read from chrome.storage in the background page and open the window when the data is ready. However, the user experience might be even worse, because instead of the incorrect landing page, you have no user feedback at all.
The usual (and easy to implement) solution is to show your landing page with some visual feedback during data loading, like a spinning wheel with a "Loading" label. If you UI really requires the data to show up, you can add this visual indicator as an opaque div on top of the whole window.
Some people use splash screens, but I don't think it adds to the user experience.

Google glass clear cache

I was trying to resize an image to fit into a timeline template. (if it matters, I'm using the html attribute of the timeline) However, it was not rendering it properly. I got frustrated. Then I figured out that glass is using the same image. I just changed the name of the image and the url and it worked. Is there a way to clear the cache ? There might be a scenario where you change images on the server side and have the same timeline item (say a pinned item) access them at some other time interval. Thoughts ?
UPDATE
Request submitted in issue tracker
https://code.google.com/p/google-glass-api/issues/detail?id=30&thanks=30&ts=1367387959
There's no built in feature that triggers the timeline to clear it's cache, but it does respect the cache headers that you set. During development, use cache control headers to prevent the image from being cached.
If this isn't possible, you can work around this by adding a random GET parameter to the end of the image URL when you insert the card into your user's timeline.
All that being said, this seems like a useful development feature. You may want to request it in the API issue tracker.
put the same answer on your g+ but here it goes:
If you can enable adb, try using "adb reboot recovery" and see if you can get the option to pop up there.
Usually to get a menu up in recovery you have to press power and the up volume key (which i would assume would be the only other key on glass in this case) at the same time. then the volume key(s) scroll through options and the power button selects one.
Let me know if it works out.

Silverlight Notification API in-browser

I'd like to use the Notification API to create toast notifications for a Silverlight app designed to run both in and out of the browser, but the NotificationWindow class is only available OOB.
Does there exist anything that can replicate the behaviour inside the app? My idea is to have a container in the bottom right of the screen overlaying all other content. Then, create a wrapper which detects OOB-mode, passing params to the Notification API if possible, or populating and showing my own container if not. Is there anything that does this available?
It seems strange that MS chose not to implement something like this, as has been pointed out before.
Displaying a notification in browser is simple. You just need to use a popup and make it appear in the right place. See the following post as an example.
Now the difference with that approach is that the notification will show inside the browser. In OOB it shows outside the window and it's visible even if the windows is minimized. Due to security reasons it's not possible to directly do this.
Out of interest, Chrome Applications like Tweetdeck and Gmail, are able to display notifications outside of the browser. I think this might be a possiblity, but not exactly a Silverlight and cross browser solution.

Populating data in Silverlight App before its sent to he browser

I have a Silverlight App which gets its data from a database. My Silverlight app (running in the browser) retrieves the data through a web service. Pretty standard setup.
But there is some data which has to be there all the time or the App is in an invalid state - think data to fill drop downs etc. So I need this data to be "pre-loaded" into the App before it's sent down to the client so that it's never in an invalid state. Today I load this data via a web service call when my first page is initialized which can some times take a few seconds - during that time my App is in an invalid state.
Is there a way to populate data (from a backend database) in my Silverlight App before it's sent to the browser?
It is valid for an app to start and not be ready to use for a while, so long as the user cannot interact with it (or see the broken bits:))
Better to ensure your app has a splash screen/login page etc that displays until such time as the required resources are loaded. Once loaded you can set an app state to then show the main screen.
I had the same problem with a website that loaded the menu items via a service (as the text was data driven). Wound up running a progress spinner over the top (with a full-screen background).
I don't think you can. The application runtime occurs on the client's machine. I would suggest putting up a loading dialog while you bring those items down from the database.
What HiTech Magic said. Best practice for this is to use a splash screen or login page. You can also have your buttons (and interaction) disabled by default, and after the data is loaded, enable the UI. I would go with the spash screen though..

Resources