Bitcoin Forum

Bitcoin => Bitcoin Wallet for Android => Topic started by: Krellan on July 22, 2013, 08:29:13 PM



Title: Please give us back the option to disable Sync on Power
Post by: Krellan on July 22, 2013, 08:29:13 PM
If you look in Google Play, you will see a lot of other people reporting the same problem.

https://play.google.com/store/apps/details?id=de.schildbach.wallet

Previous versions of this app used to have checkboxes, "Sync on Power" and "Sync on Wi-Fi".

The current version of this app no longer has these choices exposed to the user.  Instead, it adds a nice feature, that is, the ability to have these checkboxes be cumulative (requiring BOTH power AND wireless in order to sync).  However, there's no way to disable this.

Please, please, please, restore the ability of the user to disable the sync, so that the user can stop the app from syncing automatically.

You are very lucky in Germany, but here in the USA, unlimited data plans on cellphones seem to be disappearing.  I want to be able to charge my phone without fear that a peer-to-peer app is going to start up whenever it sees power, and start burning up my bandwidth outside my control.

Please, please, please.

Nobody likes apps that do things behind their back.

Thank you for listening!

If developer is unable/unwilling to restore this feature, then I would be curious to hear suggestions for a workaround.  The "Trusted Peer" feature might work, I could set a peer of 127.0.0.1 (thus preventing it from connecting it anywhere), and using the "Skip Regular Peer Discovery" checkbox to control whether or not I want it to search for additional peers or not.  Also, the "Autorun Manager" app looks promising, I could revoke the event listeners of Bitcoin Wallet and thus prevent it from seeing events that would cause it to begin syncing.

Josh


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on July 22, 2013, 09:59:48 PM
First of all, there never was a "Sync on Wifi" checkbox.

