• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

How to handle Network Calls when there is a Weaker Network connection

 
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Problem here is guys that i have an android app which uses Geocoding and makes REST based Network calls, this however works flawlessly when i am using WI-FI, however when i have tried using GPRS network it does well most times but there are instances when it has failed resulting in a force close. How to handle this during situations when the network is weak like making a call again e.t.c. Any help is appreciated

Thanks & Regards
Zoheb
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked into the Connectivity Manager?



 
zoheb hassan
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Connectivity Manager is used in the app for checking Network connections if they are available or not, but the issue here is that it does well in Stronger Network connections however fails in poorer Network Connections owing to the fact that it makes Network Calls, I am curious if there is a way to make Calls again when there is a failure ??
 
R Hoefer
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean when you say 'Weak connection'? Are you saying you can't connect for a few moments or are you saying that the calls take a very long time to complete?
 
zoheb hassan
Ranch Hand
Posts: 154
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By Mentioning a "Weak Connection", I am Trying to say that its the kind of connection which has poor signal Strength and low Speed in terms of Data Transfer Which otherwise in presence of a stronger connection like Wi-fi would work fine.
 
R Hoefer
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm still not understand what you mean by weaker connection. The way I read it, I thought you were talking about a failure first and just a slow connection second. Here are a few thoughts I had.

1) Slow connection - Throw up a dialog and then use an async task to grab the data and update your UI.

2) Revisit the connectivity manager . The documentation states it can be used to "Monitor network connections (Wi-Fi, GPRS, UMTS, etc.)" and "Send broadcast intents when network connectivity changes".
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are connecting to remote servers over HTTP, one of the approaches could be setting appropriate ConnectionTimeOut and SocketTimeOut parameters. If you get ConnectionTimeOut or SocketTImedOut Exceptions you can show an informational popup to the user saying "Limited Connectivity or Slow connection".
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic