Xamarin: iOSでHTTPリクエストを行うと"App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file."エラー

概要 iOS 9以上ではApp Transport Securityの導入により、HTTPリクエストを実行するとエラーが発生する。その対応。 Info.plistの設定変更 <プロジェクト名>.iOS以下にあるInfo.plistを開き、以下の設定を追加する。 NSAppTransportSecurityについては以下を…

Xamarin: エラー"System.NotSupportedException: Encoding 932 data could not be found. Make sure you have correct international codeset assembly installed and enabled."

概要 System.Net.Http.HttpContent.ReadAsStringAsync()メソッドを使用した際に以下のエラーが発生した場合の対応方法。 System.NotSupportedException: Encoding 932 data could not be found. Make sure you have correct international codeset assembly …

バッチファイル内で別ファイルからバージョン番号を取得して変数として使用する

概要 バッチファイル内で使用する変数として、別ファイル内に書かれているバージョン番号を取得して使用する。 以下ではAndroidアプリ開発で使用するbuild.gradleファイル内からバージョン番号を取得する。 build.gradleファイル 以下のversionName "1.0.0"…

Xamarin: HTTP GETリクエスト

概要 XamarinでSystem.Net.Http.HttpClientを使用してHTTPのGETリクエストを行う。 docs.microsoft.com サンプルコード static readonly HttpClient client = new HttpClient(); // A) async void OnButtonClicked(System.Object sender, System.EventArgs e…

Xamarin: ファイル読み書き

概要 ファイルの読み書きを行う。 サンプルコード System.IO.Fileクラスを使用する。 public MainPage() { InitializeComponent(); // サンプルファイルパスの取得 String documentDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);…

How to deal with out of memory problem while create thumbnail by PDFKit

iOS

Summary PDFKit has a method thumbnailOfSize: for create thumbnail but when you create thumbnail of all page by this method, memory consumption is increasing and it's cause of app crash. Solution You have to release PDFDocument instance tha…

Add any files in your iOS application bundle and use it in the app.

iOS

Outline You can add any files in your iOS application at build phase and use it in the app. Add files Add any files to your Xcode project. The following example add text file sample.txt. When you add files to the Xcode project, Xcode add t…