Home

Awesome

Xamarin cross-platform mobile samples

==============

This repository contains a number of samples that show how to share code between Xamarin.iOS and Xamarin.Android.

License

See the license file and any additional license information attached to each sample.

Samples submission guidelines

This repository welcomes contributions and suggestions. If you want to create a new sample, you need to work with an employee to help bring the new sample into the repository. Start by raising a GitHub issue in this repository that outlines your proposed sample. Please note that samples in the MASTER branch of this repository shouldn't rely on preview or pre-release NuGet packages.

The Xamarin sample gallery is powered by this repository, and therefore each sample needs to comply with the following requirements:

This approach ensures that all samples integrate with the Microsoft sample code browser.

If you have any questions, don't hesitate to ask on the Xamarin Forums.

GitHub Integration

We integrate tightly with Git to make sure we always provide working samples to our customers. This is achieved through a pre-commit hook that runs before your commit goes through, as well as a post-receive hook on GitHub's end that notifies our samples gallery server when changes go through.

To you, as a sample committer, this means that before you push to the repos, you should run the "install-hook.bat" or "install-hook.sh" (depending on whether you're on Windows or macOS/Linux, respectively). These will install the Git pre-commit hook. Now, whenever you try to make a Git commit, all samples in the repo will be validated. If any sample fails to validate, the commit is aborted; otherwise, your commit goes through and you can go ahead and push.

This strict approach is put in place to ensure that the samples we present to our customers are always in a good state, and to ensure that all samples integrate correctly with the sample gallery (README.md, Metadata.xml, etc). Note that the master branch of each sample repo is what we present to our customers for our stable releases, so they must always Just Work.

Should you wish to invoke validation of samples manually, simply run "validate.windows" or "validate.posix" (again, Windows vs macOS/Linux, respectively). These must be run from a Bash shell (i.e. a terminal on macOS/Linux or the Git Bash terminal on Windows).

If you have any questions, don't hesitate to ask!

Other samples

Galleries

We love samples! Application samples show off our platform and provide a great way for people to learn our stuff. And we even promote them as a first-class feature of the docs site. You can find our two sample galleries here:

Sample GitHub Repositories

These sample galleries are populated by samples in our six sample GitHub repos:

The mobile-samples repository is for samples that are cross-platform. The mac-ios-samples repository is for samples that are Mac/iOS only.