Coder Social home page Coder Social logo

Comments (46)

IzzySoft avatar IzzySoft commented on August 16, 2024

PS, could you also please clarify what license this project uses, @Limizin?

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

Could you please increase that, so it's accepted as update? Thanks!

The fact is that version 1.3 is not an update for version 1.2
My priority is minimum size and light weight, as I did for personal use. I feel bad when I see how much memory modern apps consume. Thats why, I avoided using AppCompat etc. And when I had to make a separate build for MM, I just increased the version of the application.
This led to confusion, but I thought that the application had reached the final stage of development.

But I was wrong. I was asked to add functionality. So the current version is actually 1.4.2 based on top 1.2
which I did't push to github, because I use not git, but mercurial(hg) and hg plugin "hg-git" is broken for a long time
And I did not deal with this issue.

In addition, there is a version confusion.
1.3 - the same as 1.2 but for MM+
the current version is 1.4.2, but it does not work for Oreo, which means there will be a build for Oreo as version... 14.3 ?? !!

I don't know how to put the versions in order and just did nothing

PS, could you also please clarify what license this project uses, @Limizin?

I did not think about that. I do not know the differences of one license from another. I am not an Android developer and do not plan to be one. I just wrote an application for myself and published it for general use. But if this is required, I can examine the issue and mention the license somewhere

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

I feel bad when I see how much memory modern apps consume.

I couldn't agree more!

1.3 - the same as 1.2 but for MM+

Problem is: I cannot put two APKs with the same package name and the same versionCode into the same repo, as the two together form a unique identifier. From your details, I could keep 1.2 for LP and the newer for MM+, pointing out that fact in the description. But for that I'd need an APK with a higher versionCode – otherwise I can only keep 1.2 OR 1.3 (see here).

Is your Mercurial repo publically accessible? If so, could you point to that URL from the Readme here? Then we'd just need a way I could grab the newer APKs. What options do you see for that? For automated updates, my framework supports:

  • APK at a release tag in Github/GitLab (which is unlikely to happen here)
  • APK inside a repo at Github/GitLab (you could manually upload)
  • a fixed URL (e.g. https://example.com/gpsicon.apk) at a server sending the LAST_MODIFIED flag in the header

If all that is no option from your end, I'd declare that one of the rare cases where I go for a manual update check (an update which appears in my repo 4 weeks late is better than no update at all – and as I still use your app myself, I'd accept that here). But for that I'd need to know where to grab it from. In each of the cases, I'd need to be able pointing to the corresponding code (that pointer in your Readme here would suffice).

Do you see a way for that?

As for the license:

It would be good to have one for your code to be protected. Currently there is none at all (which could also mean "all rights reserved", and we all would be in violation when using it – or you losing it all, depending on court and judge). Depending how strict/loose you want it, some choices are better than others. I'm no expert in this, but rawly: If you don't care what happens with your code, "Public Domain" permits to deal with it freely. Apache 2.0 and MIT are protecting licenses that still give a lot of freedom. I use GPL 2.0 for my code stuff as I don't want others to monetarize it. I've no ideas about all the other licenses.

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

I only have a local hg repository. You asked me to publish the source code on github - I activated the "hg git" plugin and did it.

During the next week I will check the relevance of the source code (I tried to make it work on miui and made many local copies with changes). Also I have downloaded latest asndroid studio and get gradle error.

Then I will try to get hg-git to work and publish the missing part of the history.
If everything goes well (hg-branches are different from the git-brunches), then there will be 2 heads - 1.3 and 1.4.2.

Then I will do all the modifications you need.

I have no application development plans, only oreo support, which is a little difficult without a real oreo device. According to reviews version 1.3 is working in oreo, but not 1.4.2, which not contain "runtime permissions" support (small apk will save the world).

In any case, it will be branch from the head 1.4.2, not continues 1.3 branch

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

I successfully fix the gradle issue, but when I tried to push I got an error

Abort: pushing refs/tags/v1.3 overwrites 840313052cf6

May be use flag --force ?

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

--force would replace the entire code. I'd make a separate git clone of the Github repo first, just in case, and then do a force push – so if it goes weird you still have a copy.

Thanks for all your help, @Limizin – back then none of us expected you'd keep it up, so I'm very glad you do!

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

Failed with the --force flag. Also failed with the new repository. I used the old hg-git (as described )and got an error that was fixed just a week ago.

I have to try to make the latest version of hg-git work

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

@IzzySoft Please check. Branch ideology are different and I had to move bookmark 'master' and use flags --new-branch --force
I atached screenshot of origin graph log
Image 3

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

I'm not a Java dev so I cannot check the code – but apart from that, looks good to me (just wondering what happened to v1.4 😄), thanks!

