Loading progress bar for all the download tasks - codenameone

I know that theres a NetworkManager class in Codename One that does the HTTP requests.
Im not quite sure as to where to have all of those download requests queued in a thread and have a loading progress percentage to track the overall downloaded percentage?
Is there a way to do that? I would like to download some images on different URL paths and need to prompt a progress bar to my user to have a different progress bars for each images.
Thanks

NetworkManager.getInstance().addProgressListener() will send an action event that you can downcast to a NetworkEvent. From that event you can extract the exact status/progress of the current connection.
You can use the SliderBridge to bind a Slider as a network activity progress indicator. You can also study its code to write something similar on your own.

Related

How to get the current state of the tablet

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 !

Sync a label with angular.js video player's progress time

I have a web page that consist a video and a label that shows a series of data about certain parts of the video. for example while the video is played, in 10'th and 18'th second of the video , the label must be updated automatically. i can not use a separate timer because some parameters such as slow internet connection can make synchronization. Is there any way/ any component that can solve this issue?

Behind the scene Send Http request

I am using ionic framework, i want to fetch all details of current user. I have a large amount of data.
I want to show progress bar on header and need to show counter (Remaining data) like downloading 1/100 and so on.
Can we run this on behind the scene and how we show.
Any idea ?
Thanks
You can show a basic progress bar - there are several implementations available for angular, which show some ramdom progress.
In Angular it's yet not possible to show the real progress with the actual numbers. You need to implement a XHR progress handler, but this is not (yet) supported by angular.
You have to patch angular or implement your own request handler. For more information see the discussion thread.

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.

Most efficient way to transfer images to a Silverlight client

I have an application that shows a screen of image thumbnails, each image is around 80k and they are stored in a database. To keep response time reasonable, the appilcation displays a placeholder image when it first starts and later downloads the images from the server. I'm expecting to show around 40 images on the screen at once so that's my batch size. What's the best way to serve these images up to the client? I've got two options in mind.
Create an ADO.NET Data Service that exposes the Images database table to the client. The client can asynchronously request the images, one at a time, and display them as they come back from the server. I've implemented this solution and it seems to work Ok; the speed isn't great and I feel like I could utilize the Http pipe better by requesting maybe 3 images at a time.
Create an HttpModule on the server that looks for requests that look something like /Images/1.jpg and then reads the database and returns the requested data. On the client side I can have many Image objects whose source points to the virtual Urls on the server. My theory is that by just giving Silverlight many Urls to deal with it may be able to transfer the images more efficiently than my code in option 1.
Would either of these methods be more efficient or is there another technique for getting this done? Thanks!
I don't know if it's more efficient, but I've accomplished a very similar task using an HTTP Handler (ashx). The handler pulls the image in from the database based on the Parameters in the uri (image ID), and then Silverlight fetches them asynchronously by setting the Source property of an Image control to the URI of the handler with the specific ID that I want in the query string. The Image control, in turn, is inside of an ItemsControl which allows me to display multiple images.
We are doing something very similar, and we are just using an ASPX page to server them up with a query parameter of the image identifier. We are also caching the images, and the ASPX page will used the cached value if it exists. If not, we pull it from the data store, cache it, and send it down. It is working really well for us.
Have you looked at using Deep Zoom? It's very efficient about progressive image loading, and gives you a nicer user experience when the images are fully loaded.
Examples:
Hard Rock Memorabilia site
Deep Zoom Pix

Resources