Xamarin questions - android

I have a few questions and I'm hoping some people could explain it a bit more.
Recently Xamarin has been released to the public for free and you're able to download/install it for free.
Let me say first that I have Windows 7 and Visual Studio 2015 installed on my computer.
I have succesfully installed Xamarin and the Java/Androids SDKs and got it running.
But now I have the following 'problems':
When opening a new Xamarin Forms project I get the following message:
"A problem was encountered creating the sub project 'Projectname.Windows'. This project requires a Visual Studio update to load. Right-click on the project and choose "Download Update"."
Is this because of my OS?
When opening the new project, the 'ProjectName.UWP (Universal Windows)' subproject always give errormessages on everthing.
Reason?
If I want to run the .IOS subproject, is the only way by connection a IOS device? Is there no emulator for example an Iphone?
Thank you.

It's possible that you don't have the SDK / tooling installed for Windows Phone, so you will have to download the update as described in the error message - this should resolve the problem.
What error messages are you receiving?
You need to connect to a Mac over the network which will allow you to build and debug your apps. You can deploy apps to the iOS Simulator on your Mac, or to an iOS device connected to your Mac, from Visual Studio. For more information on using Xamarin.iOS with Visual Studio, I would suggest the following guide: Introduction to Xamarin.iOS for Visual Studio

Regarding your questions.
1. You should check you updates of the Visual Studio. There are a possibilities that the supporting packages can't locate. The error says that you need to download the updates. Nah, it's not about your OS. If you are done installing the visual studio, then your IDE is working properly. The problem persist is whenever you are lack of updates and packages in the give project.
2. The error could be your pc has no windows emulator to support the UWP to run properly. If you have one, uninstall it and install again.
3. You can use emulator, iOS Emulator but you still need a mac. There's a agreement between microsoft and mac regarding this thing. So far, until now, you can't run iOS simulator in Windows without Mac devices with XCODE
I hope it makes sense.

Answers to your Questions
1. it may be a visual studio update issue, try with latest.
2. i think UWP projects are not supporting with windows 7 OS(correct me if i am wrong), and also try with shared project structure,because portable has some problems with windows 7.
3. Yes currently there is no iOS emulator for Visual studio, if you want to run your app on ios simulator you have to connect your visual studio to Mac machine and then you can run.
Hope this will help

Answering your questions:
1- you might need to upgrade to windows 10. I have solved many issues when I upgraded to Windows 10. VS 2017 works very well with win10.
2- I would definitely recommend downloading the Visual Studio emulator which is a dedicated standalone application that has many emulators. It's much faster and reliable than android emulator. Also it has iPhone and windows emulator too.
3- in order to be able to use iPhone emulator, you must either do:
A) have a Mac device in the network to be able to connect VS with it. And it must have xcode installed on it.
B) you can also do a vmware virtual machine on any windows device and install on it xcode.
For detailed explanation on how tondo the above you can find them on YouTube.
Hope you have more luck.

Related

How to run Android Studio Emulator in Windows 10?

I am new to Android Studio and the purpose I use Android Studio is just for the emulator, not to develop apps etc. I am using the latest Android Studio version 3.6. I want to do mobile performance testing on LoadRunner, and I will use Android Studio Emulator instead of real device. The problem now is, I only can run the emulator in the Android Studio apps itself. The performance test tools will need the emulator exe path. May I know if I can run the emulator in a standalone apps? Such as run in Windows in exe file? So far I know, when I downloaded the Android SDK package, it doesn't include the emulator.exe file.
I tried searching and tried the suggested solutions already but not working. May I know what's the problem here?
Using emulation to record mobile applications
You do not have to use Android Studio
I would suggest something like genymotion for personal use.
https://www.genymotion.com/fun-zone/

android emulators for xamarin forms

I'm having trouble getting any android emulator other than "Xamarin Android Player" to work (only with older versions of android).
What kind of virtual device/settings/properties should I use so that I can test newer versions of android and not have to wait 15 minutes for the emulator to startup?
is there a "Go-to" virtual device/emulator setup that doesn't take 15+ minutes to load?
(using windows 10/Visual Studio 17/2015)
The Xamarin android player has been discontinued for a while. As a visual studio user you should probably be moving onto the Visual Studio Android Emulator. There is a guide here on setup
https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/
it is also available with visual studio 2017, and if i remember correctly is an option available in the Vs2017 installer.
I highly suggest Genymotion for most uses. You can download the free version which works well for most basic things (there are also a few small things you can do using the adb command prompt without having to buy the full version, such as taking screenshots).
Link to free version
They have a good list of different devices. I have also recently even got it successfully connecting to my Parallels Windows machine while the emulator is running on my Mac. Let me know if you need help with this specific scenario.
The other option for you is the Visual Studio Android Emulator. When it first cam out I tried using it but was not able to because I would need to run it on a Parallels VM which does not allow nested virtualization.

Visual Studio Android Emulator won't run application

I recently got into Xamarin development. I have a lot of experience in Xcode making iOS apps and the iOS side was very straight forward. Now I'm trying to implement Android. I downloaded a Hello World example to get my bearings. When I run it I have no problems getting the simulator to show up (MonoForAndroid_API_10 and MonoForAndroid_API_12) but the actual application doesn't run, and does not show up anywhere on the simulator. Essentially whenever I use run or run with in Xamarin on Android, it pulls up a fully functioning, albeit empty simulator.
How do I get my application to run on the emulator?
Like the other commenters, this is most likely just a symptom of slow emulator on your machine. I'm running Xamarin-Android development on my 2010-era OSX machine in mavericks with 8GB RAM, and it is slow-slow-slow, but usable. Try to find the Intel x86 speeds improvements (look for HAXM) and you will find that the emulator will be much much faster.
And yeah, get a real handset and plug it in to your computer: always much faster than emulation.
later edit Get Genymotion for Mac OSX or for PC/Windows or PC/Linux. It's way way way faster than the other emulators. I have since found that this is as fast, or faster, than running the App on my connected Android phone. It's certainly simpler in not having to have the device plugged into one of my USB ports, and allows me to code and test on the train. http://www.genymotion.com/
Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB.
I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
I've created it manually and it worked.
UPDATE
Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well.
I had the similar issue, and then I deleted the existing device simulator and reinstalled again and it started working.
As I use a different SDK, in my case
Go to Tools > Options > Xamarin and set the Android SDK path.
Sometime Visual Studio changes this configuration;
2020 Update:
I followed the most voted comment, however, with Visual Studio 2019 updated recently, the steps have changed a little. Here is what previously worked:
WHAT WORKED BEFORE
"Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB. I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
I've created it manually and it worked."
WHAT TO DO INSTEAD
Nothing. Don't mess with the path.
WHAT WORKED BEFORE
"Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well."
Previous instructions image
WHAT TO DO INSTEAD
a. Go to Tools located at the top of the VS window, Get Tools and Features, go to Individual components, using the search tool in the pop up box, search "emulator", once you get the result, make sure both Google Android Emulator (API Level 25)(local install) and Intel Hardware Accelerated Execution Manager (HAXM) (local install) are both checked.
b. Close the solution(s) and restart VS then reopen the solution(s).
c. To deploy the app on the emulator, click Start button to spin up the emulator, left click on your Android project, then click Deploy. You should be able to see your app on your emulator's app menu.
Updated Instructions image
Worked for ME
Sometimes you close the android Emulator but not POWEROFF the Emulator.
this problem happens when emulator shutdown un-properly.
Restart Your EMULATOR
First start your emulator
Then restart your emulator by pressing down the power button and select restart option in your android emulator.
I enabled Hyper-V acceleration based on microsoft documentations: https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin&pivots=windows#accelerating-with-hyper-v
Basically you need to turn on these two windows features from the control panel (Turn windows features on of off):
Hyper-V.
Windows hypervisor platform.
then from visual studio go to: Tools >> Android >> Android SDK manager >> Tools >> make sure that "Android emulator" version is 27.0.1 or higher, if not, you will find in the same screen a button below to update it.
I did this on windows 10 64-bit, with VS 2017 Community 15.9.5

Android Application Deployment on LG P500 Device

I am developing the Web application in Android 2.2 and i want to deploy it on the LG P500 device. I am using Windows XP as an operating system. But i am facing the problem of installing the drivers on my system, it gives the error "Hardware not found the desired USB drivers". So give me any suggestion on this.
Also told me that it is possible on windows system or it required Linux System?
Thanks in advance....
There's a similar question about this on Superuser, and the answer appeared to be to download and install the LG Mobile Support Tool, then use it to install the drivers.
As for the second part of your question: Yes, you can develop on Windows. There are versions of the SDK for Windows, Mac and Linux. Most of the tutorials assume you are using Eclipse to develop, which is also cross-platform (as is Netbeans, another popular choice).
If you're looking to build the Android source, however, Windows is not currently supported.

Setting up Android SDK with Netbeans or Visual Studio?

I'd like to set up Android SDK with Netbeans or Visual Studio 2010. I am coming back to Windows programming after 3 months on Apple iMac (for iPhone programming).
Would somebody be able to explain how to set up the NetBeans environment so I can compile and test Android Apps directly form NetBeans.
I will be testing on a simulator, not a real device. My platform is Windows 7 Ultimate.
Thanks.
EDIT:
nbandroid is proving annoying to set up. It requires platforms. How do I install those?
It seems I can't use Eclipse even if I wanted to. It can't find the Java VM DLL... Help with that is appreciated.
You need to install the Android SDK and a NetBeans plugin called nbandroid. There are lots of instructions here.
I do recommend however using Eclipse because the plugin that you use on that is officially supported by Google, the Netbeans one is community developed I think, and a lot of the tools may be missing (like Allocation Tracker or Emulator controls. I don't know if they are in the netbeans plugin because I haven't used it but I'm guessing you wont have the full range of SDK tools available in the plugin).
Doesn't sound like nbAndroid is your problem. No matter how you develop you need to select the Android target platforms with the AVD Manager from the Android SDK.
You should download the 'ADT' plugin it allows to kickstart android development directly by using the eclipse exe in the zip file

Categories

Resources