If you want to spare your data plan, I suggest disabling mobile data in the Android settings. The "Sync on Power" setting was never good at that. Besides, the apps data usage is negliable nowadays (if you don't do a lot of blockchain replays).


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on July 22, 2013, 10:14:21 PM
First of all, there never was a "Sync on Wifi" checkbox.

If you want to spare your data plan, I suggest disabling mobile data in the Android settings. The "Sync on Power" setting was never good at that. Besides, the apps data usage is negliable nowadays (if you don't do a lot of blockchain replays).


I don't want to disable mobile data entirely.

Would it be too hard to add a checkbox to disable sync from ever being automatically started?  I don't mind sync being done if the user explicitly opens the app, that's a good thing.

I don't like the idea of connections always being opened in the background (especially P2P connections which are banned on many corporate networks and could get me into trouble if I take my phone in there).

Thanks for listening.  I'm not the only one who is unhappy about the app's background connections, with no way to disable them, just look at the recent reviews on the Google Play store.

Josh


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on July 23, 2013, 07:26:28 AM
Sounds like you might want to try the "Restrict background data" option in the Android settings. That can be set on a per-app basis I think.

Let me know the app behaves using that. If something fails badly, I'll try to fix.

In the same prefs, you even have the choice to add specific Wifis to a list of Mobile hotspots which can get a special treatment. You might want to explore into that feature for your corporate network.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Mike Hearn on July 23, 2013, 01:58:37 PM
Great suggestions from Andreas - please don't take it the wrong way, he's not blowing you off ;) Your requirements are best met at the operating system layer and Android does these days provide the tools you need to achieve it.

Normally, corporate networks will block outbound connections on ports the admins aren't comfortable with, so the app will never successfully connect over wifi. If you get into trouble over that, well, your admins need to chill out a bit. I'm sure all kinds of mobile apps talk on all kinds of non-web ports so I doubt they would care.

For bandwidth usage, check out the data usage settings page (if you're on ICS+). You should find it's completely trivial. I have a 1GB/month plan and Bitcoin Wallet doesn't make any difference to my aggregate usage. It downloads kilobytes of data, not megabytes.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on July 23, 2013, 09:50:57 PM
Thanks.  I want to restrict this app's usage, though, not set a global setting in Android which would apply to all apps.

I think I found a reasonable workaround:

Go into "Settings", enter Trusted Peer of "127.0.0.1", and check the checkbox "Skip Regular Peer Discovery".

This will keep it from making any unwanted connections whenever it wakes up.

You can use the "Skip Regular Peer Discovery" checkbox as a toggle.  Uncheck it when you want it to sync up (takes less than a minute).  Then, before closing the app, check that checkbox again, and it will obediently stop using the network again.

Josh


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on July 23, 2013, 11:05:57 PM
I want to restrict this app's usage, though, not set a global setting in Android which would apply to all apps.

As I said, it's not global.

Quote
Go into "Settings", enter Trusted Peer of "127.0.0.1", and check the checkbox "Skip Regular Peer Discovery".
This will keep it from making any unwanted connections whenever it wakes up.

It will drain your battery, as it will endlessly try to connect. Also see:

http://code.google.com/p/bitcoinj/issues/detail?id=296


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on July 24, 2013, 01:46:21 AM
It will drain your battery, as it will endlessly try to connect. Also see:

http://code.google.com/p/bitcoinj/issues/detail?id=296

Damn.  That's unfortunate.

Thought I had found a good workaround.

That's a nasty bug, that it will just loop the app and try again in an infinite loop upon failure to connect, draining the battery.  I verified that in "OS Monitor": it wasn't using 100% CPU, but it was using more than any other process.  Really frustrating that it would have that behavior.  Was this intentional, perhaps as a punishment to discourage people from trying to prevent the app from making connections?

Can't set "Restrict background data" on a per-app basis, it's global.  Unless there's a mod/tweak somewhere that I don't have.  And, besides, if the data is restricted, wouldn't that just cause the app to be thrown in a loop also?

Getting really discouraged by this.  Seeing no choice but to send away my bitcoins and uninstall.  Sucks, because that's one of the reasons I bought an Android phone instead of an iPhone.



Title: Re: Please give us back the option to disable Sync on Power
Post by: Mike Hearn on July 24, 2013, 08:41:24 AM
It's not intentional, it's just never been a priority to fix.

I will say this again - why do you care about this? Bitcoin Wallet is likely to use less bandwidth than your email syncing does. If you have any kind of mobile internet plan at all, you can afford this app.

Do you actually observe it use significant amounts of your bandwidth quota, or is this some psychological thing where you just can't stand the idea of it talking to the network in the background?


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on July 24, 2013, 09:36:16 AM
Can't set "Restrict background data" on a per-app basis, it's global.  Unless there's a mod/tweak somewhere that I don't have.

I'm on stock Android 4.2.2 (Galaxy Nexus).

Quote
And, besides, if the data is restricted, wouldn't that just cause the app to be thrown in a loop also?

Not necessarly. If Android correctly notifies the app that network is down, the app will act appropriately and not fire up Peers/PeerGroup.

I've never tried because I think it's worth to invest 1 MB of my 200 MB monthly mobile quota in being synched with the chain as much as possible. But since you're so convinced about the usecase - why don't you try?

Btw. was just thinking about the looping connect bug again. I was exaggerating. It will not connect endlessly but only for 2-3 minutes at a time - there is a timeout built into the app. Still you want to avoid running into that bug if possible.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on July 24, 2013, 11:59:44 PM
It's not intentional, it's just never been a priority to fix.

I will say this again - why do you care about this? Bitcoin Wallet is likely to use less bandwidth than your email syncing does. If you have any kind of mobile internet plan at all, you can afford this app.

Do you actually observe it use significant amounts of your bandwidth quota, or is this some psychological thing where you just can't stand the idea of it talking to the network in the background?

A little of both.

I haven't noticed it using a lot of bandwidth, which is good.  I rather like the per-app metering of bandwidth that Android provides.  Still haven't found a way to constrain "Restrict background data" to a single app, though.  When checking this checkbox, it then applies to every app that I have.

Other apps in the background I have running because I want them, they do useful things to me.  However, when I'm not running Bitcoin, I don't want that running.  Not at all.  Not even in the background behind my back.  Also, because it's a peer-to-peer protocol, Bitcoin will be making all sorts of connections to random IP addresses everywhere, and that could look suspicious.  Unlike my computer at home, I often bring my phone into corporate environments and whatnot, where they look suspiciously at activity, especially P2P.

I don't like being forced to deal with a carrot and stick approach, where in order to get a carrot (plug my phone into power in order to recharge it), I have to also take a stick (mandatory starting-up of the Bitcoin app and its background connections).  Really makes me feel like I'm being manipulated.

Again, I'm not the only one who feels this way, although you might think it strange.  Just take a look at the recent reviews on the Google App Store.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on July 25, 2013, 12:06:42 AM
I'm on stock Android 4.2.2 (Galaxy Nexus).

I'm also on 4.2.2.  Got a Samsung Galaxy S4 Active (I would have preferred the stock Google ROM, no Samsung or AT&T bloat, but didn't know that at the time).

Quote
Not necessarly. If Android correctly notifies the app that network is down, the app will act appropriately and not fire up Peers/PeerGroup.

Does 127.0.0.1 count as "network is down"?  That address should always be reachable, even if device is completely isolated, since it's talking to itself then.

Quote
I've never tried because I think it's worth to invest 1 MB of my 200 MB monthly mobile quota in being synched with the chain as much as possible. But since you're so convinced about the usecase - why don't you try?

I'm trying it now.  Even if the app takes more battery life, at least I'll be able to recharge my phone at work again!

Quote
Btw. was just thinking about the looping connect bug again. I was exaggerating. It will not connect endlessly but only for 2-3 minutes at a time - there is a timeout built into the app. Still you want to avoid running into that bug if possible.

Thanks for the update.  I noticed that CPU usage did increase, but not enough to be a real concern.  I'll let it go for a while, though, and see how it makes a difference.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Mike Hearn on July 25, 2013, 12:43:02 PM
The background syncing IS useful - it ensures that next time you open the app, it can catch up very fast (in a few seconds). Otherwise if you didn't open it for a month there'd be a short delay until it could see payments to you. Also, it only spends a moment or two syncing and then shuts down. It's not running the whole time you're charging, nowhere near.

So this leaves your fear that the app will make the people where you work mad at you. Although I hate to say it, this is not a very common problem to have. Maybe the fix is to just see if they notice, and if they do, explain that you have a P2P app on your phone? If for some reason they have a big problem with that, they can just block port 8333 and it's done.

Alternatively, you can put riker.plan99.net into your trusted peer setting, and then it'll only make a single connection, so the "p2p-ness" of it won't be so obvious.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on August 13, 2013, 09:22:42 PM
I just released version 3.16 which does not trigger a sync operation by plugging your device to power any more.

Note this does not mean it won't sync in background. If you want to restrict that, go to the Android "Data usage" prefs and enable "Restrict background data" (either globally, or just for the app). But its really not needed - both traffic and battery usage is negliable since version 3.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on August 15, 2013, 10:02:18 PM
I just released version 3.16 which does not trigger a sync operation by plugging your device to power any more.

Note this does not mean it won't sync in background. If you want to restrict that, go to the Android "Data usage" prefs and enable "Restrict background data" (either globally, or just for the app). But its really not needed - both traffic and battery usage is negliable since version 3.

Nice!

Thanks for not hooking the "charger connected" event any more.

I also see you added a direct link in the app's settings menu to the Android "Data usage" panel.  Touché.

It still syncs at reboot, though.

Ultimately, checkboxes would be the best approach:

[ ] Sync when charger connected
[ ] Sync when rebooted
[ ] Sync automatically in background every [ ] minutes

I really don't like the idea of carrying around a device which makes unwanted connections behind my back every so often.  Does anybody else feel bothered by this?  Sometimes, I think I'm alone.  Am I the only one who doesn't want apps making all sorts of connections everywhere in the background?

Josh


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on August 15, 2013, 11:20:38 PM
I just released version 3.16 which does not trigger a sync operation by plugging your device to power any more.

Note this does not mean it won't sync in background. If you want to restrict that, go to the Android "Data usage" prefs and enable "Restrict background data" (either globally, or just for the app). But its really not needed - both traffic and battery usage is negliable since version 3.

Ouch, I just noticed something new: the synchronization now starts happening on its own, on a timer, even when the device is running on battery!

WHY are you doing this?  What is your motivation?

Bitcoin Wallet is such a good app, why do you add these malware-like things in the background?  Why do you hook reboots?  Why do you restart the network synchronizations on a timer?  Can't I just run the app when it's open, and leave it at that?  Please behave like a well-behaved app, and do not consume resources in the background.  Simply shut down.  Do nothing.  When the user leaves the app, close the connections, and allow your process to exit.

I looked at Battery usage and Bitcoin Wallet has taken a full 5% of my battery.  That might not sound like a lot, but I'm trying to save as much as I can.

This latest update is worse, instead of better, because now instead of acting only at reboot and only when the charger is first connected, it now acts on its own in the background, without any way for the user to stop this from happening.

Damn it, it just popped up again, and I thought I had just killed it!  What's the timer frequency?  It seems to be firing every few minutes or so.

Reluctantly, I just sent a payment to zero out my wallet, and I am now DELETING this fine app.  It makes me sad, because this app is truly great.. when it's up and running in the foreground!

I don't understand why making network connections in the background, on a timer, and at startup are not concerns of yours.  It seems that many people would be leery of an app that consumes their network and battery even when the app is closed, and not wanted.  At the minimum this should be a configurable option.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Mike Hearn on August 16, 2013, 10:05:01 AM
You guys ARE NOT READING WHAT IS WRITTEN.

Andreas has already told you how to disable this. Maybe you can't see the option because you have to scroll down on the data usage screen to get it. At the bottom of the app specific data usage screen is a tick box that says "Restrict background data usage". Tick it and your issue will go away.



Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on August 20, 2013, 10:29:35 PM
You guys ARE NOT READING WHAT IS WRITTEN.

Andreas has already told you how to disable this. Maybe you can't see the option because you have to scroll down on the data usage screen to get it. At the bottom of the app specific data usage screen is a tick box that says "Restrict background data usage". Tick it and your issue will go away.

You guys are NOT UNDERSTANDING the fundamental problem.

Checking the "Restrict background data" box:

1) It will only turn off cellular data, and will not affect Wi-Fi data.

