I am developing a windows phone application which will track user movements and collects some statistics. I want to store this information at some place (if user permits and this data wont shared with anyone) so that I can read that data again.
Any ideas on how I can do this in windows phone ?
You basically need a web service. You can use Azure Mobile Services, your own hosted or on Azure web service. Or you can use any other number of services such as Buddy or Parse. It's up to you to decide depending on the pricing and features of each service.
One way is to use Azure Mobile Services to store data off to the cloud. There's a tutorial here for Windows 8. It looks like you've tagged the question with Windows Phone 7, though, which the mobile services package isn't available for (that I know of). In that case you can create a webservice that your phone app can send data to, which can then store it wherever it pleases - a database, Azure Table storage, or wherever.
you have three options
1 ) If you want to store it locally then use : IsolatedStorage for Windows Phone.
2 ) If you want it to be somewhere outside your device : Write your own service code and connect it to a database (one end) and give a call to it from your windows device (other end)
Service not necessarily has to be Azure ... You can write any service connect it to ur database and store the value there.
Related
I am builing a Windows Phone Store App at the moment and I am planning to build a Windows Store App in the future (Universal Windows App). I want to synchronize the items stored in the local SQLite database with a remote database and between the different platforms (Windows Phone, Windows, ...).
So, I did a few searches about mobile backends and I ended up at Microsoft Azure App Services for Mobile with offline sync. Before I start, I want to clarify some important questions for me.
I have different users which will authenticate via Facebook, Microsoft Account, etc. How will the different entries be distinguished for each user? Do I have to add an userId property on each table and select only entries with relation to the userId?
I am currently using the NuGet package sqlite-net with sqlite-net extensions for support of relationships like One-to-Many, Many-to-Many, etc. Azure Mobile Apps seems to support only simple objects and I have to manage the relationship via a foreign key manually.
How much will Microsoft Azure App Services for Mobile Apps cost for a few thousands user, if I only use the remote database with offline sync?
I'm not sure this is the correct way but yes. Then you can customize the PullAsync to return only records that relate to a specified user (https://github.com/Azure/azure-mobile-apps-net-client/issues/181).
Yes. Currently it does not support relations for the client SQLite database. You have to do it manually in your client. Have a look at Adrian's answer here: (Offline Data Sync in Azure Mobile Apps with Views or Stored Procedure)
It depends on your data and the database type. If you are using Azure SQL Server, a basic plan with a monthly fee of ($5 to $10) may be good to go. And for the Azure Mobile App you can start the free plan.
I am working on a product for Windows 8 that needs to perform some low-level tasks, display some UI, and communicate with an external server. I definitely need a Windows service to accomplish the low-level tasks. At the same time, I would like to use the cool features of Windows App Store apps, like push notifications, live tiles etc... for the UI. In this design, both my service and my app would communicate with my external server.
The flow would be something like: my Windows service sends some information to my server, which then sends a push notification to my App Store app.
I understand that deployment is not pretty in this scenario, but let's put that aside for now. My problem: How does the server know that the service and the app are on the same machine, and consequently linked together? i.e. When my Windows service sends information to the server, how does the server know where to send the push notification? I need is some sort of shared, unique, identifying information.
I have seen lots of discussion (usually frustrated in nature) about the lack of inter-process communication between App Store apps and desktop apps. In my case, I have two options:
Generate the exact same unique identifier in the service and in the app. This seems unlikely because apps don't seem to be able to access very much system-specific information. I'd love to be shown that I am wrong about this.
Generate a unique identifier in the server OR in the app and communicate it to the other component. Potential ways to do this:
Create the identifier in the app, save it to a file, and then access the file from the service.
Some sort of local socket solution (I've read this doesn't work, but have not tried)
Of course, option 2 seems likely to violate the Windows 8 app Certification Requirements, notably:
Windows Store apps must not communicate with local desktop
applications or services via local mechanisms, including via files and
registry keys.
Any advice would be most appreciated.
I'm not a lawyer, but if it says "via local mechanisms" then you could still possibly communicate via a cloud service as long as having both apps installed isn't necessary to have some features in the app or if you don't mean to publish the app in the store.
You could save some sort of a token in the documents folder or if your desktop app can run with appropriate permissions - it could access the local data folder of the Windows Store app to synchronize the token for use in communication with the web service.
Perhaps the user could just be asked to copy and paste a token between the two apps?
I am learning how to develop Windows 8 Metro style apps but i couldn't found a way to store user data in SQL Server for example.
What could i use or how to store user data.
You cannot access local "desktop services" from the Metro app. So you will not be able to communicate with a local SQL Server.
You can use online services that store your information or you can use local storage.
Take a look at:
How to store and retrieve local application data
ApplicationData sample
That question is also debated here and here
You can use SQLite for Windows Runtime
Here is a blog post explaining how to use it:
http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx
There are couple of ways of storing data - Roaming Settings (if you want the same data to be available across all the win8 devices he has installed your application), Application Settings in Isolated Storage. About storing data in SQL server, as you cannot deploy sql database with Metro app, you need to have a client-server arch to host your service in front of a sql server db.
In addition to the answers you've already gotten, don't forget standard HTML5 localStorage, which should work across platforms and therefore help code reusability. What's not a standard is how much space you're allowed, but the de facto standard amount is about 5MB in all platforms. It might be more on Windows 8 for Metro style apps, but that's just a guess.
HI,
I am building a small application using accelerometers on the phone. I hope I can get the accelerometer data from the phone and analyze them at my PC and then I can build a model based on these data and deploy the model on the phone.
But I just don't know how to get the data out of the phone.
Thanks a lot!
For testing you could write to Debug when running from within Visual Studio.
Beyond that you'll need to send the data to a web service running on the local PC.
As a third alternative, you could save the data to IsolatedStorage on the device and then use http://wp7explorer.codeplex.com/ to get this files off the device.
If you log the data on the phone, you can later (say when you touch a button) send the data to a web service stored on your computer.
If you log the data in a string then your web service should expose a method that accepts a string input. It should be easy to setup and it is really easy to use from the phone, just use the Add Service Reference wizard to connect to it.
I am planning on a photo app, and want to know how I could upload/ download images from windows phone 7 to the blob storage as well as access the table storage. I don't mind placing the access key on the application, since the app is planned to be distributed internally only.
Since the Azure API is not available can somebody tell me how I can do the same ?
You can:
use Azure BLOB API directly (including key on the phone)
Abstract Blob operations behind a server-side web service
I also recommend to check out article by Steve Marx on accessing Azure Blob from Silverlight. It covers a wide range of topics including Shared Access Signatures and how to actually work with Azure Blob API.
I would not place the Access key into any client device. You should think about creating a webservice which can handle the upload for you. That way your phone has not to know about the Azure API.
Try to decouple your Phone 7 application from the backend implementation. Windows Phone 7 supports XNA and Silverlight applications so I guess you're going for the latter. That implies that you need to connect to a service anyway. I would suggest that you put all the backend and Azure specific logic behind a WCF service and call that from within your application.