Write once deploy on Windows Mobile 6, Windows Phone 7, Android and iPhone? [closed]

If you’re happy to re-use business logic and write device specific user interfaces (more work, but better user experience on each device) you could consider the various Mono frameworks. Writing the core business logic as a class library, then writing specific user interfaces using MonoTouch, MonoDroid and Windows using .NET Framework you’ll have a cross … Read more

Read text file in project folder in Windows Phone 8.1 Runtime

If you want to read a file from your project you can for example do it like this: string fileContent; StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(@”ms-appx:///example.txt”)); using (StreamReader sRead = new StreamReader(await file.OpenStreamForReadAsync())) fileContent = await sRead.ReadToEndAsync(); Also please ensure that you have set the Build Action of your file as Content (it should be … Read more

WebUtility.HtmlDecode vs HttpUtilty.HtmlDecode

The implementation of the two methods are indeed different on Windows Phone. WebUtility.HtmlDecode: public static void HtmlDecode(string value, TextWriter output) { if (value != null) { if (output == null) { throw new ArgumentNullException(“output”); } if (!StringRequiresHtmlDecoding(value)) { output.Write(value); } else { int length = value.Length; for (int i = 0; i < length; i++) … Read more

Upload image using HttpClient

Okay after hours of researching I came to the point that I should restart from draft. I simulate a Html form upload with following C# code: private async Task<string> UploadImage(StorageFile file) { HttpClient client = new HttpClient(); client.BaseAddress = new Uri(“http://your.url.com/”); MultipartFormDataContent form = new MultipartFormDataContent(); HttpContent content = new StringContent(“fileToUpload”); form.Add(content, “fileToUpload”); var stream … Read more