2) The problem isn't data, it's that the app keeps waking up, taking battery life.

3) Due to unfixed bugs in the app, if it can't reach its peers, it gets unhappy, and spins in a loop, taking 100% CPU.  This will further drain battery life.

4) The app shouldn't be doing things behind the user's back anyway, but this is a philosophical design issue, one that we absolutely and fundamentally disagree on.  You believe that apps should be free to wake up whenever they want, hook whatever events they want, make whatever connections they want, consume finite resources (battery) as much as they want, and at whatever times they want.  We don't.  Thus, this makes it impossible to further reason or compromise about this issue.

Josh


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on August 20, 2013, 11:18:03 PM
4) The app shouldn't be doing things behind the user's back anyway

If computers wouldn't do things behind users backs, we would not have any use for them.

An app has got an UI. Anything that happens beyond it is happening "behind the users backs".

So yes, we have a fundamental disagreement here.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Mike Hearn on August 21, 2013, 04:39:23 PM
5% battery usage is too high indeed, but that doesn't seem to be normal. Is this after you've tried things to restrict background data usage? There might be CPU looping bugs that can occur in such a mode that could be fixed.

However you have to understand that Android phones are doing things in the background all the time. Just run adb logcat and watch for a while. They sync mail, calendar, check for app updates, they tear down and re-establish push connections, they search for wifi hotspots, they optimise applications, they check for OS updates and so on. None of these apps or services have a "don't run in background" option in their UI, rather, they're just expected to make maximally efficient use of the device resources.

Now some apps are pretty bad at that and use a lot of resources for no real reason, that's certainly true, and if you're seeing 5% battery usage then I'd say that needs to be fixed. But if it was 1% or less then I'd think there's no real issue here.

Why not just introduce a setting? Because it's bad software design. If you add a setting every time someone complains about something on a forum you end up with a million obscure settings. Bitcoin Wallet already has too many settings - heck, why is there a toggle for the connectivity indicator and the disclaimer? The connectivity indicator should probably be a part of the main app screen (or not there at all - it's obsolete now there's the network monitor), and there's probably no use case for reactivating the disclaimer after you read it.

The vast majority of Android apps keep themselves fresh and up to date in the background. That's just how the platform works. If you're upset about that, you're upset about how modern platforms function. Requesting settings in every app you use to try and fight that trend isn't the way to go. Power user versions of Android itself are the right place to add that feature - so perhaps Cyanogen allows you to manually manage app lifecycles.



Title: Re: Please give us back the option to disable Sync on Power
Post by: Syke on August 23, 2013, 12:08:11 AM
I've never tried because I think it's worth to invest 1 MB of my 200 MB monthly mobile quota in being synched with the chain as much as possible. But since you're so convinced about the usecase - why don't you try?

I wish it was that light on data. At this moment, Android is showing Bitcoin has downloaded 5.65MB out of the 66MB so far this billing cycle. That's a little heavy for a limited data plan. It's really painful when I go roaming internationally.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Mike Hearn on August 23, 2013, 07:43:35 AM
Any data at all is painful when roaming, that's why Android disables data access by default.

