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

Java SDK Update #50

Open
michaelkimball opened this issue Jan 31, 2024 · 2 comments
Open

Java SDK Update #50

michaelkimball opened this issue Jan 31, 2024 · 2 comments

Comments

@michaelkimball
Copy link

We're actively working on a refreshed Android SDK

When V3 of that SDK is released we plan to base the Java SDK off the same kotlin source. We'll take it out of beta at that point.

Originally posted by @pauldambra in #45 (comment)

I see that the V3 of the Android SDK was released back in December. How is the update of this SDK going? Are we able to use this https://github.com/PostHog/posthog-android/tree/main/posthog library without Android? (https://mvnrepository.com/artifact/com.posthog/posthog I believe). If so, can the docs https://posthog.com/docs/libraries/java be updated to reflect the new usage?

@marandaneto
Copy link
Member

marandaneto commented Feb 1, 2024

Hi @michaelkimball

Sadly not yet since https://github.com/PostHog/posthog-android/tree/main/posthog uses local storage caching which isn't available on non-Android devices.
The most important part missing is implementing in-memory caching, so events are cached in memory and sent in batches, probably a few other small changes but not much more.
The other thing is context isolation, since PostHog is a static class, it works for a single-user context but not for backend apps in which each request coming in is a different user, eg calling identify on thread A cannot leak to thread B, etc (Thread-local storage or allow one single instance per thread).
Those are the 2 major things that should change.

I cannot promise but I'll bring it into our Q2-24 plan, we are focused on making PostHog more mobile-friendly in Q1, stay tuned.

I'd be very happy to guide you in case you are willing to contribute and submit a PR though.

@marandaneto
Copy link
Member

Relates to PostHog/posthog#16419

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