Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (67 sloc) 3 KB
Quick tutorial on how to create a new sample application in MonoDevelop.
Setting up the Project:
* Create a new library project and add a reference to XobotOS-debug
(don't worry, XobotOS-debug is an executable project)
* Create your AndroidManifest.xml and res/ directory.
For instance:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
<application android:name="TestApplication"
android:label="XobotOS Scroll View">
<activity android:name="TestActivity">
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android=""
* Create your Application and Activity classes as specified in the manifest.
* To build the resources, you need to run prior to building:
Go to Project / Options / Build / Custom Command, then add a new
"Before Build" command.
Command: ${SolutionDir}/ ${ProjectDir} ${ProjectConfigName}
Working Directory: ${ProjectDir}
Don't check Run on external console.
This will add the following to the .csproj:
<Command type="BeforeBuild" command="${SolutionDir}/ ${ProjectDir} ${ProjectConfigName}" workingdir="${ProjectDir}" />
* Build the project.
This will run xorpt and generate the in the project
Xorpt (XobotOS Resource Packaging Tool) is a slightly modified version of
Android's aapt tool, which creates a R.cs and packages the
AndroidManifest.xml and all resources into a resources .zip file.
We embed this resource file in the assembly.
* Add the generated R.cs to the build.
* Add the generated as an embedded resource called
"XobotOS.Resources" (you must use this name).
To do this, add the file, then
right-click / Build Action / EmbeddedResource
right-click / Properties and set Resource ID to "XobotOS.Resources".
* Now you can simply access your resources, for instance:
public class TestActivity : Activity
protected override void onCreate (android.os.Bundle savedInstanceState)
base.onCreate (savedInstanceState);
setContentView (R.layout.scroll_view);
* Rebuild the project to make sure the resource file is embedded.
To run this, simply run XobotOS.exe and pass it the assembly filename as
command-line argument.