Windows Phone 7 - how to send files from / to the application?

I am trying to write the most basic application for Windows Phone 7 and want to be able to send files (in particular XML in case something changes) to my application. I currently have a WCF service, so I can send push notifications through it. The problem is that there is a limit on the amount of raw data that I can send through a push notification.

My solution is to send an initial push notification (either tile or raw) to alert my application that I want to send a file to it, and then make the application somehow communicate with the server (everything is on my personal computer btw - I'm just trying to figure out how everything works), from which the application will receive / download files.

What is the easiest way to do this? Please note that I am not interested in security or anything like that.

Clarification - . The question is very important: how to transfer files from / to the server to / from the phone? Suppose that everything else has been processed - the application is up and running, and the user has given or will give permissions to everything possible, to which he can give his permission.

+3
source share
4 answers

Unfortunately, the total size of the push notification (including HTTP headers) is 1kb. This means that it cannot be used to send large amounts of data.

Instead of sending the whole file, send a notification (unprocessed or toast as necessary), which should be processed by the application as a trigger for switching and receiving a new file / data / something from the server. It may also be useful to check for new messages when starting the application. However, if, upon starting the application, it informs the server that it is ready to receive raw notifications, and such messages are sent with the new content, it may not be necessary to add this additional check.

/ HttpWebRequest WebClient, HTTP , HTTP - , .

WebClient , HttpWebRequest, , , .

/ conencted PC .

+4

: - , , WP7 SDK / push- .

- -. , , , -, . , .

, ( , ), WP7 , IMHO.

,

0

, , WP7-, :

0

WebClient DownloadStringAsync -. Scott Guthrie Twitter MIX10.

0

Source: https://habr.com/ru/post/1794129/


All Articles