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
private boolean isMyServiceRunning() { | |
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); | |
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { | |
if ("com.example.MyService".equals(service.service.getClassName())) { | |
return true; | |
} | |
} | |
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
// Get most appropriate connection method | |
private String getConnectionString() { | |
String suffix = null; | |
if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_MDS)) | |
{ | |
// BES is available | |
suffix = ";deviceside=false"; | |
} |
NewerOlder