Could you then add the tag for v1.4.2 and attach the APK for it? I'd then keep 1.2 (for LP users), remove the 1.3 (which isn't listed anyway due to the conflict described above), add 1.4.2, and put a note into the description (that LP users should pick v1.2, and MM+ v1.4.2 – though when using the F-Droid client, that should happen automatically).

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

you are confused in versions

1.2 has only manifest permissions. I had only real device with LP and thought it would work on later versions of android. On the emulator, I can check only the installation, but not the work

xda user report me that it not working in MM. I can add "runtime permissions" without a realg MM device and assigned a version 1.3 (why? I am not android developer and did not know all the details)

1.4 add new feature - show icon when location activated (just location status indicator) + fix small bug with indication on some devices + small manifest fix as result 1.4.2
By this time I already had yet another device (MM) and noticed that version 1.4 works on it (apparently due to manifest fix)

I stopped at this

xda user report me that 1.4.2 not work on oreo, but 1.3 work. I suspect that I should create version 1.4.2 with "runtime permissions", but I have only emulator (

in sum, 1.4.2 makes v 1.2 obsolete (bug fixes), but not 1.3, which can work on some problematic androids and oreo

1.2 has version code 4
1.4.2 has version code 7
I can increment version code of 1.3 to 5

But 1.3 can not be deleted

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

in sum, 1.4.2 makes v 1.2 obsolete (bug fixes), but not 1.3, which can work on some problematic androids and oreo

Oh yes, then I got that wrong – thanks for clarification!

I can increment version code of 1.3 to 5

That'd be great then! As by default, I hold 3 versions per app, that would then mean 1.2, 1.3 and 1.4.2 could "live together". Will do so as soon as you tell me the APKs are available at their resp. tags.

As for 1.4.2 with Runtime Permissions: I could test that on MM and N if that helps (you could attach a test APK here to the issue and later drop it again).

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

Could you then add the tag for v1.4.2 and attach the APK for it?

done

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

Thanks! 1.4.2 got pulled automatically by my updater. Will check 1.3 later for the adjusted versionCode – which then (currently) will only purge out v1.1 from my repo, which should be fine.

PS: v1.4.2 seems to work fine on my MM device. Will update my N device next.

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

@IzzySoft

I merged 1.4.2 and 1.3 into one

For me it was a surprise that the code inside if (Build.VERSION.SDK_INT> = Build.VERSION_CODES.M) {allows you to work even on android 5 without having to compile 2 apk

compiled with max sdk version for test

I can't attach apk to message and uploaded into temp repo https://github.com/Limizin/GpsIconTemp/releases (1.4.3 (beta))

upd: not work on Oreo ((

created new beta GpsIcon1.4.3.beta2.apk

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

So 1.4.3 is basically 1.4.2 with runtime permissions – and I shall test it on MM and N, right?

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

@IzzySoft
1.4.3 (b2) works on LP, MM, Oreo - checked on real devices
I used
if (Build.VERSION.SDK_INT> = Build.VERSION_CODES.M) and if (Build.VERSION.SDK_INT> = Build.VERSION_CODES.O)
as a result, one application that uses native features from each version of android

Most likely it works on Nougat

There’s only a problem with usability of getting permissions.

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

So anything I should watch out for – or what is keeping it from being made "official" and added here? I've just installed it on two of my devices (MM + N) and could make a little test run at some point today.

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

I published a new release. Essentially it makes v1.3 obsolete
1.3 and 1.4.2 can be upgraded to 1.4.3 (code version 8) and it will work on android 4.4+ (though not tested on 7, 9)

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

Thanks! That should be pulled automatically then in 4..5h. It's the same APK you linked to before, right? As that already identified itself as 1.4.3,8? I'll report back then when I tried it on 7, so you at least can say "4.4-8" 😉

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

It's the same APK you linked to before, right?

The difference in min(target)sdk when compiling. In release targetSdk =maxSdk = 27 (O 8.1) and last build tools. It matters. For example, I could not compile 1.3 workable on Oreo on the last Android Studio (gradle, build tools)
however, version 1.4.3 does not rely on "it will suddenly work in a newer android"

4.4-8.1

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

Ah OK, then I need to make another "reinstall". Btw, I can report the "intermediate" one (from the test repo) working fine with MM and N – though on N I initially had to toggle its settings back and forth a few times before it showed up in the status bar. Not sure if that did the trick, but now it is working fine there as well.

I've just pushed the v1.4.3 from here to my two devices, and give it another test tomorrow. Then we can close this issue I guess.

Thanks a lot once more!

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

I'm not sure.

report from xda

If i start the app, everything is ok. if i go back to home and start a GPS-using app, everything is ok, too. If i go to recent appes and swipe it away, the gps icon and notification is gone

Also to fix the notification I used the oreo feature "notification channels" and compiled with sdk 27 (oreo)
What can make Android 8 force sleep the background process in a few minutes (stupid behavior). And this also needs to be checked.

And at the same time version 1.3 works in a magical way.

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

Well, if I swipe a running app out of recents, that signals the app to close – so that behaviour could be considered "expected". Suggest turning GPS itself off and on after the swipe – which should in turn trigger GPS Icon to start again (status of GPS has changed from "off" to "in-use").

And I'm no dev – no advice about "what can make…" Only raw ideas – like Doze (so excluding it from battery saving mode could do the trick). Some places write one needs a foreground service to keep the stuff running (e.g. a permanent notification etc.) While I wouldn't wonder if that's indeed the case, I find that stupid: what are background services mainly for? Certainly not to be killed/sent-asleep, but do DO something.

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

so that behaviour could be considered "expected"

No. The service has a START_STICKY flag which means "the system will restart it if it killed (OOM / main application closing (except for some task killers as a gravitbox)). on my LP and MM swipe do not break anything and it is expected. I expect the same in nougat

no advice about "what can make…" Only raw ideas – like Doze

Oreo has a new energy saving policy and ignore START_STICKY. The system kills background services in a few minutes. TargetSdk 27 (Oreo) tells the system that we compiled it and accepted its requirements.

1.3 compiled with sdk 23 and some compatibility mode may work or the magic of unicorns

I tried to compile it under sdk <27, but I got an error on oreo "notification cannot be shown on the 'null' channel"

one needs a foreground service to keep the stuff running (e.g. a permanent notification etc.)

I'm still not going to do foreground service. I do not have and will not have a device with oreo (for this reason, stupid energy saving policy). And without it, I have neither the need nor the opportunity do it.

I will try to build an apk so that this "compat" mode will work (after all, 1.3 why does it work). suddenly lucky. on the emulator, then nothing works, because it is an emulator.

1.4.3 yet new release. It merge the android versions for 4.4-5 and 6(7?). But it is not known how it works on Oreo. You need to write that in case of problems "use the magic version 1.3"

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

So no expected behavior from your end. But as a user I might expect it, if I know it this way from previous Android versions. Though, no idea, sorry. And I agree with your decision of "no foreground service".

Summing up my tests after I just tried the latest version:

  • latest version doesn't work correctly for me on either MM or N. In order for the icon to show up at all, I must tick the "show status" checkbox – which means when GPS is no longer needed, the indicator remains; which is not what I want. If that box is not ticked, the indicator doesn't show up at all.
  • same version from test repo seemed to work OK on MM, but had described issue on N
  • 1.3 worked fine and as expected on MM and N

Need to check 1.4.2 again (or the next build you just announced) – but currently it looks like at least for Nougat devices, v1.3 seems to be the best choice. Hence again the question to adjust versionCode for v1.3 so it can be included in the repo next to v1.2 (unless v1.2 can be dropped, which would solve the issue implicitly – but wouldn't announce the v1.3 update to v1.2 users, nor allow an easy install of v1.3 for those running v1.2).

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

Hence again the question to adjust versionCode for v1.3

That is the problem. version 1.3 works in a magical way. To change the version of the code I will need to recompile the application. And I have nowhere to check that the compilation include successful magick, Ihave no physical device with oreo for test (and on mm and nugate it will work clearly)

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

So, OK: Now I can test on Oreo (but no longer on MM), just upgraded one of my devices. As you're already sure about M and N, and want me to try on O, just let me know where to find the A. Ahem, APK 😄

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

@IzzySoft https://github.com/Limizin/GpsIconTemp/blob/master/GpsIcon1.3.1.apk (version code 5)

Work in debug mode even on android emulator. Also immune there to "swipe"...magic, magic, magic...in debug

For release build I was forced add lintOptions { checkReleaseBuilds false } to gradle

try this version

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

https://github.com/Limizin/GpsIconTemp/blob/master/GpsIcon1.4.5.apk

remove oreo-depended code
gradle from 1.3.1

also works magically. But before, I could not get a notification on the oreo in this version

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

I can confirm v1.3.1 working perfectly on Oreo. Shall I put that into my repo, removing previous versions (up to v1.3)? Will test v1.4.5 later.

from gpsicon.

vitidev avatar vitidev commented on August 16, 2024

Shall I put that into my repo, removing previous versions (up to v1.3)?

Yes, but if 1.4.5 also will be work - make 1.3.1 obsolte

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

That would be great, sure – but I cannot tell before I checked 😉 If 1.4.5 won't show the side effects I had with the last version checked on MM/N, I will of course switch to that. And "obsolete" v1.3.1 in the repo (shall I then also remove any of the versions in between, like 1.4.2 or 1.4.3?). Please give me a day or two.

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

OK, now can confirm v1.4.5 working fine as expected on Oreo (8.1) as well. Will add it to the repo this evening (unless you are faster and add tag+APK before that, as then my updater will fetch it automatically). Thanks again!

Guess that means this issue can be closed then? Or shall I test on N before that, just to make sure?

from gpsicon.

vitidev avatar vitidev commented on August 16, 2024

Have you checked both cases for sure?
1 swipe
2 oreo kills service after some time of inactivity

update: 3 reboot device with enabled gps (oreo, oreo ((( )

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

@vitidev I won't check 3 as that would take half an hour (since Oreo, my device needs multiple tries until it finally boots up successfully; the first 3 times it simply stalls for ~5min, then falls into fastboot – so booting is no fun). What do you mean by swipe? And what inactivity and for how long? I had it running for ~5min without touching the phone, no issues.

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

@IzzySoft https://developer.android.com/about/versions/oreo/background
I still do not understand how many minutes it is, but

Note: By default, these restrictions only apply to apps that target Android 8.0 (API level 26) or higher. However, users can enable most of these restrictions for any app from the Settings screen, even if the app targets an API level lower than 26.

Disable gps, then steps

1 uncheck checkboxes int gui (hide state icons)
2 swipe app from resents (no gui runned)
3 enable gps

This will launch the background service without icons. then wait ...30 min
4 run map app.

If everything is good, then we have successfully avoided background services restrictions (and I hope that boot limitations too) and will only have to publish.

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

An app is placed on the whitelist when it handles a task that's visible to the user

I'm no Android dev – but I remember something like that was why some apps implemented persistent notifications (Tasker and AFWall+ e.g. have that). The GPS icon is in the status bar, and thus also visible to the user (unless using "extended desktop" and hiding the status bar maybe).

Besides: 1) I never use those state icons, so 2) is not needed for tests, and 3+4 (30min test) I did at least with v1.3.1 yesterday (during the week I hardly get a chance for that: no GPS in the building or the underground train, and intervals with "free view to sats" are much shorter). I'll keep an eye on it nevertheless and let you know from time to time.

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

@IzzySoft

I published tag v1.3.1 and attach this apk (https://github.com/Limizin/GpsIconTemp/blob/master/GpsIcon1.3.1.apk (version code 5)
I published tag 1.4.5 and new apk compiled with 'minifyEnabled true' (I hope it does not affect anything except the size.)

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

It should be left 3 versions

  • 1.4.5 - for all platforms
  • 1.4.2 - version with new feature but before oreo hacks
  • 1.3.1 - special old version

1.2 completely replaced by 1.4.2
1.4.3 - unsuccessful version (nobody needs it)

I have no idea how you decide this. But I'm glad we have a working solution.

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

but I remember something like that was why some apps implemented persistent notifications

The icon is optional. It increases the priority of the service for OOM killer. Personally, I do not like these useless persistent notifications, I have enough ram.

But Oreo requires an icon for foreground services, that is absurd (https://www.xda-developers.com/hide-app-running-background-notification-android-oreo/)

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

@IzzySoft 1.4.5 not install on LP, becouse minSdkVersion 23
I will make version 1.4.6

update: done

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

🙄 All was just getting clear… 🤣 So 1.4.6 has a lower minSdkVersion, but keeps the targetSdkVersion at 27? Ah, wait: the latter is also decreased to 23, which avoids the issue with the background service. So I shall test that (to make sure), and if successful, keep 1.3.1 + 1.4.2 + 1.4.6? Then I need to get home before the updater starts (or 1.3.1 will be gone and I have to re-add it)…

from gpsicon.

Limizin avatar Limizin commented on August 16, 2024

keep 1.3.1 + 1.4.2 + 1.4.6?

Yes. if minSdkVersion 19 did not lead to new problems (in theory it should not).

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

OK, will do, thanks!

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

OK, done! Also updated the app's description to reflect "the story" and why which version is being kept. To make it easy for you to check, just click here 😉

Btw: Did you meanwhile decide for a license? And maybe you want to include that link with the readme, to indicate how to easily install it and keep it up-to-date using the F-Droid client?

from gpsicon.

IzzySoft avatar IzzySoft commented on August 16, 2024

Finally had a chance to try v1.4.6. All smooth on Nougat. On Oreo, it initially refused to show up: there was some wriggling in the status bar, but no icon. But when I turned the display back on about 10min later, there it was. On a subsequent try half an hour later it showed up straight from the start, so all seems fine.

Shall I add a note to the description on that (a la "don't give up if it doesn't show up initially…")? I vaguely remember a comparable situation with one of the other 1.4.x versions before. Never had it with 1.3.x though.

from gpsicon.

Related Issues (2)

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.