question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions around Android usage

See original GitHub issue

Hey!

We’re currently using https://github.com/LiquidPlayer/LiquidCore (only the V8 part) on our Android app, but since it seems unmaintained and doesn’t support debugging, we’re looking for an alternative. At first the idea was to adopt J2V8, but then I found this project, and it seems much nicer than using J2V8 directly.

Our use case here is to have our native Android layer calling a JS layer, which uses libs from our company that in the end do network requests and then bring the results back to the native layer. Additionally, sometimes the JS layer will need to retrieve additional information given by the native layer through bridges.

While reading the documentation I gathered some questions/suggestions, mainly around Android usage, and I was hoping to share them before trying to integrate the library.

1. On the docs it says this:

  • [ZonedDateTime](https://developer.android.com/reference/java/time/ZonedDateTime) (since ABI 26) is polyfilled by org.threeten.bp.ZonedDateTime so that Javet can work well with low ABI version.
  • Stream and Optional are not supported because they are not available with ABI version 23-24.

Starting with Android Gradle Plugin 4.0, we can use coreLibraryDesugaring to desugar Java 8 APIs and access them freely on any Android API version. We’re currently using this on our app and it works perfectly. This would allow to drop the dependency on ThreeTenBp and I think it would be pretty easy to integrate.

2. If you need ABI version 21/22, please use Javet v1.0.x or contact the maintainer for details.

Our app is still targeting API 21 as minSdk. Is there any reason for the library to drop support for these? Is it because of the APIs that I mentioned above and that coreLibraryDesugaring` solves?

At the same time, the minSdk on the main branch still shows API 21: https://github.com/caoccao/Javet/blob/main/android/javet-android/build.gradle.kts#L30

Did this go forward?

3. We’ll need to implement XMLHttpRequest on the bridge, delegating to OkHttp. We’re already doing this for LiquidCore and it works fine.

Our data flow will be something like:

  1. Native
  2. JS
  3. Native (to make the HTTP request)
  4. JS (with the HTTP response)
  5. Native (with the final result)

In the middle of 2. and 3., JS might need to call additional bridges to gather information.

Do you foresee any issue we might find implementing it?

Thank you!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
GrahamBorlandcommented, Jul 26, 2022

Fantastic, thanks for the response! I’ll look at excluding it.

1reaction
caoccaocommented, Feb 25, 2022

Well, wish you a wonderful journey.

I’m fine with creating a long-term branch for v1.0.x. I think it’s better to keep it in the same place for the community. The docker build for Android should be good enough. And if you need me to release that branch to maven central, just let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Basics: Android: Frequently Asked Questions
This Android FAQ page offers answers to the most commonly asked questions about Android devices.
Read more >
10 most common Android questions...and the answers
10 most common Android questions…and the answers · How do I add a new email account? · Where do I find apps and...
Read more >
7 questions and answers about how teens use smartphone apps
The survey consisted of seven questions about phones and apps. The first question was... What kind of phone do you use?
Read more >
20 Essential Android Interview Questions and Answers | Toptal®
Comprehensive, community-driven list of essential Android interview questions. Whether you're a candidate or interviewer, these interview questions will ...
Read more >
Android Interview Questions Cheat Sheet — Part I - Medium
A set of questions that I have accumulated over the years in preparation for my many Android Interviews Prep.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found