Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android support #62

Closed
kdarrimajou opened this issue Apr 3, 2020 · 12 comments
Closed

Android support #62

kdarrimajou opened this issue Apr 3, 2020 · 12 comments

Comments

@kdarrimajou
Copy link

Hi,

As mentionned here, do you plan to support Android (java=1.7) in an other repository iabtcf-Android ?

@laktech
Copy link
Collaborator

laktech commented Apr 3, 2020

we were aiming for 1.8 support, what sort of support does android have for 1.8?

@kdarrimajou
Copy link
Author

The main problem is about Instant class which is not available until Android api level 26. So if you replace Instant by Date (or timestamp or something else from java 1.7), iabtcf-java will support older Android versions.

@laktech
Copy link
Collaborator

laktech commented Apr 6, 2020

Does usage of java.util.stream cause problems for Android?

@kdarrimajou
Copy link
Author

No problem with java.util.stream because it is not exposed to user. The only problem that I see is java.time.Instant.
I offer my help to test your SDK with an Android project, if you need.

@laktech
Copy link
Collaborator

laktech commented Apr 7, 2020

Hm, I'm not an android expert but that doesn't make sense. Applying your argument, since Android doesn't support Instant and if I were to use it in a way that is "not exposed to the user" why would that work?

@kdarrimajou
Copy link
Author

Like it says here or here, some configurations in Android project allow us to use java 1.8 library.
But we can't use java 1.8 object in our Android code for some Android level API (under API 26 for Instant).

I cloned iabtcf-encoder project and tested it on an Android project, and it works by replacing Instant by Long (for example).

@laktech
Copy link
Collaborator

laktech commented Apr 8, 2020

can you test the following code snippet,

BitSetIntIterable.from(10).toStream();

@kdarrimajou
Copy link
Author

You are wright, I can't use java 8 languages API for Android API level under 24. It's not as simple as I thought.

Thanks for your time. I think we can close this issue.

@laktech
Copy link
Collaborator

laktech commented Apr 9, 2020

can you try this, https://developer.android.com/studio/write/java8-support ? It looks like the way in which you use java8 code in android is you have to recompile it. Have you explored this?

@kdarrimajou
Copy link
Author

Yes, I have. Recompilation works fine on newest devices (API level 24+), but when I test on old device (API level under 24), I get java.lang.VerifyError on runtime.

@laktech
Copy link
Collaborator

laktech commented Apr 12, 2020

Do you need to support API level under 24?

@laktech laktech closed this as completed Apr 13, 2020
@kdarrimajou
Copy link
Author

Yes, I do. Device under API 24, represent more than 25%. This not negligible for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants