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 #47

Open
krisskross opened this issue Feb 10, 2017 · 12 comments
Open

Android support #47

krisskross opened this issue Feb 10, 2017 · 12 comments
Labels
enhancement Additional or new functionality

Comments

@krisskross
Copy link
Contributor

As I try to phase users over from lmdbjni to lmdbjava it might be worth considering having support for Android also. The current lmdbjni release for android are built manually using the Android NDK through the ARM toolchain.

Since there are also other platforms such as MIPS we might choose not want to have an automated build procedure, but instead let users build releases at their own convince?

Thoughts?

@benalexau
Copy link
Member

benalexau commented Feb 10, 2017

There are several pieces to get this working:

  1. Ensuring JNR works at all with Android
  2. Building the LMDB native library for Android
  3. Resolving any LmdbJava-specific interop issues (eg buffers, unsafe, reflection etc)
  4. Continuous integration of the resulting LmdbJava Android integration

On the first item, I'm unclear if JNR works with Android:

On the second item, a quick look at the NDK Samples suggests compiling the native library on Travis should work. As such we could compile and deploy an additional LmdbJava Native target.

Item three is stalled pending resolution of items one and two.

Item four looks achievable on Travis given Android is officially supported.

So the main question is clearly surrounding JNR. Maybe we (or an interested community member?) could start with a "hello world" test of JNR calling any Android library, preferably migrating that to a public GitHub project and verifying via Travis. At least this would offer useful details for the earlier-mentioned JNR tickets (ie a proof of concept or specific issues to work through for the JNR project team).

@octalide
Copy link

I would love to see this come to fruition.

@mtunnel
Copy link

mtunnel commented Jun 28, 2018

Is there any chance in the status of this ticket? Can LmdbJava be run android now?

@benalexau benalexau added the enhancement Additional or new functionality label Dec 9, 2018
@EternalDeiwos
Copy link

EternalDeiwos commented Mar 12, 2019

lmdbjava/native#5 should add the necessary native libraries for armv7, armv8 and x86 which should cross off item two on this list.

I'll admit when I opened the issue at lmdbjava/native#4 I hadn't considered that there might be more blocking the use of lmdb on Android.

A quick look at recent issues/PRs on jnr/jnr-ffi had me find these:

The first two seem to have been resolved (and fairly recently at that, the changes haven't made it into a release yet) -- would it be wishful thinking to hope that JNR-FFI could "just work" after these changes?

@benalexau
Copy link
Member

@EternalDeiwos would you be happy to try the "hello world" test I mentioned above on Android? I do not have any Android developer toolchain or experience to move this forward myself. If you run into issue with "hello world" it's perhaps best to take it up with the JNR project so they have something specific to address.

Assuming Android theoretically works with JNR, from an LmdbJava perspective the only obvious thing we'd need to do is add some code to Library to auto-detect Android and try to find the correct system library. It may be a good opportunity to improve the library location logic as discussed in lmdbjava/native#3.

@EternalDeiwos
Copy link

I've set up a project with the example code and I'm running into the exact error they describe in the above issues. I've asked about a release containing those fixes so we'll wait and see whether that solves the problem.

@tomholub
Copy link

tomholub commented Jul 1, 2019

@EternalDeiwos do you know who is responsible for new releases? Who to ping? I would sure like to see if you can get a hello world sample working after my fixes 🙏

@EternalDeiwos
Copy link

@tomholub I see jnr-ffi and jffi both had releases containing your latest fixes on this topic approximately 24 days ago. It also seems that @benalexau published lmdbjava 0.7.0 28 days ago which seems to have just missed those releases.

I can fire up my test setup of lmdbjava again and give it a try with the new jffi version. I'll let you know as soon as I can.

@EternalDeiwos
Copy link

EternalDeiwos commented Jul 1, 2019

@tomholub @benalexau compiles and runs quite happily as far as I can see -- the only caveat is that due to some of the Java features in use it'll only let me build with minSdkVersion = 26 (Android O), so backward compatibility might be a bit of a problem for some. Haven't tried anything serious yet -- just getting it to compile really. Will try a bit more when I get a chance.

@EternalDeiwos
Copy link

@tomholub I've been doing some testing with the jnr-ffi library and it still isn't working. I'll mention you in the relevant issues there.

@mikemee
Copy link

mikemee commented Feb 21, 2020

@EternalDeiwos Curious if you abandoned this, or if you're still waiting on jnr-ffi issues to be resolved? I'm looking for LMDB on Android as well.

@EternalDeiwos
Copy link

@mikemee I'm still bumping this occasionally. See jnr/jnr-ffi#173 for the latest.

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

No branches or pull requests

7 participants