forked from SEL-Columbia/dristhi-app
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the way sync status are determined in PathUpdateActionsTask Fix for issue #504, #527, #528 Signed-off-by: Jason Rogena <jasonrogena@gmail.com>
- Loading branch information
1 parent
f304237
commit 82bfe71
Showing
8 changed files
with
131 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package util; | ||
|
||
import android.content.Context; | ||
import android.net.ConnectivityManager; | ||
import android.net.NetworkInfo; | ||
import android.util.Log; | ||
|
||
import org.ei.opensrp.path.application.VaccinatorApplication; | ||
|
||
/** | ||
* Created by Jason Rogena - jrogena@ona.io on 08/06/2017. | ||
*/ | ||
|
||
public class NetworkUtils { | ||
private static final String TAG = NetworkUtils.class.getName(); | ||
public static boolean isNetworkAvailable() { | ||
try { | ||
ConnectivityManager connectivityManager = (ConnectivityManager) VaccinatorApplication | ||
.getInstance().getSystemService(Context.CONNECTIVITY_SERVICE); | ||
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); | ||
return activeNetworkInfo != null && activeNetworkInfo.isConnected(); | ||
|
||
} catch (Exception e) { | ||
Log.e(TAG, Log.getStackTraceString(e)); | ||
} | ||
|
||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters