Can we build a Xamarin based android system application in visual studio or Android studio IDE? - xamarin.forms

I want build and debug a xamarin based "SYSTEM" android application in visual studio. Is it doable?

Yes it is doable, therefore you need this:
Xamarin.Android 7.5 or later
Android Studio 3.x with Java 1.8
More information how to set up the system you can find here.

Here is some basic information from MSDN that you can start with for distributing your Xamarin.Android app as a System app.
It's difficult to provide specifics on this topic because the way you go about doing this can shift dramatically depending on your setup. Even MSDN states that. The article provided though is a great starting point to begin to understand how to go about installing your app as a system app.

Related

Xamarin Android app out of the box shows undefined Android.Support, Android.Views, Android.Content in MainActivity

I needed to rebuild my fairly ancient Xamarin Forms app from scratch and in the process arrived at a situation where I had a new working iOS app but had needed to delete the draft Android app and start it again. So as a next step I added a vanilla Android app project out of the box and immediately what I saw was that (in MainActivity) Android.Support, Android.Views and Android.Content were undefined with wiggy red lines beneath -- for example in a reference to Android.Support.V7.Widget.Toolbar.
Trying to solve the problem, I set each of Target Framework, Minimum Android Version and Target Android Version to Android 9.0 Pie (API Level 28). In SDK Manager I checked that Android SDK Location and Java SDK Location were 'Found' and that Android SDK Platform 28 was installed.
The following NuGets came installed along with the project, I deleted them and reinstalled them (removing bin/obj folders in between): Xamarin.Android.Support.Core.Utils, Xamarin.Android.Support.CustomTabs and Xamarin.Android.Support.Design.
I tried installing NuGets Xamarin.Android.Support.v7.*. And I added the Xamarin.Forms NuGet. I tried adding 'use' declarations.
None of this helped.
For comparison I separately installed a blank Android app solution-- it worked perfectly out of the box.
Android is pretty new to me - would be grateful for suggestions on fixing this.
The app has a .NET Standard 2.0 project, an iOS project, the (vanilla) Android project (all three with Xamarin Forms), and a .NET Standard 2.0 library project.
I'm using Visual Studio for Mac V8.5.4 (stable) on MacOS 10.15.3.
I noticed that the content of MainActivity.cs is quite different, depending whether the Android project is created separately or as part of a Xamarin Forms solution. Also the provided NuGets are different. So perhaps what I was trying to do, adding an Android app to an existing XF solution, is simply not allowed.
To fix the problem, I created an empty Xamarin Forms solution with Android and iOS projects, added a further empty library project, then in Finder replaced the content of all the project folders, except the Android one, with the content of the corresponding folders in my working solution (the one with a working iOS app).
Migrating to AndroidX is a good idea though.
I don't know if this will help, but you should migrate to AndroidX as soon as possible, nevertheless. Xamarin has migrated to them, starting from Forms 4.5
Here is some more information about the libraries - Introducing AndroidX for Xamarin
There is a special NuGet package for the migration - Xamarin.AndroidX.Migration. Also available is a built-in functionality in Visual Studio - here
What I can suggest is you try to migrate to AndroidX libraries, since the old support libraries won't be supported from now on, and you will surely encounter some issues if not like this one, then something else will pop-up in the future.

Does VS2017 support Edit & Continue in Xamarin forms?

I'm just starting out with Android development using Xamarin in Visual Studio 2017.
This question suggests that E&C isn't possible, but that was a couple of years ago.
Is it still not possible to put a breakpoint somewhere in, for instance, MainActivity.cs, and then edit the surrounding code when it hits the break?
I'm using an Android 6.0 emulator created using the Android Virtual Device manager.
This feature is not yet available in Visual Studio 2017 for platforms like Android and iOS however this works on UWP platform.
In this comment. Rodrigo Kumpera says:
We're constantly evaluating what's the best to do for our users. We
know how awesome it would be to have Edit and Continue - we really do.
That proves that this feature is not yet available.

Xamarin Forms how to check it contains the latest Api for Android and iOS

Hi newbie on Xamarin Forms.
I am a bit of confuse on using Xamarin forms.
With the following questions, I hope you can help me to understand to use it for development.
Currently I am using VS2015 Community version
1) If I have done the Settings on Cross Platform development to include C#/.Net(Xamarin v4...), do I still need to download the Xamarin at Xamarin.com?
2) Understand Android and iOS have different Api level (Sdk ver) and iOS ver8,9,10 respectively.
So, When google releases new api or Apple releases new iOS ver, How do I update Xamarin to use them? what I need to and How I handle Android and iOS new update respectively? What are the steps to take?
3) If I have Updated Xamarin, is this means it has included all the latest Api for Android and iOS
4) Can I use Xamarin for VS2017 as compare to VS2015 is more matured?
Thanks
You can and should use latest and greatest tools available, unless you have some limitations. Use Visual Studio 2017, it provides an easy installation of Xamarin.
When a new version of platform SDK is released by Google or Apple for example, you will have to:
Download & install new platform SDK for Android / iOS
Update Xamarin.Forms nuget package in the project
Additionally in case of iOS you may need to update Xcode
Xamarin.Forms documentation can answer all of your questions, so I suggest to get familiar with it.
I think you'll need to add some steps.
First - try create Xamarin Forms project and buil it(for Android). If you have errors - please read this manual
You need to check the update in several places.
2.1. About the new version Xamarin you will be informed Visual Studio.
For VS 2015 Check next setting - Service - Parametrs - Update Xamarin(checked).
For VS 2017 - You'll see the checkbox on the top right.
2.2 About update Android Api -You must learn manually. Check in VS
Service - Android - Package manager SDK Android. The new AIPI is a great event in the world of android - but you need to sit behind the news.
2.3 Also packages(Xamarin Forms and other) are updated - you need check nuget packages for your solution.
2.4. You must manual run update Xamarin for your mac. This is an extensive topic. Please read this article.
No is it. You need some manual actions(see item 2).
VS 2017 Has new features and new bugs ). I use VS 2017.

Can we compile an asp.net 5 application by .net native?

The role of .net native in .net ecosystem is confusing for me. I heard it is just for universal windows applications, but also heard that it is part of CoreFX. I think having the option to compile to .net native can have many advantages (including performance).
Is it possible to compile my asp.net application (specially asp.net 5) to .net native?
No, you cannot. Right now, .NET Native is not for ASP.NET. I believe it's only for Universal Windows Applications. That doesn't mean that one day it won't be available, but right now it's not planned.
See related GitHub issue where ASP.NET team confirms this.
Edit 11/27/2015
Since this was posted, Microsoft has made further announcements regarding .NET Native and .NET Core. I suggest you check out Scott Hanselman's part of the keynote from the Microsoft Connect 2015 event. At the 11:22 minute mark of this excerpt video Scott shows compiling an .NET app to native code and then running it. He says it's "future work" so it appears it's not quite ready yet (I believe one of the Q&A videos from the event explained that it's in one of the dev branches on GitHub, but I'm too lazy to rewatch all the videos for you at the moment). It was unclear if this is only working for console apps at the moment or if it will run ASP.NET.
As Thomas says in comments, this should be possible once LLILC is out. It targets .NET Core which is what ASP.NET 5 runs on. I am not sure if the resulting runtime can be called .NET Native per say but LLILC do has plans to natively compile IL (e.g. output by Roslyn) ahead-of-time.
Another option is ASP.NET running on CoreRT by using RyuJIT as AOT compiler. This looks closer to reality today than LLILC. Have seen some experiments in compiling ASP.NET project on CoreRT but nothing that actually works.
[.NET Native makes use of UTC compiler which compiles to run on some C++ runtime (MRT - either minimal runtime or managed runtime, cant remember, also known as Native runtime). Currently the .NET Native UWP apps are windows specific. Though .NET Native and UWP are advertised under .NET Core, this could be misleading as only in debug mode UWP targets CoreCLR, in release mode it targets native runtime which is Windows specific. LLILC/CoreRT should change that.]

How can I deploy SQLite in WinRT devices with an ARM CPU?

I'm developing a C# Window8 / WinRT app and I'm using SQLite-NET with the sqlite3.dll linked at the bottom of the documentation at
https://github.com/praeclarum/sqlite-net
My project works fine on my computer, but since sqlite is a non-managed DLL, I wonder what's going to happen when I deploy my app to the app store and someone with an ARM cpu tries to run it. Is it going work? If not, how can I make it work?
Thanks,
Adrian
No, it's not going to work. You cannot choose a neutral architecture (Any CPU) when there is a C++ component involved. You will have to compile your SQLite DLL into ARM in order for you to have an ARM version. If you have a native component, you will submit multiple versions for the Store and the customer will download the correct version for their architecture.
Good blog post on Windows on the ARM architecture.
The only thing I know is that Microsoft is working with guys from SQLLite and is now officially supported

Resources