GithubHelp home page GithubHelp logo

ForegroundService about snapdrop-android HOT 10 CLOSED

fm-sys avatar fm-sys commented on August 28, 2024
ForegroundService

from snapdrop-android.

Comments (10)

fm-sys avatar fm-sys commented on August 28, 2024

Sounds good, although I'm not 100% sure how we could archive this within a service... (JS/webRTC <> Android Service)

from snapdrop-android.

ueen avatar ueen commented on August 28, 2024

Apparently not that difficult https://stackoverflow.com/questions/39038771/calling-javascript-from-service-android
But we need to look out for double instances, like app and service...

from snapdrop-android.

ueen avatar ueen commented on August 28, 2024

Maybe a service is not feasable, what about push notifications? I found this FOSS solution as i dont really want to use FCM
https://github.com/gotify
as far as i understood another app has to be installed for that and we need to find a host/server, then this could be integrated to my addon to send text&links via gotify, what do you think?

EDIT: well actually gotify runs a foreground service so it maybe not that much better...except for that it is already well tested and so on

from snapdrop-android.

fm-sys avatar fm-sys commented on August 28, 2024

I would like to keep things simple. gotify is probably a pretty cool open source project, but is IMHO unrelated to Snapdrop so it's probably better to keep them separated. Probably gotify even already have a working windows client (for Android they definitely have).

from snapdrop-android.

fm-sys avatar fm-sys commented on August 28, 2024

I think a foreground service is feasable, although it's probably a bit difficult... Spare time is the most blocking issue 😅

from snapdrop-android.

ueen avatar ueen commented on August 28, 2024

Yea you're right, my usecase actually is just send text/links if the app is closed, i thought that might be something to implement in the app, but maybe its easier to do something with the add-on, like adding the option to register a device and then push notifications there. I really dont want FCM in this app.

  • A foreground service would be possible but really a mess, but it wouldnt require the addon/website to be changed what would be a plus.
  • Maybe something like this could work https://github.com/pushbits/server, this basically sends notifications via matrix, so if you have Element installed you just get the messages via that (though that is proabably using FCM anyway, but we dont have to).

Feel free to mark as off topic as the later solution would actually not even involve snapdrop really, but let me know if you have another idea for sending text/links, in the past i used pushbullet but its free and not opensource so i'm somewhat concerned what the businessmodel is exactly :D

from snapdrop-android.

fm-sys avatar fm-sys commented on August 28, 2024

I actually like the idea of a snapdrop foreground service, but the foreground notification should provide the possibility to easily stop the service.

from snapdrop-android.

ueen avatar ueen commented on August 28, 2024

yea would definitely disable by default, but do you know about battery consumtion? This is a absolute convenience use case that i maybe use every 2d, so i woudnt sacrifice battery life for it, also i think it would be really hard to seperate the service snapdrop client and the android client, which will lead to even more headach with the app showing itself and the service...

or we shift everything to the service and only use the app as a frontend and do the networking via the service? Not sure how this would work, but this could solve the showing it self issue, as theres always a single service running - dont know if this would be possible and we have to look out for the battery, do you have any experience with this?

So i guess im somewhat leaning towards and already existing FOSS push solution like via matrix (would be easier to implement i guess).

Another idea would be to use Web push, but the documenation is scarce...
https://developer.mozilla.org/en/docs/Web/API/Push_API
https://blog.mozilla.org/services/2016/08/23/sending-vapid-identified-webpush-notifications-via-mozillas-push-service/

from snapdrop-android.

ueen avatar ueen commented on August 28, 2024

i contacted silkky.cloud and they would be willing to host pushbits, so i think i'll be going with the addon->matrix bridge for the sending text/links usecase, i think a foreground service would be to battery costly, so i'm closing for know, feel free to reopen if you would think its still feasible :)

from snapdrop-android.

ueen avatar ueen commented on August 28, 2024

Hmm looked into it way longer than I should have, matrix also doesn't seem to be feasible, so I think that's it, I'll have to live with this minor inconvenience.
Or the foreground service but I'm really not sure if it's worth the battery drain or how bad it would be...

from snapdrop-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.