Open boriguen opened 5 years ago
Hi Boris,
Thank you for your interest in making here-aaa-java-sdk builds be Android friendly. However, your proposed patch of using apache commons-codec may not be possible. Previous versions of this library used apache commons-codec. This library caused conflicts with dependencies pulled in for certain use cases. So, we had to switch to java.util.Base64 in https://github.com/heremaps/here-aaa-java-sdk/pull/35 .
Does your Android-friendly requirement affect build time or only runtime? One possibility could be to create a Base64 interface in this project, allowing the developer to inject the Base64 implementation of choice, while keeping this project building with and using java.util.Base64 by default. However, for an Android environment, you could inject an alternate implementation of the Base64 interface using the your library of choice (commons-codec or android.util.Base64).
Regards, -Ken
Hi Ken,
Thanks for the feedback. The issue happens at runtime since I guess, my build classpath includes the Java SDK. I could likely make the classpath stricter.
Anyways, I like the idea of injecting the Base64 implementation of choice at runtime.
Thanks,
Boris
Hi,
What about using Android >= API Level 26, or 8.0? It seems these might support java.util.Base64, according to https://developer.android.com/reference/java/util/Base64
Thanks, -Ken
Hi team,
I'm trying to use this library in an Android project with minSdkVersion 24. Here is a quick recap of the problems I face:
My current workaround to get going is to copy those classes and make the small one-line changes to have them work with Android. I now use the Apache Base64 implementation in module 'commons-codec:commons-codec:1.10'.
I now have class AndroidOAuth1Signer.java:
And class AndroidSignatureCalculator.java:
So I'm using those two classes above via third class ClientAuthorizationRequestProviderFromAndroidProperties.java:
It does work well and I can get authorization from HERE Account.
So please let me know if there is any Android friendly direction you would like to explore.
Thanks,
Boris