Fetching data in background - c#

I am making an app, that fetches a lot of data when logging in. I would like to fetch this data from the web service in the background.
With "background" I mean something like the App.cs or something. The data is loaded, while the user browses it's way through my app pages.
My app now loads all the data on the login page, and then shows the main page. I would like the app to load the data, when I am on the main page, without the user having to wait.
Is such thing possible?
Thanks in advance
Matthew

Schedule the data download as a ResourceIntensiveTask Class. As the Background agents for Windows Phone 8 This is the best way to manage apps that have large data downloads that are not continually needed for instant use, like a navigation app.
It will download the data when the phone is not in other use and has good charge, and be ready for the when the user wants to use the app.

Related

How can i sync Teams Tab App content between users

I am building Teams Tab App using C# and Blazor App.
When 2 users looking at the same page (let`s say page with table inside) and making changes, they should refresh the page to see changes made by another user. I wonder, is it possible to sync content? Can SignalR be helpful in this case?

Best way/solution to display json data from a local winform .net app on angularJS web dashboard applicaiton

can u please help me out with the best solution how to do this?
I have a windows form application, which is continuously doing something. (making screenshots and generating data) This app is running locally.
So I dont want to use teamviewer from office just to see what my application is doing. I want to create an AngularJS Web Dashboard application (load it on a webhost) and display this winform data (in form of charts,..), so that I can access from everywere.
What is the best solution for this?
I have experience with AngularJS and parsing JSON-Files from a webserver.
I preffer creating/serialize a json file (each second) from my winform app and load it somewhere on webhost and then access this json file with http.get from my AngularJS application.
Is this a possible solution? Any suggestions?
Thanks!
I agree with making a Angular web app (although you don't need angular for this, you can use jquery to make a simple ajax call, seems like it would be quicker to add the jquery reference than to setup the angular scaffolding just for one or two ajax calls) to call a web request where the winforms app stores the data.
Ex. you can create a web request (or directory save) in winforms app to perform the 'snipping tool' action described here: C# snipping tool service and send the data to somewhere to store it. If the snipping tool doesn't work then probably use an export of the chart or data you are capturing. Then the web app can query that directory to retrieve (ajax/http get) whichever data you need.
I would advise clean up on that directory as it could become quite big if you are saving to it every few seconds or so.

How to login to a website in uwp windows 10 and stay logged in?

I am building a UWP app for windows 10. I want the users to be able to login to a website and retrieve data from that site using the login information provided. How to login to a website programmatically and save the login credentials and login automatically the next time the user opens the app ? I want the login information to be available throughout the app so that in all the pag
It heavily depends on the web app you're trying to connect to. Actually, you don't connect to the web app or to a site but most likely to some backend services which back up the whole web application. The UI is called in this case a web client. What you are trying to do, is to create a desktop client (the UWP app).
Unless this site you're speaking of, has no clear documentation of how to use a certain API to connect to it, I don't see a way you can achieve this.
Additionaly, I am sure this whole approach will raise suspicions when your app might be eventually under certification, before being published in the Windows Store. If it doesn't pass the certification, only you can use it, others can't, 'cause it won't be available for them.
if you have the login information. I guess you have a token to make a valid requests.
Just need to save this information in the storage of your application and get the saved data when it will be necessary.
Please check this example how to use Storage in UWP apps
https://msdn.microsoft.com/en-us/library/windows/apps/mt185401.aspx
I recommend you to use Json format to save the data in your storage with this technique you can serialize a your data very easy.
here is an example:
http://www.codeproject.com/Tips/79435/Deserialize-JSON-with-C
I always use this approach in my apps and they work very well.
Best Regards
I have done a project similar to your project. My project involved logging in onto a website inside an UWP-application. I wanted to inject login-information into the DOM without the user knowing the information.
Quickly I concluded that the WebView Class is too limited and tightly protected to get it working. I resorted to an alternative webbrowser for UWP-applications named Gecko. Gecko is a .NET implementation of Firefox, found a tutorial on how to get it working and it worked right out of the box.
In the case of your project you have three options:
Use a UWP popup (MenuFlyOut class) where the user inserts their data. You then inject the inserted data into the DOM of the browser.
Let the user insert their credentials inside the DOM and intercept the keystrokes.
Let the user insert their credentials inside the DOM and retrieve the information by requesting the value of the inputs inside the DOM.
To use the values everywhere throughout the application you can create a static attribute inside the App-class inside the App.Xaml.cs file.
sealed partial class App : Application
{
internal static String Username { get; set; }
internal static String Password { get; set; }
public App()
{
If you want to use the variables again you can use them like this:
App.Username

What are my options for sending data from Windows app back to developer without using a webserver

I am writing a simple WPF quiz application for a family member and he would like users of this application to have the option to send him their scores once they have completed the quiz. I was hoping to do this without the need to create some kind of webservice for the app to talk back to.
My initial idea was to email the results back, but that runs into problems. What if there is no SMTP client on the user's machine? I don't want to embed a password for a public smtp server into the application. I could do a Process.Start("mailto:..."), but that requires their machine to have a handler for mailto: and for them to click submit on the generated email.
Another idea I had was that the app could add a line into a Google docs spreadsheet, but that would mean a google docs password would need to be embedded in the app.
So my question is, without me writing a separate application running on a webserver for my WPF app to talk to, is there a good way of my app sending data back to me that doesn't require a password? I'm guessing there must be some kind of public webservice I could use for this?
If you're happy with a third party service that can do this for you, consider Parse, or any other 'backend as a service' provider.
You should then be able to implement something else that reads the saved data from the service when required, without having to expose itself as an API.
Create a google doc forms and when you need the user to submit their score, launch a web browser with the doc url. You can auto-populate the fields by query parameters( ... &entry_0=Barney&entry_1=Google& ... )

Close silverlight applications and redirect to parent applications

My company is developing a Silverlight application which we then give to our clients who integrate it with their product. You can log into the application by going through a form or using a URI where you pass some needed data. If you provide false data (i.e. you can not be authenticated) you get a message and the applications closes. Then the user just has a blank (white) screen in front of him. We don't want that to be the case any more. Instead we would like to redirect to the calling page (where the user clicked the link to start the app).
So if for example user A has his application open on http://hisdomain.com/work and clicks on a link that redirects him to our Silverlight app where the authentication fails we would like to show him a message (this is happening at the momment) and then redirect him back to http://hisdomain.com/work.
Any ideas how to do this?
I am still in R&D about this so I have not much of an idea about it. The only thing that came to my mind was to pass in the calling URL along with the rest of the data.
Thanks.
If you can pass the starting URL into the Silverlight app with the startup params, you can redirect back with this:
System.Windows.HtmlPage.Window.Navigate(new Uri("YourStartupUrl.aspx", UriKind.Relative));

Categories

Resources