fiskaly / fiskaly-sdk-dotnet

fiskaly Cloud-TSE SDK for .NET and Xamarin
https://developer.fiskaly.com
MIT License
6 stars 4 forks source link

add android xamarin support #11

Closed pgaubatz closed 4 years ago

pgaubatz commented 4 years ago

warning: not tested yet, but may magically work anyways.

mrvnagstn commented 4 years ago

i will try it, can you tell me which .so file i should use? is there a special one for android or can i use one of the linux ones? thank you

pgaubatz commented 4 years ago

Hi @mrvnagstn, thanks for testing! You'll have to use the android version of the client. more precisely, the android archive (.aar file) will have to be imported in your project's dependencies. Maybe the following guide may be helpful: https://docs.microsoft.com/en-us/xamarin/android/platform/binding-java-library/binding-an-aar

mrvnagstn commented 4 years ago

@pgaubatz thank you, but i told @prempador already that i am getting following error if i am bind the new android archive into a xamarin binding: BINDINGSGENERATOR : warning BG8601: No packages found.

Build action is set to "LibraryProjectZip". What i am doing wrong?

mrvnagstn commented 4 years ago

Okay, another handling worked:

1) downloaded this branch -> open project -> add compiler directive "Android" -> build SDK project

2) added "fiskaly-dotnet-sdk" with precompiled "Android" to link to AndroidClient to my xamarin project

3) added extracted .so files from your .aar for all ABIs and set the build action to "AndroidNativeLibrary"

4) "client.ConfigureClient()" and "client.Request" is working

prempador commented 4 years ago

Thank you very much @mrvnagstn for testing this out, we are in no way professionals with Xamarin.

pgaubatz commented 4 years ago

Hey @mrvnagstn!

Thanks for finding a way for making this thing work!

added extracted .so files from your .aar for all ABIs and set the build action to "AndroidNativeLibrary"

Although I am glad that this approach works, I am not really convinced that this is the most elegant way of solving this problem. I quick google search lead to me this page: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-process#androidaarlibrary I believe it should be sufficient to just reference the downloaded .aar file in your build process as a AndroidAarLibrary. Do you think you could give this a try as well?

mrvnagstn commented 4 years ago

@pgaubatz yes, i will check it - i think it could probably solve the issue to import the .so files manually but actually i cannot use your nuget-dotnet-sdk because its compiled without the "Android" directive. may you have to deploy a second one for Android? and another view: if i "reviewed" it correctly your methods in your android archive are non-public or obfuscated so the binding generator cannot use this. (https://forums.xamarin.com/discussion/84619/binding-android-library-not-generate-all-class) or at least: the AndroidArchive on Xamarin can be used only for importing the .so files and via the dotnet-sdk(with android directive^^) will be the methods in *.so files invoked?

and if its not working, can we use still the working version?

another point, not directly attaching this request but actually i cannot use your nuget on windows because its not signed with strong name - could you handle this? we need this for clickonce deployment.

mrvnagstn commented 4 years ago

@pgaubatz good morning, the check with only included android archive with your proposed build action works as well. no extraction of *.so files needed anymore.

but the two points with the nugets would be nice if you could solve it:

thank u :)

mrvnagstn commented 4 years ago

do you have an update for me?

prempador commented 4 years ago

I think @auxdevelopment is working on it. Maybe he can tell you more!

mrvnagstn commented 4 years ago

hi @auxdevelopment, can you? :)

auxdevelopment commented 4 years ago

Android support will be included with the next client release (should be happening today).