At the moment I'm showing about 4.5mb of data used so far in August, so that doesn't sound totally off the mark. It could probably be optimised further, it's just never been a focus. What kind of data plan do you have? I guess most people have between 500-1000mb per month these days, on contract, so about 5mb would be 0.5%-1% of total transfer usage. Again, it could be improved, but there are bigger problems with the app right now.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Syke on August 23, 2013, 05:08:53 PM
Any data at all is painful when roaming, that's why Android disables data access by default.

Ok, for this use case, restricting background data would do it. It doesn't eliminate wifi usage, but that isn't as important. I just have to remember to disable background data for bitcoin when I go roaming.

At the moment I'm showing about 4.5mb of data used so far in August, so that doesn't sound totally off the mark. It could probably be optimised further, it's just never been a focus. What kind of data plan do you have? I guess most people have between 500-1000mb per month these days, on contract, so about 5mb would be 0.5%-1% of total transfer usage. Again, it could be improved, but there are bigger problems with the app right now.

A basic AT&T data plan is 300 MB.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Mike Hearn on August 24, 2013, 08:51:19 AM
OK, I can see that 5 of 300 is getting into the zone where one might care, although it's still a small amount. Android does let you restrict data on mobile only, at least the version I have does. On the app specific data usage screen there is a check box at the bottom which says "restrict background usage on mobile networks". Perhaps it's a jellybean feature though? Not sure.


Title: Re: Please give us back the option to disable Sync on Power
Post by: pointbiz on August 28, 2013, 12:19:24 AM
Quote from: Mike Hearn link=topic=260719.msg2997603#msg2997603 603#msg2997603 date=1377334279
OK, I can see that 5 of 300 is getting into the zone where one might care, although it's still a small amount. Android does let you restrict data on mobile only, at least the version I have does. On the app specific data usage screen there is a check box at the bottom which says "restrict background usage on mobile networks". Perhaps it's a jellybean feature though? Not sure.

