0xf104a / NextcloudServices

Android app to send notifications from Nextcloud without using GCM(Google cloud messaging)
GNU General Public License v3.0
63 stars 11 forks source link

High data usage #62

Closed julianfairfax closed 10 months ago

julianfairfax commented 11 months ago

The app uses around 25MB of data per day. This is quite high for just fetching notifications, and it can be a problem if you don't have a high amount of data on your plan (25MB/day is 750MB per month...).

Other apps that uses polling for notifications, such as Signal and Element, use at most 5MB per day.

Is there a way to reduce NextcloudServices' data usage, aside from changing the polling frequency (for calls, even 10 seconds is already long)?

0xf104a commented 11 months ago

Hello. Thankyou for pointing this out. I have checked up the latest documentation for Nextcloud notifications and indeed the data usage may be reduced by checking modification of notifications instead of directly requesting all notifications from server

julianfairfax commented 11 months ago

In addition to this, it uses 10-15% of your battery, which is also absolutely ridiculous.

I have set the polling time to 5 minutes (which was hard as well - #14), but that doesn't work if you use the app as an instant messenger.

0xf104a commented 10 months ago

@julianfairfax thankyou for addition. Could you please tell if you use Nextcloud single sign-on(authentication via app) or enter your login and token(password) in app?

julianfairfax commented 10 months ago

@julianfairfax thankyou for addition. Could you please tell if you use Nextcloud single sign-on(authentication via app) or enter your login and token(password) in app?

I have used both. I don't think it made any difference. Only, when using single sign-on, the Nextcloud app shows as the one using all the data and battery.

julianfairfax commented 10 months ago

I see you marked this as a test. I'm testing it now.

0xf104a commented 10 months ago

Thankyou for assisting me with testing :) Just to note: the changes I have implemented are aimed to reduce data-usage, though I am not really sure that they would reduce battery usage(probably we need a separate issue for a battery usage as reducing it would likely require quite extensive profiling)

julianfairfax commented 10 months ago

Thankyou for assisting me with testing :) Just to note: the changes I have implemented are aimed to reduce data-usage, though I am not really sure that they would reduce battery usage(probably we need a separate issue for a battery usage as reducing it would likely require quite extensive profiling)

I will report to you the results of my testing. I'm using then, by the way, the direct login in the app, to differentiate it from the Nextcloud app's data and battery usage.

julianfairfax commented 10 months ago

It seems your changes worked to reduce the data usage. It now uses as much as You Have Mail - but only if you set the polling time to 5 minutes.

I don't really you think you can do anything more about data usage or battery usage, because polling every 10 seconds is just going to use resources.

I suppose this is only solvable if Nextcloud adds a websocket. And, if you need instant notifications, you'll probably just have to use NextPush.

0xf104a commented 10 months ago

Thank you for testing my fix! As per battery usage I have opened issue #67, so I would try investigate and reduce possible sources of battery usage