ncalc icon indicating copy to clipboard operation
ncalc copied to clipboard

Your app for fdroid

Open theScrabi opened this issue 7 years ago • 58 comments

Hei have you thought about pudding your app on fdroid. If you are interested, you can seek for help. However here are some requirements that should be ment before adding:

  • gsm lib has to be removed
  • precompiled libs have to re replaced with marven ones

theScrabi avatar Oct 12 '18 11:10 theScrabi

@theScrabi the project seems to be unmaintained. But a scientific calculator which is easy to use (unlike addi) and has graphing capabilities is really lacking in f-droid. Did the build fail without gsm libs?

projectextremum avatar Nov 08 '18 01:11 projectextremum

I gave it a shot.

Results:

  • gsm lib removal: done
  • sdk version update from 27 to 28: done
  • com.android.support libraries update from 27.1.1 to 28.0.0: done
  • build tool version update from 27.0.3 to 28.0.3: done
  • gradle plugin update from 3.1.3 to 3.3.0: done
  • gradle update from 4.4 to 4.10.1: done
  • io.github.kexanie.library:MathView update from 0.0.4 to 0.0.6
  • com.getkeepsafe.taptargetview:taptargetview update from 1.6.0 to 1.12.0
  • override onSequenceStep add where necessary: done
  • com.github.mukeshsolanki:MarkdownView-Android update from 1.0.4 to 1.0.8
  • com.simplecityapps:recyclerview-fastscroll update from 1.0.18 to 1.0.20
  • symja_android_library change to maven one: not done

About the last one I need some help. Steps I have done:

  • maven repository "https://oss.sonatype.org/content/repositories/snapshots" added to repositories
  • Source and Target Compatibility changed to 1.8
  • removed from app dependencies the line: "api project(':symja_android_library-release')"
  • added to app dependencies the line: "annotationProcessor 'org.apache.logging.log4j:log4j-core:2.5'"
  • added to app dependencies the line: "api 'org.matheclipse:matheclipse-core:1.0.0-SNAPSHOT'"

upon building I get the following error: "Error: Program type already present: com.google.common.util.concurrent.internal.InternalFutures"

if I build the project before adding and removing the lines of symja and log4j and matheclipse the projects builds just fine. Any ideas?

@projectextremum: addi?

basile-laderchi avatar Jan 29 '19 13:01 basile-laderchi

@Tranleduy2000 can you help

axkr avatar Jan 29 '19 14:01 axkr

I have rebuilt it today (Studio must have downloaded the latest matheclipse-core library). It does compile just fine, but upon executing it I get the following errors (I think that the first error is not a real problem, but the second one...):

01-31 10:21:20.573 9727-9727/com.duy.calculator.free.v2 W/System.err: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/script/ScriptEngineManager;
01-31 10:21:20.576 9727-9727/com.duy.calculator.free.v2 W/System.err:     at org.apache.logging.log4j.core.script.ScriptManager.<init>(ScriptManager.java:49)
...
01-31 10:21:20.751 9727-9727/com.duy.calculator.free.v2 E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: org.matheclipse.core.eval.-$$Lambda$EvalEngine$QebSt4dX6ZeiPlIF3uDV4uxXsd8
        at org.matheclipse.core.eval.EvalEngine.flattenSequences(EvalEngine.java:1740)

The error gets thrown on this line https://github.com/tranleduy2000/ncalc/blob/725baf703bd1e10de679d7463eda39445227ae43/app/src/main/java/com/duy/calculator/evaluator/MathEvaluator.java#L77 and the function passed to it is:

Comb(n_, k_):=(factorial(Ceiling(n))/(factorial(Ceiling(k))*factorial(Ceiling(n-k))))

I even tried commenting those line out, but when it gets to https://github.com/tranleduy2000/ncalc/blob/725baf703bd1e10de679d7463eda39445227ae43/app/src/main/java/com/duy/calculator/evaluator/MathEvaluator.java#L116 crashes again with exprInput passed being:

N(1)

Should I paste the full logcat?

@axkr any ideas?

BTW I tried contacting @tranleduy2000 with no luck.

basile-laderchi avatar Jan 31 '19 08:01 basile-laderchi

At this Line the system uses the Java 8 Lambda feature.Are you Sure your Environment is set up for Java 8?

axkr avatar Jan 31 '19 12:01 axkr

I guess that the problem now is that my android is only v6.0 (API level 23) and Lambdas are supported from level 24. I'll give it a shot compiling it with RetroLambda (maybe?).

basile-laderchi avatar Jan 31 '19 13:01 basile-laderchi

Or try using @tranleduy2000 Java 7 fork

axkr avatar Jan 31 '19 13:01 axkr

Unfortunately that fork is not on any maven repo and is a little behind too, but I'll give it a try anyway

basile-laderchi avatar Jan 31 '19 13:01 basile-laderchi

More finding:

  • Retrolambda is not supported any more since Android Studio natively supports Java v1.8
  • Using "com.github.tranleduy2000:symja_android_library:d58c33c" from "https://jitpack.io" maven repo the build process failed with the following error: "Error: Program type already present: org.checkerframework.checker.nullness.compatqual.NullableDecl"
  • Using "org.matheclipse:matheclipse-core:1.0.0-SNAPSHOT" it builds successfully, but when it runs on my mobile (Android 6.0) or on an emulator (Android 8.0) it crashes with the 2nd error as described here: https://github.com/tranleduy2000/ncalc/issues/61#issuecomment-459266310

P.S.: always doing a "Clean Project" and then a "Rebuild Project" before running.

basile-laderchi avatar Feb 05 '19 12:02 basile-laderchi

Can you open a pull request with your Maven settings / pom.xml ?

axkr avatar Feb 05 '19 16:02 axkr

@axkr I have created a gist with my two build files (unfortunately not Maven settings or pom.xml): https://gist.github.com/basile-laderchi/d52cf28fe9971a84b2ba5e3b950d1f12

basile-laderchi avatar Feb 06 '19 08:02 basile-laderchi

@basile-laderchi I think the addi @projectextremum was referring to is:

  • https://f-droid.org/en/packages/com.addi/ - Matlab / Octave clone for Android
  • https://code.google.com/archive/p/addi/
  • https://code.google.com/archive/p/addi/wikis/FAQ.wiki
  • https://play.google.com/store/apps/details?id=com.addi
  • https://play.google.com/store/apps/details?id=com.addiPlot

octave was ported https://play.google.com/store/apps/details?id=com.gnuroot.octave so it looks like addi is no longer maintained

clach04 avatar Sep 22 '19 09:09 clach04

Ping @tranleduy2000 , are u interested? Maybe getting on f droid is a bit tricky, but @izzysoft has stated he will add it to his popular foss f droid repo provided that you:

  • Provide a libre build without all gsm and trackers
  • Fix version numbers, as they went from 3.9 to 3.4

MarionMoseby avatar Dec 05 '19 23:12 MarionMoseby

The tracking free part would be essential here. If needed, I could work around the versioning part by downloading the "initial one" manually (the app is already in my repo but stopped being updated because of this).

IzzySoft avatar Dec 06 '19 08:12 IzzySoft

I just installed it again on my new laptop and gave it another try. gms lib removed and the build looks ok.

What other trackers are there that should be removed? How can I find them?

basile-laderchi avatar Dec 10 '19 14:12 basile-laderchi

From Gitlab: « Additionally, those newer versions have a bunch of trackers added: Crashlytics, Firebase Analytics, GMS, etc., which apart from being a privacy issue are also bloating the app (the size has doubled) – hence I won't even pick them manually.»

See https://gitlab.com/IzzyOnDroid/repo/issues/78#note_252582009

MarionMoseby avatar Dec 10 '19 15:12 MarionMoseby

If there is a new APK available here that (at least in theory) should have those trackers removed, just let me know and I test it again (the library scanner of my repo will tell).

IzzySoft avatar Dec 11 '19 07:12 IzzySoft

I have tried contacting @tranleduy2000 in January on all emails I could find and got no response.

I have removed the gms library. I haven't found any other tracker libraries (maybe I'm missing something). I have also upgraded almost all the libraries referenced to the newest versions.

I do have changed the applicationId, versionCode and versionName, compiled and have built the apk (unsigned for now). @IzzySoft can I upload it somewhere for you to test it with your library scanner? Can I test it myself somehow? I have found this libinfo and checked all the libraries reported by the "Analyze APK" and none of them has any anti features.

basile-laderchi avatar Dec 11 '19 09:12 basile-laderchi

@basile-laderchi if you can give me a link to your fork, and have the APK available there (ideally attached to a release), I can give it a try.

IzzySoft avatar Dec 11 '19 19:12 IzzySoft

@IzzySoft fork ready: https://github.com/basile-laderchi/ncalc (with latest changes pushed) Do I have to sign the apk for releasing it?

basile-laderchi avatar Dec 12 '19 11:12 basile-laderchi

Do I have to sign the apk for releasing it?

Yes please. Else fdroidserver won't accept it. Let me know when the APK is available and I give it a try.

IzzySoft avatar Dec 12 '19 19:12 IzzySoft

Signed and created a release: https://github.com/basile-laderchi/ncalc/releases/tag/IzzyOnDroid.Test.1

I marked it as pre-release. Is that a problem?

basile-laderchi avatar Dec 13 '19 10:12 basile-laderchi

No, if you want me to pick pre-releases, that can easily be done. But the tag name potentially poses a problem: it should either reflect the versionName or the versionCode – currently it's unclear what it reflects. If it's the versionCode (1), and you'll keep it that way, it should be OK – but if it was meant as versionName it doesn't correctly match (1-beta according to the build.gradle – but that doesn't match what the APK itself has set). So I assume the former (versionCode). Should I be wrong, please let me know. If I was right, please let the only digits in the tag name be those of the versionCode for future tags – and don't forget to increase versionCode with each new release :wink:

Second look: seems funny that after v3.4.8 follows v1, don't you think? Further, you might wish to rename the app to distinguish it from the original (e.g. NCalcLibre?).

Apart from that, it looks good – and should show up here with tomorrow's sync. Thanks!

IzzySoft avatar Dec 13 '19 22:12 IzzySoft

@IzzySoft

Created new release with the following changes:

  • Changed application name to NCalcLibre
  • Changed version number to 3.4.8
  • Application now can be installed in external location

basile-laderchi avatar Dec 16 '19 13:12 basile-laderchi

@basile-laderchi thanks! I just updated its metadata to have the updater check for tags going by versionName, and then it was able to see and fetch the update (should show up with tomorrow's sync – todays was just missed by half an hour). Please keep the tag names like this (feel free to drop the .free suffix if you wish, as the app is already named "libre" – my updater ignores that part anyway).

PS: I already got the first reports of happiness – together with the hope you'll keep the fork alive :smile:

PPS: Let me know if/when I should ignore pre-releases. Currently my updater picks both; if you want it to ignore the pres, I'll have to tell it.

IzzySoft avatar Dec 16 '19 18:12 IzzySoft

@IzzySoft I installed it on my phone too from the repo. I can't really drop the .free from the tag names. I would like to keep the same tag names as the original repo, but can't do because they are used by the original repo (I think - if someone know something more, please do tell me). How did you get those reports? Could the updater do pick the pre-releases too, but not flag them as suggested updates (F-Droid does this now with its v1-8-alpha0 version)?

basile-laderchi avatar Dec 19 '19 07:12 basile-laderchi

Not really a problem with the .free suffix (I hope – we'll see when you published the next release and my updater picked it up).

Those reports came by mail. From people following this issue I'd say :wink:

As for pre-releases: yes, my updater can pick those. But it doesn't set CV/CVC in the metadata, so there's no control for "suggested updates". When I find the time to do so, I'll implement "RegEx tag name parsing" for my updater, so it could deal with different tag names in the same repo pointing to apps with different package names (like, one package name for stable releases and another for beta releases), to deal with cases like this. Currently that's not possible with my repo.

IzzySoft avatar Dec 19 '19 20:12 IzzySoft

It was me who gave the positive reports hehe, Im very happy that you made the libre version and hope the ncalc developers would make their app availaible on the official f droid repo :p

MarionMoseby avatar Dec 19 '19 20:12 MarionMoseby

I also tried contacting @tranleduy2000 . My last contact was at the end of November.

As the main Android developer and maintainer of the Java 7 fork of the Symja library

  • https://github.com/tranleduy2000/symja_android_library

he had done a lot of hard work for these projects,. I think he should also decide how the roadmap for this project should going on.

axkr avatar Dec 19 '19 21:12 axkr

@axkr I don't think he cares any more for NCalc+. I tried contacting him on January on three different emails I managed to find and got no answer back. Also he must be receiving emails with all the messages here.

After all it's a GPL3+ project. I haven't removed any license messages or attributions.

@MarionMoseby I had a shot at it, but didn't go well. I might try again next year.

basile-laderchi avatar Dec 20 '19 13:12 basile-laderchi