Behind the scene Send Http request - angularjs

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.

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 !

IBM Worklight - Using a Progress bar instead of busy indicator?

Can anyone suggest me how to use progress bar to show progress?
In my app, when a user launches the app for the first time it downloads 12 MB of data via multiple web service, and the download can take 3 to 4 minutes. Right now I am using WL busy indicator but to have good user experience, I think a progress bar is the best solution.
So can you tell me how to proceed?
Is it possible with WL? Do I need to use Dojo?
Worklight does not provide a progress bar UI widget - nor should it; Worklight is not that kind of a framework.
Since you added the dojo tag to your question, you can try implementing Dojo's dijit/ProgressBar. You will need to control when to show and hide it.

How to load a part of application before loading rest of the application in angularjs?

I could not think of a better title, Please suggest one.
I am planning to work on a large web application. It will take time to load the full application before application starts functioning.
Suppose its something like asana.com. If you have a link to the task and you open the link. It loads the application first and then shows the detail of the task.
Note: I have added another example in update 2
I want to do just the opposite. Suppose if I try to open the link directly. It should show me the tasks details first and then load the whole application in background.
What development strategy should I follow to implement such feature. Will angular be good for this? I have worked with angular for small projects and am capable of think in angular :)
I just wanted to be pointed in right direction.
Update 1:
I am using Apache2 PHP5 in backing as ReST API. I am thinking to change to GoLang http server. But that does not matter in this context :)
Update 2:
I have not yet started working on the application, but I know that its size is going to be big and its going to take time to load the application. This will be a javascript application, all the communication to web will be done mostly by API. APIs will be fast and it wont be slowing down the application. My main concern is the javascript library and the approach to the issue that I want to display the content of the page before the application is loaded and load the application in background.
As second example: https://chrome.google.com/webstore/detail/a-journey-through-middle/gjgkjeheegjnnmheaflhdocglkiegoni?utm_source=chrome-ntp-icon
If you open this link in chrome, it will load the application and then load the specific content in a popup. I want to load the content of the popup first and then load the application in background. How should I write my application to achieve that.
My suggestion (and I say this as I start to do similar vs. having proven it successful) would be to make some level of framework fairly static so that users get an almost instant response to the site loaded and then start the angular app with something like this
angular.bootstrap(document.getElementById("container"), ["app"])
Ref for the api - https://docs.angularjs.org/api/ng/function/angular.bootstrap
Ref for a demonstration of this - https://egghead.io/lessons/angularjs-angular-bootstrap-app-init
My expectation then is that you will be able to
Load your static elements quickly (which will just have placeholders for your content/material)
Access the data you want in the order you want to get it to present on the screen
Release any other part of the app you need to chrome it up/decorate or populate side items.

Loading progress bar for all the download tasks

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.

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.

Resources