how to ensure backward-compatibilty in a xamarin forms application? - xamarin

How do i make sure my app can run on android devices below Lollipop( version 4.03 to 4.42). I watched a xamarin university video that says xamarin forms supports android version 4.03(ice-cream sandwich) and upwards. I also read about runtime checks and feel like this might be the answer to my problem, but how can i write runtime checks for android when basically all my ui and logic is contained in the PCL project?

The first thing to do is ensure you are using the Android AppCompat library. I think new projects use this by default now. If you have an older project that doesn't follow these instructions to update. This will allow your app including any Material Design look and feel to run on older versions of Android.
If you do things differently based on Android version, put the code for this in the Android project and use dependency service to call it.
Like this:
if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
{
// level specific code here
}

Related

Cross Platform Blank App Xamarin Project

I'm trying to create an app using Visual Studio and Xamarin that will be cross platform. I've been trying to follow a tutorial I found online to do this.
When the guy in the video went to create a new project, he had the below screen, and created a Blank App (Xamarin.Forms Portable
I've installed the necessary components (Xamarin, WPF and a couple of others) with the IDE, however I don't see this option.
I've created a project using Mobile App (Xamarin.Forms) but it doesn't have the same structure as the desired template. Am I missing a component? Is the template called something different now?
The video is almost two years old, which means that some parts look different today.
If you click on the create a new xamarin.forms app, you will come to a new step where you can choose a blank app.
Then you have a choice, either choose shared projects or .net (portable).
The .net will give you a portable class library, like that in the video.
The two methods have different advantages.
Read more in the documentation: https://learn.microsoft.com/sv-se/xamarin/cross-platform/app-fundamentals/code-sharing
I hope the information will help you!

Cannot add Judopay to Xamarin forms project

I am trying to include Judopay in my project, and I was able to add it to Android and iOS, but not to the Xamarin forms project. There is no NuGet to be included and I can't seem to add the component reference. Any idea on how can I add it? I cannot use any of these:
using JudoDotNetXamarin;
using JudoPayDotNet.Enums;
using JudoPayDotNet.Models;
Again, they only work on iOS or Android, but not Xam forms.
That is because they only provide platform implementations. You will need to tell your Forms app which implementation to use at what time.
The correct way to go about this is with some form of IoC, using dependency injection or service location. Luckily Xamarin Forms has this integrated:
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/dependency-service/introduction/
Using the references from the Android or iOS projects in your shared code will likely not work completely or break things. Maybe not immediately but surely later on. (Except when there really is no platform-specific functionality, then you might get away with this.)

Why is the Camera of AreaLearning Demo Sence different from Gankino and IKariotikos Version? Is there a special reason?

Hello? I am a Korean developer who is developing using the Tango Unity SDK.
I'm using the GanKino version and are now updating to the IKarioTikos version.
Is there a specific reason to use TangoCamera instead of Tango ARCamera in IKarioTikos's Demo Sence, AreaLearning?
Actually the change has been made since Gankino's update in may 2017. If you look at the release notes, it says:
SDK updates: The Tango Unity SDK now has a single TangoCamera prefab
that supports the TangoARCamera and TangoDeltaCamera use cases.
What I understand is that they just grouped the different prefabs they used to have (TangoARCamera, TangoDeltaCamera) into one single prefab called TangoCamera. The point is that they didn't update the examples so AreaLearning example still uses the now deprecated TangoARCamera.
Except the fact that they say it is now deprecated, I personnally have no problem of still using TangoARCamera prefab in my app. I might change when the examples and tutorials will be fully updated.
TangoARCamera and TangoDeltaCamera have been deprecated in the latest release. You can just use TangoCamera now. Just remember to enable the TangoARScreen script component in order to enable AR functionality.
I've successfully built and run AR apps with TangoSDK_Ikariotikos_Unity5 on Unity 5.6.3f1 using the above approach. Do note that initial releases of Unity 2017 does not support the Tango downloaded package so best to use 5.6.xxx

Using the Nativescript platform-specific project

To my understanding, Nativescript takes the javascript (or typescript) + nativescript code and creates project files for both android and ios in order to be able to run them as native apps. I also know that these files all seem to be located in the Resources directory. However when I try to run a simulator from the xcode project that is created, it fails.
I don't want to know how to fix the simulator failure, I just want to know if it's possible for a swift developer to take the xcode project created by Nativescript and continue developing as a regular native app.
If so, is this possible with the android project as well?
Please check this out
https://www.nativescript.org/blog/using-nativescript-in-an-existing-native-ios-android-applications
The two articles explain in detail how you can embed the NativeScript runtimes in native Objective-C and Android applications.

Xamarin.Forms : how to install NGraphic package in UWP Project

I have a Xamarin cross-platform project which contains an Android and an iOS app. Now I want add new UWP project, but there certain packages which are not compatible with UWP but are compitible with Android and IOS.
Packages like: NControl.dll, NGraphics.dll
At the time of my writing this answer, UWP is not supported for those packages; but there are open Pull Requests to add UWP support to both NControl & NGraphics:
NControl: https://github.com/chrfalch/NControl/pull/71
NGraphics: https://github.com/praeclarum/NGraphics/pull/63
As such, you can likely track these pull requests to get an idea of if & when that support is added. I cannot speculate on a timeframe or any certainty of whether or not these pull requests will be approved eventually; for example it is possible support could be added from other pull requests instead.

Resources