Code Monkey home page Code Monkey logo

Comments (14)

adolfintel avatar adolfintel commented on August 25, 2024 2

Yes this would be a good idea

from speedtest-android.

pec0ra avatar pec0ra commented on August 25, 2024

Let me know if you need my help!

If you don't have the time to do it I can also try to do it myself.

from speedtest-android.

pec0ra avatar pec0ra commented on August 25, 2024

Hello @adolfintel

It has been some time since I opened this issue.
Since I haven't heard any news from you I decided to go ahead and start making an independent library for LibreSpeed.

You can find it in my fork in the branch library: https://github.com/pec0ra/speedtest-android/tree/library
It can be compiled as a jar by using the task ./gradlew jar. The library can then be used by putting the jar in the libs folder of a java (or android) project with the following gradle dependency: implementation fileTree(dir: 'libs', include: ['*.jar'])

Here are a few points I wanted to mention:

  • To make the library more compatible (java in general), I removed android dependencies. This breaks the user agent which now doesn't know about the device type anymore. I am not sure what we should now use as a user agent here. Maybe this could be passed to the library as some kind of parameter.
  • I have flattened the packages to allow using package private visibility and only publish the required methods and classes.
  • I started the code from scratch in a new branch. I still don't know if you prefer a separate repository or just a separate branch. I couldn't make a pull request for a new branch on your repository anyway so you might need to take some action here.
  • Documentation (readme and preferably javadoc for public methods too) will still need to be written. As soon as I have some feedback from your side I will start writing it.

Let me know what you think.

from speedtest-android.

adolfintel avatar adolfintel commented on August 25, 2024

It's ok, I was planning to do this in the next update, that's why I didn't close the issue.

Your work seems pretty good to me. Removing the android dependencies was something that I wanted to do as well because I intend to use the core package as a base for the command line client that I'll be developing some time in the future. There's probably some way to keep both an android and a non-android version of the user-agent code in the same file (something like C preprocessor directives), you might want to look into it.

Good job, keep me posted :)

from speedtest-android.

pec0ra avatar pec0ra commented on August 25, 2024

The problem with the android code is that it needs some android libraries to be added to the build.gradle. I don't think we can load these libraries dynamically and it would probably be an overkill anyway.
What I suggest is adding an option to the config. We can probably already have a good default without android libraries (something like LibreSpeed/1.1.3 (Ubuntu 18.04...) and users of the libraries can easily improve it if they want.

If you want to use the code I have as a base, could you please create an empty branch in your repository? Then I will be able to create a Pull Request which will facilitate development.

from speedtest-android.

adolfintel avatar adolfintel commented on August 25, 2024

Done, there's a coreOnly branch now

from speedtest-android.

pec0ra avatar pec0ra commented on August 25, 2024

Thank you!
I have created a PR: #12
I will keep my remarks about implementation there

from speedtest-android.

MarceloTabian avatar MarceloTabian commented on August 25, 2024

I want to use the core only branch as a library. I checked out the branch, but it came empty.

Have I committed a mistake or is the branch really yet to be filled?

I have some questions related to de license. I read about LGPL, but it is a complex license.

I intend to use the core-only branch as a library in my proprietary Android App.

Am I allowed to do this if I generate a jar from the core only branch and then use the jar in the build of my proprietary app?

Am I allowed to do this if I simply include the source code of the core package directly in the build of my proprietary app?

Thank you.

from speedtest-android.

adolfintel avatar adolfintel commented on August 25, 2024

@MarceloTabian The branch is empty because the work on it was never finished.

To answer your questions:

I intend to use the core-only branch as a library in my proprietary Android App.

Yes, you can. The LGPL license merely requires that you release modifications to my code, you are free to use whatever license you prefer for yours.

Am I allowed to do this if I generate a jar from the core only branch and then use the jar in the build of my proprietary app?

Yes

Am I allowed to do this if I simply include the source code of the core package directly in the build of my proprietary app?

Technically it's possible, but I would strongly suggest creating a repo on github instead

from speedtest-android.

MarceloTabian avatar MarceloTabian commented on August 25, 2024

Thank you for the fast answer.

So I will try to compile the core package and generate a jar. Then I will include the jar in the project of the proprietary App.

If I modify the code of the core package, then I will submit a push to this git hub project.

Wouldn't it be better to have two separate github repositories, one for your app and one for your library as suggested before?

I really think that the separate library would be a great contribution of yours to Android developers.

If you or someone else modifies the core package, no action of my part is required, right?

from speedtest-android.

adolfintel avatar adolfintel commented on August 25, 2024

If I modify the code of the core package, then I will submit a push to this git hub project.

The core is designed to be independent from the UI, so you shouldn't have problems with that. Technically that counts as a modification according to the LGPL license but I'm willing to make an exception if you're not touching the core code.

Wouldn't it be better to have two separate github repositories, one for your app and one for your library as suggested before?
I really think that the separate library would be a great contribution of yours to Android developers.

Yes, that was the intention of the original author, he wanted to modify the core so that it could work as a library that could be used in any java app, and not just android.

If you or someone else modifies the core package, no action of my part is required, right?

No, but you should check for updates every once in a while.

from speedtest-android.

MarceloTabian avatar MarceloTabian commented on August 25, 2024

I have divided the project in two. Now, one project builds an arr, which is a library for Android, containing the core package and the other uses the arr and contains the UI package.

Using Android Studio, I created a project with two modules, an app and a library. Them I copied the files from the original project to the correct places.

May I push the changes to a new branch?

from speedtest-android.

adolfintel avatar adolfintel commented on August 25, 2024

That's great. Fork the project and make a PR to the coreOnly branch

from speedtest-android.

MarceloTabian avatar MarceloTabian commented on August 25, 2024

I did it, but named the branch split, because it contains both the core package, arranged to generate an arr, and the UI package to use the arr.

from speedtest-android.

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.