I turned off mobile data today for the app and it used 53% of my battery.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on August 28, 2013, 04:04:25 PM
Quote from: Mike Hearn link=topic=260719.msg2997603#msg2997603 603#msg2997603 date=1377334279
OK, I can see that 5 of 300 is getting into the zone where one might care, although it's still a small amount. Android does let you restrict data on mobile only, at least the version I have does. On the app specific data usage screen there is a check box at the bottom which says "restrict background usage on mobile networks". Perhaps it's a jellybean feature though? Not sure.

I turned off mobile data today for the app and it used 53% of my battery.

Would you like to send me your logs so I can look up exactly what consumed your battery? Use Options > Settings > Report issue. Please refer to this post in the description.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on September 08, 2013, 08:18:44 AM
Would you like to send me your logs so I can look up exactly what consumed your battery? Use Options > Settings > Report issue. Please refer to this post in the description.

A few days ago, I found it taking a mere 64% of my battery!

Here's screenshots:

http://krellan.com/postings/Android_Bitcoin_1.pnghttp://krellan.com/postings/Android_Bitcoin_2.png

Unfortunately, didn't know about the "Report Issue" feature at the time this happened.

I've rebooted the phone several times since then, though, and it didn't happen again!

Josh


Title: Re: Please give us back the option to disable Sync on Power
Post by: Andreas Schildbach on September 08, 2013, 11:29:38 AM
Well, the report feature can report up to 7 days worth of logs. So if you know the exact date it might be worth to report nevertheless.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Krellan on September 09, 2013, 12:29:42 AM
Well, the report feature can report up to 7 days worth of logs. So if you know the exact date it might be worth to report nevertheless.

Thanks.  It happened on September 4, as per the timestamp on the screenshot photo.

Unfortunately, I can't find how to send a report.

In the phone's "Application manager", on the main "App info" screen that was in my earlier screenshot, the button that was previously labeled "Report" is now labeled "Uninstall"!  I tried to go to "Battery" but Bitcoin doesn't show up in the list (it is being very well-behaved now, because I'm on a fast Wi-Fi connection so it can complete its periodic sync quickly).  So, I can't send a report from the Battery screen, which I should have done from that screenshot!

I was able to send another kind of report by going to the "Active apps" tab of "Application manager", selecting Bitcoin, then the service "BlockchainServiceImpl" had a "Report" button.  I did this.  Don't know if it will help, though.

Is there a way to force Android to always enable the "Report" button, for apps of interest?

Josh


Title: Re: Please give us back the option to disable Sync on Power
Post by: twmz on September 09, 2013, 01:10:17 PM
Unfortunately, I can't find how to send a report.

Report Issue is a button on the In-App settings page.


Title: Re: Please give us back the option to disable Sync on Power
Post by: Orbixx on October 20, 2013, 07:48:23 PM
Exactly what is so undesirable about including an option to turn off sync completely unless the Bitcoin app intent has onscreen focus?

This is clearly a sought-after feature for numerous reasons, including battery life. Just briefly outline the consequence of not having a frequently updated blockchain. I don't even mind if you refuse to provide support for people with sync turned off.

It's the only reason I do not have this app installed.


Title: Re: Please give us back the option to disable Sync on Power
Post by: khepri66 on August 01, 2015, 11:26:32 AM
Sorry to dig up this thread but I just started up an older device and this app decided burn through 200mb. Nice one. It's not like that's 20% of my quota or anything.

Exactly what is so undesirable about including an option to turn off sync completely unless the Bitcoin app intent has onscreen focus?

This is clearly a sought-after feature for numerous reasons, including battery life. Just briefly outline the consequence of not having a frequently updated blockchain. I don't even mind if you refuse to provide support for people with sync turned off.

It's the only reason I do not have this app installed.

At least one altcoin fork has had this feature (plus a disconnect button!) from the beginning, and it works just fine. It's clear that there's no real reason why it can't exist other than developer arrogance.

I'm honestly undecided on my favorite part of the thread. Is it the developer autistically responding to the wording of a user's comment while completely missing the point, or the part where the app used 60% battery with background data disabled, or the simple fact that the developer literally cannot understand how a user might be willing to accept the tradeoff of no sync?