I have been following an Okta tutorial from 2018 (which is the latest I can find) about adding OAuth to a Xamarin Forms and it references Xamarin.OpenId.AppAuth.Android which according to Nuget is prerelease (0.7) and also hasn't been updated since 2018.
This package won't work with my Xamarin app as it references an old v4 Android package and newer Xamarin uses v7 or AndroidX stuff.
So - is there a new package (updated <6 months ago) somewhere I can't find? Or is there a different method to do this now and if so - what is it?
Thanks in advance
First post, happy to edit / add info as needed, please just let me know
From what I have found, there is no direct upgrade for this and the solution is to simply use an alternative method. Personally, due to lack of knowledge in this space, I opted to use a different identity provider who had better support.
There are oauth libraries out there maintained by vendors in the identity and access management space. But this one seems to be more or less the official library to use with Xamarin apps: https://github.com/IdentityModel/IdentityModel.OidcClient
It is not maintained by a specific vendor, so it could be used with any of them with the proper configurations.
Xamarin provides the ability of creating Xamarin Binding Library for both iOS And Android. You can download the latest AppAuth .AAR file from the Maven Central Repository and create the Xamarin component and use it.
Download AppAuth.AAR file from
https://search.maven.org/search?q=a:appauth
Creating Xamarin Binding Library Walkthrough:
https://learn.microsoft.com/en-us/xamarin/android/platform/binding-java-library/binding-an-aar
Related
In case of Android project ORMLite has been used. I would like to know what is the equivalent package that should be used in case of Xamarin.Android application. From some blogs there is a mention of ServiceStack.OrmLite.
This url: https://github.com/sami1971/SimplyMobile/tree/master/libs/ServiceStack shows lot of options, but I am not sure which option should be used here.
Can anyone provide me their guidance along with a sample project implementation.
For Xamarin.Android projects you can use SQLite-net. This is the most used ORM like library in Xamarin.
You can get it from nuget and it's available for all the platforms (.Net based).
For applications like facebook, they provide SDK . I have used many third party libraries for different requirements. What is the difference between both the cases . That is the code bundled as library or as sdk
A Library is a chunk of code that you can call from your own code, to help you do things more quickly/easily. For example, a Bitmap Processing library will provide facilities for loading and manipulating bitmap images, saving you having to write all that code for yourself.
An SDK (software development kit) is a library (often with extra tool applications, data files and sample code) that aid you in developing code that uses a particular system (e.g. extension code for using features of an operating system (Windows SDK), drawing 3D graphics via a particular system (DirectX SDK), writing add-ins to extend other applications (Office SDK), or writing code to make a device like an Arduino or a mobile phone do what you want)
From this thread
Android SDK -> is the core features and software tools that allow you to create an app for the Android Platform. An SDK contains lots of libraries and tools which you will use to develop your application.
A Library -> is a collection of pre-built compiled code which you can use to extend your application's features. For example, you may need to show some graphics in your application. Instead of creating this from scratch, you may choose to use a pre-built library someone else has developed which will give you the features you need thus saving you some time.
Thanks to Nithish for this explanations
SDK is software development kit which provides a platform/a way to develop software while library project is a project which have some lines of code to solve any desire problem, it may have design or code files.
Generally library project focus only one problem but SDK is complete kit/tool to develop any task, if want some functionality in your code which is not present in SDK than we will go for any library project.
SDK is so that you can build applications for FaceBook. SDK can usually only be used in a more specific context. A library is so that you can take the library and use it on your own applications. A library is meant to be portable.
You can obviously use code from anywhere to anywhere, but I think thats the main difference.
I need to create an API library for Android and iOS. I have experience working with Android projects, but zero experties in iOS. I was wondering if I could create a Project library in Xamarin that compiles as a JAR for Android and as an... I-don't-know-which-type for iOS.
No, that isn't possible. Depending on what you are trying to accomplish there may be alternatives. If you are trying to make a library that can be used by others you could make it a Xamarin component - there is a component store you could put it on if you want it to be generally available, otherwise you can use any normal means of source or object distribution.
If you need to interact with a native app/library then you could make the C# code the "owner" of it and have it call into the native code. This works for both IOs and Android (and is used to work with e.g the play services from google).
No, it is unfortunately not possible to do that.
It seems to me that what you need is a Portable Class Library also known as PCL. It allows you to create a project which can be referenced by all Xamarin supported platforms (such as iOs and Android). There are obviously limitations to the approach like not being able to reference platform specific libraries but in your case (of writing an API) it should suffice.
You can read more in this link
Good Luck!
In Eclipse:
Is it possible to Sharing code between GAEJ and Android projects? And or GAEJ and another GAEJ?
Thanks
there was a nice talk about GAE & Android integration on the last GoogleIO 2012:
Google I_O 2012 - Building Mobile App Engine Backends for Android, iOS and the Web
they show how to use same data structures for data exchange between Android and GAE.
If you asking about how to set it up in Eclipse, I use the 'linked source' option in the source tab of Java Build Path. Here's a blog post with details:
http://blog.christoffer.me/2011/01/sharing-code-between-multiple-java.html
If you are asking about whether it is practical - from the code perspective - that is trickier.
When trying to share Android code with GAE/J I discovered that I had dependencies on android packages, e.g. android.util.Base64. Sharing code means dropping stuff like this and using 3rd party libraries instead. For example, the Guava library works on GAE/J and Android:
http://code.google.com/p/guava-libraries/
Logging is another problem. My GAE/J code was writing to java.util.logging.Logger, whereas my Android code ultimately logs to 'android.util.Log.println. If you use a common library framework like log4j or just writing to System.Out I think you will lose functionality in the log viewer - ideally you would have a logging library or shim that mapped to java.util.logging.Logger or android.util.Log.println depending on the platform.
I'm trying to use the Amazon Web Services Java SDK jar in an Android project in Eclipse, but it has references to org.apache.commons.httpclient. All I seem to have in my Android SDK (2.2) is org.apache.commons.http.client, which is a different namespace and obviously causes the build to fail.
I'm new to Java, Eclipse, and Android dev... is there a way to "map" one name space to the other or create some sort of symbolic link? If not, does that mean I have to import a "standard" org.apache.commons library?
Those are completely different libraries. Amazon is using the older 3.x version of Jakarta Commons HttpClient, since replaced by the 4.x Apache HttpClient.
is there a way to "map" one name space to the other or create some sort of symbolic link?
No. Particularly in this case, they are completely separate APIs. They have the same spirit, but the HttpClient folk rewrote the API significantly.
If not, does that mean I have to import a "standard" org.apache.commons library?
Yes, and hope for the best.