FlatRedBall supports game development on Android devices. This section will show you how to make FlatRedBall Android games.
FlatRedBall Android game development requires a Windows PC just like regular PC game development.
Since FlatRedBall requires using the C# programming language, FlatRedBall Android development requires using the Xamarin compiler, which is freely available when installing Visual Studio.
Primary Android vs. synced Android projects
FlatRedBall supports creating a primary Android project as well as a synced Android project.
A primary Android project refers to creating a single solution file (.sln) is created. This solution file can be opened in Xamarin Studio or in Visual Studio.
A synced Android project refers to creating two solution files – one for PC and one for Android. The PC project is developed as a regular FlatRedBall PC (desktop) project in Visual Studio. The FlatRedBall Editor generates an Android project, and keeps it in sync with the PC project automatically.
Benefits to creating a primary Android project:
- Shorter initial setup
- Less hard drive memory usage
- Simpler file structure
Benefits to creating a synced Android project:
- Superior debugging support on PC platforms when compared to Android debugging
- Faster execution of a project as compared to deploying to an emulator or physical device
- Allows multiple team members to develop and run the project without installing Xamarin
- Improved iteration speed through edit-and-continue and automatic content reloading at runtime.
For more information on synced projects, see the synced project page.
Creating a primary Android project
Creating an Android project is essentially identical to creating any other platform:
- Open the FlatRedBall Editor
- Select File->New Project
- Enter a project name
- Set the Platform to Android
- Click Create project!
Select the desired project type in the wizard, or close the wizard to begin with an empty project.
Click the Visual Studio icon to open the project in Visual Studio:
Now that the project is in Visual Studio, you can develop an Android game the same as if you were making a PC game, including using Glue.
To launch the game:
- Open your Android emulator of choice (such as the Xamarin Android Player)
- Verify that the Play button in Visual Studio has the desired emulator selected. Note that if a physical Android device is connected to your computer and is set up for debugging, then Visual Studio will detect it as a deployment option.
- Press the Play button
Creating a synced Android project
Synced Android projects are created just like any other synced project. The first step is to create a regular Windows Desktop project. Once the project is created a new synced Android project can be created as follows:
- Open Glue
- Select Project->View Projects
- Click the New Synced Project button
- Select the Android option
- Enter a project name
- Click Make my project!
The project will take a moment to download and be created, but once it is, you will see the Android project listed in the Androids project list.
Since your Glue project now has multiple platforms, you can choose which project to open through the Projects tab.
Releasing an Android Project
To create an Android APK, whether for internal testing or for final release, see the Microsoft release documentation.
Unfortunately deploying to Android can be fickle at times, and sometimes no errors are provided.
App crashes immediately
If your app crashes immediately without a call stack, then you may want to try the following:
- Does the app work on Android hardware? Sometimes an app will not work on emulator but will work on hardware
- Have you tried creating a Xamarin Forms project? Xamarin Forms projects can be created with templates which are maintained by Xamarin, so they are likely to eliminate common problems in template setup. If a Xamarin Forms project doesn’t work, then that might mean that prerequisites are not properly installed.