Ehsan Akbar
Ehsan Akbar

Reputation: 7299

No emulator device found in my visual studio to run my android app

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 :

enter image description here

So other packets are installed as you can see here :

enter image description 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

enter image description here

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

enter image description here

Some thing that i should add is there is no emulator in the list of visual :

enter image description here

The sdk manager :

enter image description here

Upvotes: 2

Views: 1613

Answers (3)

valdetero
valdetero

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

Yksh
Yksh

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.

  • Select Properties of AndroidManifest.xml
  • Set Build Action as None

Upvotes: 0

Carbine
Carbine

Reputation: 7903

You need to do 2 things for getting the emulator to work properly -

  1. Install the necessary components in the SDK manager for the Android version you are targetting. Along with System Image.
  2. For that system image you can choose a preset virtual device present in the AVD Manager.

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

enter image description here

Upvotes: 1

Related Questions