agro6162 / talkmyphone

Automatically exported from code.google.com/p/talkmyphone
0 stars 0 forks source link

TalkMyPhone should auto-reconnect #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometime it disconnetcs and I have to manually use the "Start" button again, 
there is a way to let reconnect again as soon as the device get a network 
connection again?

Original issue reported on code.google.com by alessio....@gmail.com on 27 Sep 2010 at 9:58

GoogleCodeExporter commented 9 years ago
This is a bug. TalkMyPhone should already be able to reconnect.

Original comment by chm.duquesne on 27 Sep 2010 at 12:41

GoogleCodeExporter commented 9 years ago
After switching between WLAN and GSM the Service doesn't reconnect.

Original comment by oliver.a...@gmail.com on 29 Sep 2010 at 10:21

GoogleCodeExporter commented 9 years ago

Original comment by chm.duquesne on 6 Oct 2010 at 1:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It happens the same to me with Android 2. 2. A part from that,  a way to 
restart the application remotely would be super. Imagine that you lose your 
phone and your application is not on. How would you use it?  I know this must 
be complicated or even impossible,  but this would be terrific! 

Thanks,

Sergi

Original comment by sbru...@gmail.com on 7 Oct 2010 at 5:49

GoogleCodeExporter commented 9 years ago
I have the same issue, particularly when switching networks.  I've pulled the 
source and using the debugger I can see the failed connection attempt (the 
error seems to be "no response from server" for the one time I reproduced it.)

I'd like to have a go at fixing this, but would like some feedback.  What I'm 
thinking is:

* Whenever we *should* be connected but are not (ie, if we fail to connect, or 
if the connection is lost but the network still exists), attempt a reconnect.

* Use a simple back-off and retry scheme - eg, make up to (say) 5 reconnect 
attempts, with the first retry sleeping for 5 seconds, second for 10, third for 
20, etc.

Does that sound reasonable?  If so, would it be necessary to expose this in the 
preferences UI, or could it be and fixed behaviour?

Original comment by skippy.hammond@gmail.com on 12 Oct 2010 at 9:54

GoogleCodeExporter commented 9 years ago
I'm attaching a first cut at auto-reconnect.  It works well for me, except for 
the existing issue that causes the smack library to hang on a real device when 
disconnecting the mobile network (it works fine on the emulator though).  On 
the real device it also correctly detects when we fallback to the wifi network 
when it is enabled (in that case, the "mobile" network reports it is available 
still, so the existing code doesn't know to disconnect then reconnect to wifi.)

Note I've also added a fair bit of logging, which seems useful to have - please 
let me know if you want that removed or if you have any other issues.

Original comment by skippy.hammond@gmail.com on 14 Oct 2010 at 12:50

Attachments:

GoogleCodeExporter commented 9 years ago
When TalkMyPhone is connected over 3G, turning on Wifi and auto-disconnecting 
3G causes the app to hang.  It is shown as connected in the app, but it is 
disconnected on the chat client.  Clicking Start/Stop causes the app to force 
close.

Swapping from Wifi to 3G is okay.  No force close, app auto reconnects.

I can email a logcat if required.  Android 2.2, 2.06 beta.

Original comment by cheech...@gmail.com on 14 Oct 2010 at 8:02

GoogleCodeExporter commented 9 years ago
@skippy.hammond: Thanks! I'll make sure to look at your patch and integrate it. 
However, this patch conflicts with uncommited changes. I can easily deal with 
it, however I think it would be cool to see your patch appear with your name on 
it on the repo. If you want to make a public clone, I can pull from it and the 
patch will appear with your name on it. In that case, I'll ask you to merge 
with my upcoming changes. Otherwise, I'll just arrange the patch by myself but 
it will appear as if I had done all the work...

Original comment by chm.duquesne on 14 Oct 2010 at 9:40

GoogleCodeExporter commented 9 years ago
No probs - I'll publish a clone over the next few days (I'm new to eclipse, so 
I'm not sure how to best work with multiple branches at once).

Original comment by skippy.hammond@gmail.com on 14 Oct 2010 at 12:08

GoogleCodeExporter commented 9 years ago
A clone is at https://skippyhammond-auto-reconnect.googlecode.com/hg/

Original comment by skippy.hammond@gmail.com on 15 Oct 2010 at 5:27

GoogleCodeExporter commented 9 years ago
I pulled your changes

Original comment by chm.duquesne on 15 Oct 2010 at 8:23

GoogleCodeExporter commented 9 years ago
Hi,

I notice also that if I use Tasker to start Talkmyphone, the app loads, but 
does not connect. Is this related? I have Tasker set up to only start TMP when 
it sees my work WiFi and another task where I can send an SMS saying "tmp on" 
and it will turn on TMP, but alas, it loads but does not connect ;-(

-Barry

Original comment by ba...@flanagan.ie on 16 Oct 2010 at 1:41

GoogleCodeExporter commented 9 years ago
@barry - it isn't directly related.  It sounds like you are after an option to 
have TMP to automatically connect when started (which I agree would be somewhat 
useful)

Original comment by skippy.hammond@gmail.com on 17 Oct 2010 at 10:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in both TMP and gtalksms

Original comment by skippy.hammond@gmail.com on 26 Dec 2010 at 7:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I didn't see a new version of TMP so I downloaded gtalksms and I must say:
Awesome!! Works perfectly. 

Will definitely donate.

I've had it running all day and it reliably reconnected every time. 

Original comment by TreeOfTh...@googlemail.com on 26 Dec 2010 at 10:08