Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ fastlane/readme.md

# Visual Studio Code
.vscode/
./.DS_Store
./.git/.DS_Store
*.DS_Store


# Custom product flavours
*custom-flavours.gradle

.DS_Store
*.properties
./gradle
*.DS_Store
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ private String _Domain = "http://132.148.151.32/";
```

For demo purposes, the default Web Services domain is set to the openIMIS
demo server: demo.openimis.org (IP: 132.148.151.32).
demo server: demo.openimis.org (IP: 132.148.151.32).

If you want to receive error and exception events in sentry
you can set `sentry_dsn` in build.gradle file

### Running the app

Expand Down
2 changes: 2 additions & 0 deletions claimManagement/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ android {
buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"'
buildConfigField "String", "API_VERSION", '"3"'
resValue "string", "release_tag", "release/25.04"
resValue "string", "sentry_dsn", ""
}

productFlavors {
Expand Down Expand Up @@ -220,5 +221,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation group: 'com.squareup.picasso', name: 'picasso', version: '2.71828'
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '1.2.7'
implementation 'io.sentry:sentry-android:8.25.0'

}
4 changes: 4 additions & 0 deletions claimManagement/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
android:resource="@xml/paths" />
</provider>

<meta-data
android:name="io.sentry.dsn"
android:value="@string/sentry_dsn" />

<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
import java.util.ArrayList;
import java.util.List;

import io.sentry.Sentry;
import io.sentry.android.core.SentryAndroid;


public class MainActivity extends ImisActivity {
private static final int REQUEST_PERMISSIONS_CODE = 1;
Expand Down Expand Up @@ -283,6 +286,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
(d, i) -> finish());
}
} catch (Exception e) {
Sentry.captureException(e);
Log.e(LOG_TAG, "Error while copying master data.", e);
}
}
Expand All @@ -303,6 +307,7 @@ public void PickMasterDataFileDialog() {
try {
startActivityForResult(intent, REQUEST_PICK_MD_FILE);
} catch (ActivityNotFoundException e) {
Sentry.captureException(e);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.NoFileExporerInstalled), Toast.LENGTH_SHORT).show();
}
}).setNegativeButton(getResources().getString(R.string.No),
Expand All @@ -319,6 +324,7 @@ public AlertDialog confirmRefreshMap() {
try {
doLoggedIn(() -> DownLoadDiagnosesServicesItems(global.getOfficerCode()));
} catch (Exception e) {
Sentry.captureException(e);
e.printStackTrace();
}
},
Expand Down Expand Up @@ -409,6 +415,7 @@ public AlertDialog DownloadMasterDialog() {
}
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
DownloadMasterDialog();
}
} else {
Expand Down Expand Up @@ -442,6 +449,7 @@ private void checkForUpdates() {
try {
mNotificationManager.notify(SIMPLE_NOTIFICATION_ID, builder.build());
} catch (Exception e) {
Sentry.captureException(e);
e.printStackTrace();
}

Expand Down Expand Up @@ -479,6 +487,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
ErrorDialogBox(e.getMessage());
Expand Down Expand Up @@ -519,6 +528,7 @@ public void getClaimAdmins() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> progressDialog.dismiss());
}
});
Expand Down Expand Up @@ -554,6 +564,7 @@ public void validateClaimAdminCode(final String claimAdminCode) {
progressDialog.dismiss();
doLoggedIn(() -> DownLoadDiagnosesServicesItems(claimAdminCode));
} catch (Exception e) {
Sentry.captureException(e);
e.printStackTrace();
}
}
Expand Down Expand Up @@ -637,6 +648,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
Toast.makeText(MainActivity.this, e.getMessage() + "-" + getResources().getString(R.string.SomethingWentWrongServer), Toast.LENGTH_LONG).show();
Expand Down Expand Up @@ -681,6 +693,7 @@ public void run() {
});
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
runOnUiThread(() -> {
progressDialog.dismiss();
Toast.makeText(MainActivity.this, e.getMessage() + "-" + getResources().getString(R.string.AccessDenied), Toast.LENGTH_LONG).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.net.URL;
import java.util.ArrayList;

import io.sentry.Sentry;

public class SynchronizeActivity extends ImisActivity {
private static final String LOG_TAG = "SYNCACTIVITY";
private static final int PICK_FILE_REQUEST_CODE = 1;
Expand Down Expand Up @@ -129,6 +131,7 @@ protected void onBroadcastReceived(Context context, Intent intent) {
showDialog(getResources().getString(R.string.BulkUpload));
}
} catch (JSONException e) {
Sentry.captureException(e);
Log.e(LOG_TAG, "Error while processing claim response", e);
}
break;
Expand Down Expand Up @@ -296,6 +299,7 @@ public void CheckUpdate(){
Toast.LENGTH_SHORT).show();
});
} catch (Exception e) {
Sentry.captureException(e);
runOnUiThread(() -> {
pd.dismiss();
Toast.makeText(this,
Expand Down Expand Up @@ -327,6 +331,7 @@ public void downloadUpdate(String lastVersion, String tagName) {

} catch (Exception e) {
Toast.makeText(this, getResources().getString(R.string.downloadUpdateFail), Toast.LENGTH_SHORT).show();
Sentry.captureException(e);
Log.e("DownloadUpdate", "Erreur: ", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.util.List;
import java.util.Locale;

import io.sentry.Sentry;

public class SynchronizeService extends JobIntentService {
private static final int JOB_ID = 6541259; //Random unique Job id
private static final String LOG_TAG = "SYNCSERVICE";
Expand Down Expand Up @@ -114,6 +116,7 @@ private void handleUploadClaims() {
broadcastSyncSuccess(claimStatus);
} catch (Exception e) {
e.printStackTrace();
Sentry.captureException(e);
broadcastError(getResources().getString(R.string.ErrorOccurred) + ": " + e.getMessage(), ACTION_UPLOAD_CLAIMS);
}
}
Expand Down Expand Up @@ -195,6 +198,7 @@ private void handleExportClaims() {
AppInformation.DateTimeInfo.getDefaultIsoDatetimeFormatter().format(new Date()),
SQLHandler.CLAIM_UPLOAD_STATUS_EXPORTED, null);
} catch (JSONException e) {
Sentry.captureException(e);
Log.e(LOG_TAG, "Exception while exporting claims", e);
}
}
Expand All @@ -219,6 +223,7 @@ private File createClaimFile(JSONObject details) {
String filename = "Claim_" + details.getString("HFCode") + "_" + details.getString("ClaimCode") + "_" + d + ".xml";
return storageManager.createTempFile("exports/claim/" + filename);
} catch (JSONException e) {
Sentry.captureException(e);
Log.e(LOG_TAG, "Parsing claim JSON failed", e);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public List<Medication> getMedications() {
return medications;
}

public static final Creator<Claim> CREATOR = new Creator<Claim>() {
public static final Creator<Claim> CREATOR = new Creator<>() {
@Override
public Claim createFromParcel(Parcel in) {
return new Claim(in);
Expand Down