Search Posts

PCL netstandard multi-target library implementation using project.json

netstandard project.json

Remarks At the time of this writing project.json is being moved in to the .csproj file. However, this requires Visual Studio 2017 and might not be mature enough. So if you’re still rollin’ VS 2015 or want to stick with project.json, this tutorial is for you. The new black As a Xamarin (Forms) developer we’ve historically heavily on Portable Class Libraries; PCL. However, the world has changed with the introduction of net core and the […]

Xamarin.Forms Dropbox integration (app folder)

Dropbox API

App backup / synchronization between devices Apps usually backup their content to the respective cloud to ensure local data isn’t lost, but there is of course no guarantee the user has activated those features. When working with Xamarin/Forms your app is available on more then one device, so you might want to sync files between the OS:s too – like an SQLite database for example. Complete Code for this tutorial DropboxService.cs GIST Dropbox v2 API SDK […]

Solve Android.OS.NetworkOnMainThreadException

Background Working with Xamarin.Android (or Xamarin.Forms with Android) you might encounter this error when making HTTP/REST calls to an API, even if you think your making the call async. So what’s up with that? The Culprit What can commonly happen is you got some nested async call like this (simplified):

While Login will begin to execute async and the nested call to Authenticate (signature async Task<TokenResponse>) will also do so the assignment to this.TokenResponse (a […]

Xamarin Android App Performance

Java Max Heap Size

Here’s some basic tips to get your app running smoothly: Enable new Garbage Collector Add a text file to your Android project with build action Android Environment and set params. Here’s an example for using the tarjan GC:  

Source: Java.lang.OutOfMemoryError If you’re getting these it means you haven’t allocated enough memory to Java. To do this, check your Android project’s properties and set Java Max Heap Size to “1G”. Do this […]

Installing Xamarin tools

It can be challenging to get all the pieces together for Xamarin (Forms) to work. Here’s some guidance on how to get past those first hurdles. Install Xamarin for Visual Studio From Visual Studio 2015 Xamarin is included with the installer under Cross-Platform, but you can always use the standalone installer from Xamarin’s web site. Follow the steps of the installer to get going. This will add “Xamarin Visual Studio” integration and project / file […]