Forum Cross Platform with Xamarin

How do I create a simple game loop?


I have an unusual use case. I have an application that needs to run some code fairly frequently (say every 5 seconds). The application will remain in the foreground while this is happening. This seems a lot like a game to me, because it is okay for the application to suspend what it is doing if it goes into the background.

So, what I am needing is a simple, preferably cross-platform way to do this. I considered simply using a game framework, but I had two main concerns:

  1. I don't want to kill the battery. The amount of work the application has to do every few seconds is extremely small compared to a game (it doesn't even need to update the display most of the time and indeed the display may even be off), so I was concerned that a full game framework may be too heavy on the battery.

  2. Much of the application is much more suited to a Xamarin.Forms approach (master-detail data presentation etc.), and I haven't been able to find any information on how to get a game engine and Xamarin.Forms to sit side-by-side in the same application.

Any advice or pointers would be very much appreciated.

Kind wishes ~ Patrick

Best Answers


Sign In or Register to comment.