Comments (14)
Yes this would be a good idea
from speedtest-android.
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.
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.
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.
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.
Done, there's a coreOnly branch now
from speedtest-android.
Thank you!
I have created a PR: #12
I will keep my remarks about implementation there
from speedtest-android.
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.
@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.
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.
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.
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.
That's great. Fork the project and make a PR to the coreOnly branch
from speedtest-android.
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)
- Multi-data source download HOT 4
- movie HOT 5
- App presents wrong results in cell phone HOT 10
- May I know how to add more server to test? HOT 1
- May I know speedtest config.json ? HOT 4
- Feature: allow Select-All/Copy/Paste of test results & data (plaintext/markdown)
- Improve repeated server testing UX
- System-theme or dark theme by default instead of bright mode
- Multiple tests + statistics HOT 1
- Feature Request: Add Optional GPS Location HOT 1
- Configuration error: Failed to load server list HOT 1
- Abort button HOT 1
- Allow end users to specify servers by URL
- Support for adaptive icons
- Server auto-select prefers a distant server to a nearer one
- Why is web page speedtest always higher than Android? HOT 4
- when i run the example app . the view still in "No servers available" HOT 1
- Clarify what Mbps means HOT 1
- [Feature request] Option to remember the server. The search takes too long everytime.
- Download .apk from github directly with Obtainium
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speedtest-android.