I am trying to build a Sports App for Windows Store .I am not able to understand how am I suppose to change the data day on day. The App initially will have some static content and the data has to be updated daily. Kindly guide me how to do this , since this is my first App for windows store.
I assume you have the data on a server somewhere. So use the HttpClient control to access the data, use Linq/XML to parse it, and then load it in your UI however you've designed it to do so.
You can show updates in a live tile with this sample: http://code.msdn.microsoft.com/Simple-Live-Tiles-575b1d66
Also look at Windows Azure Mobile Services: http://www.windowsazure.com/en-us/develop/mobile/
Related
Hii I have multiple text fields in the MySQL database and now I want to display all those texts in the text views I want in my activity could any one provide me any kind of example ,it would be helpful thanks
The easiest way would be to create some RESTful web services in order to be able to fetch data from your Android application. Look at this tutorial for creating your web service that will be fetching the needed data from your MySQL database. Then from your Android application you should do a HTTP requests to the web service to obtain the needed data. You can see how to do it in the following example.
Is there an API that allows to me to programmatically pull the latest update from the store and refresh the current version that the user is using? If not, is it possible for the current app to programmatically know that there is a new version available?
Any samples/examples would be highly appreciated.
You can't programmatically install any Store software. But you can programmatically open the Store to let it do the user manually.
That said, there's no official Store API which you could ask about app versions (you might be able to parse the Store's HTML pages, but I recommend against this approach).
What you can do: Put a small XML file on your website which contains the latest app version number. Your app then can read this file and compare this desired version against the running app's version. If the app is outdated, the app can show a message box to the user.
I ended up using WNS and Azure Notification Hub to send a push notification to the app when it is launched. The notification is in the form of a toast message that essentially states that a new release is available. But if you updated/downloaded the app after xx/xx/xxxx, no updates are necessary.
I know it is a little cludgy but at least the users now know that the version of the app that they are using may be dated. I control the notification through Azure Mobile Service (which is free for up to 10 apps) and can fully modify the actual script.
Short version: I have a WebBrowser control hosted in a Windows Phone 8 app. How can I store values from javascript so that they persist across the user closing and reopening my app?
Long version:
I'm developing a Windows Phone 8 application that has a single WebBrowser control hosted in a single MainPage.xaml page that lives for the entire life of my app. I created the app with the "Windows Phone HTML5 App" project type when creating the project in Visual Studio 2012. 99% of my application is hosted in web pages (on the internet, not stored on the phone) that I direct the WebBrowser to go to when the app starts up. In my application's web pages I'm trying to persist data across pages and across sessions. For example, once the user logs in once then I want to store that on the phone so the next time they start the app they don't have to log in again.
Cookies and HTML5 Local Storage (via window.localStorage.setItem and getItem) both work fine for sharing data across pages in the app while the app is running and even if you switch out of the app (via the Windows phone "hard button") and go back in. But if the user exits the app by pressing the hard "back" button then the next time the app is started all localStorage and cookies seem to be gone.
Is this the expected behavior? I guess I'm not sure where WebBrowser would store the data (Isolated Storage? Or maybe in the same place it's stored if going to the web site with Internet Explorer?). In any case, if there's no "fix" for this, can anyone the best way for me to provide my own storage mechanism so that I can let my javascript code persist values across instances of my app running? I'm happy to use the app's Isolated Storage if only I knew of a way to get and retrieve values from it using javascript. Thank you.
I'm not sure if this is expected behaviour or not.
To get at the Isolated Storage you will need to use JS/.NET interop.
if you want to trigger the persistent storage from JS:
Use window.external.notify in JS, generating a JSON string (for instance) to pass along to the .NET side. That could be written to IsolatedStorage without the .NET having to parse the data. You could use IsolatedStorage.AppSettings or a full file depending on the size of the data.
Alternately you could trigger the process from .NET:
Call WebBrowser.InvokeScript to call a JS function which returns the same JSON string representing your data.
The .NET side could detect and restore this data on startup and use WebBrowser.InvokeScript to pass the JSON string back into the WebBrowser via a JS function.
You'd of course have to deal with error cases (attempting to restore bad/corrupt JSON).
Also, if you trigger this from .NET in response to the App.Closing event you need to watch out that you don't take too long writing data.
The faster you run the better, but this definitely needs to be done within 10 seconds or the OS will kill your app.
See MSDN docs for WebBrowser.InvokeScript() and ScriptNotify registration to window.external.notify.
I am writing an iOS app for my school to keep track of pupil's rewards, grades, etc.
I need to connect to a MySQL online database with my app, I need to be able to upload to it, query it, and download the results to display in my app.
I think I need to do this via a PHP page, however there is no reasonably clear tutorial on how to do it. Any help would be appreciated!
Thanks in advance!
You need a webserver with a PHP/ASP/JSP/etc script to interact with the database. Create an API with common operations like SELECT, UPDATE or INSERT, and then call this url's inside the iOS app.
Usefull links:
Making HTTP and HTTPS Requests
Sending HTTP-Post ios
Authenticating Iphone Login with PHP/MySQL and HTTP Responses
I want my windows phone 8 application to sync automatically, when a row is inserted in a table.
That is, a xaml page in my app displays all the data in a table.
So, if a new row is added to that table, the change should be updated in my app too.(while app is running)
If the app is closed, it has to show notification( kind of).
I have no idea how to do it, and googled it. I came across Change Tracking, etc, but still couldn't to do it.!
Give me some solution.
Thanks and Regards
First of all, you need to be able to download table data from server. You will need to create a webservice that will serve tabla data and a service client in your WP8 application that will consume the data.
Second, you have to understand push notification concept on Windows Phone. Google for it. I recommend you to practice it a bit: create a single button WPF app, that sends a push notification a updates you app tile on WP8.
For updating your windows phone when a record is created on server:
Cant you just create a windows service, that periodically makes a request to DB to check any new records since last check? If there are new records it will send a notification to your WP8 app. When WP8 App recieves a notification it will update its tile, or if app is running, it will download new data from server.
alternative solution is, that you create a webservice with Insert method that will insert a row to you table on server. In the same method you will send a notifications to all your wp8 clients.
There are various solutions for this kind of app. It depends on your scenario. Can you describe your app?