Coder Social home page Coder Social logo

mallet can not be used in android about mallet HOT 9 OPEN

mimno avatar mimno commented on August 15, 2024
mallet can not be used in android

from mallet.

Comments (9)

mimno avatar mimno commented on August 15, 2024 1

It looks like java.util.UUID might be a good replacement. If someone could suggest a fix and a way to test it on Android and regular JVMs, that would be great!

from mallet.

hao-fu avatar hao-fu commented on August 15, 2024

Same issue.

from mallet.

joshhansen avatar joshhansen commented on August 15, 2024

I've just run into this, too. Does anybody know where in Mallet the VMID class gets used? Maybe we could replace it?

from mallet.

joshhansen avatar joshhansen commented on August 15, 2024

The obvious search I should have already done: https://github.com/mimno/Mallet/search?q=VMID&type=Code

Looks like it's used in Alphabet, Pipe, and PagedInstanceList

from mallet.

joshhansen avatar joshhansen commented on August 15, 2024

I committed a switch from java.rmi.dgc.VMID to java.util.UUID on my fork, https://github.com/joshhansen/Mallet

It compiles and doesn't seem to affect the number of tests passing, but I can't necessarily vouch that it's doing the right thing.

As for testing Android compatibility automatically, I'm not aware of a method myself but I put up a Stackoverflow question that has one response already: https://stackoverflow.com/questions/51310507/how-to-run-junit-tests-in-an-android-runtime

I want to add that the recent change of compile target from 1.6 to 1.8 could introduce some issues for Android since support for Java 8 appears to be partial and only in the most recent Android versions. 1.7 would be safer as it's been fully supported since Android 5.

from mallet.

mimno avatar mimno commented on August 15, 2024

The changes in your fork look good, could you submit a pull request? (Thanks!)

We currently use very few 1.8 features, I'm upgrading mostly because it's been out for four years now. Is the issue that android will reject packages compiled against 1.8 or that it will choke on specific features?

from mallet.

joshhansen avatar joshhansen commented on August 15, 2024

PR submitted.

With current build tools (Android Studio 3.0+ and recent versions of Gradle) you can depend on Java 8-based libraries as long as they don't use features unsupported by your targeted Android API version. Right now the default API version is 19 which targets around 90% of devices. Many of the most useful Java 8 features require API version 24 which only has about 8% device support. There's a table here that details this.

So you can set your Maven source and target levels to 1.8, but you'd have to be careful to ensure that you never use unsupported features, at least to the extent that you want to support Android.

from mallet.

mimno avatar mimno commented on August 15, 2024

Thanks! I couldn't find any problems with it, but it's possible there could be odd bugs in multithreaded environments.

That sounds good about Android. I'm much more excited about supporting mobile devices than 1.8!

from mallet.

joshhansen avatar joshhansen commented on August 15, 2024

Yeah, lots of potential on mobile! Thanks for your help on this.

from mallet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.