Reputation: 7299
Today i download the visual studio 2015
.because i want to start android programming.
So i download xamarin for visual studio
as you can see here :
So other packets are installed as you can see here :
So i create a blank apps
and the code is like this :
namespace App1
{
[Activity(Label = "App1", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
int count = 1;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button>(Resource.Id.MyButton);
button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
}
}
}
I install this file but i don't know what is that exactly i think it is simulator mono-4.2.2.30-gtksharp-2.12.30-win32-0
.
But when i run this program
I get this error :
Severity Code Description Project File Line Suppression State
Warning @(Content) build action is not supported App1 C:\Users\ehsan\Documents\Visual Studio 2015\Projects\App1\App1\Properties\AndroidManifest.xml
Some thing that i should add is there is no emulator in the list of visual :
The sdk manager :
Upvotes: 2
Views: 1613
Reputation: 4652
Another option is to use the Xamarin Android Player: https://xamarin.com/android-player. I have found that it works very well and is pretty fast. I know the question was about VS's emulator, but this is a good alternative if you can't get that working.
Upvotes: 0
Reputation: 3306
Check whether Visual Studio Emulator for Android is installed or not.
If not installed, click here for download.
Documentation : http://blogs.msdn.com/b/visualstudioalm/archive/2014/11/12/introducing-visual-studio-s-emulator-for-android.aspx
Steps to Install and configure Visual Studio Emulator for Android : https://msdn.microsoft.com/en-us/library/mt228279.aspx
Warning @(Content) build action is not supported
There is a small workaround for this warning.
Properties
of AndroidManifest.xml
Build Action
as None
Upvotes: 0
Reputation: 7903
You need to do 2 things for getting the emulator to work properly -
Then launch the Emulator and ensure you see the home screen is loaded in the Virtual device then start the application from Visual Studio. It will then install the apk into the Virtual device and launch your app.
See the sample image of SDK manager installation components
Upvotes: 1