Skip to content

Commit c9b3ab8

Browse files
committed
add glitchip configurations
1 parent 71d9491 commit c9b3ab8

17 files changed

Lines changed: 71 additions & 48 deletions

.DS_Store

0 Bytes
Binary file not shown.

claimManagement/.DS_Store

0 Bytes
Binary file not shown.

claimManagement/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ android {
6262
buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"'
6363
buildConfigField "String", "API_VERSION", '"3"'
6464
resValue "string", "release_tag", "release/25.04"
65+
resValue "string", "glitchip_dsn", "https://3afee255dd9f4b96b0d1b207b1bb5f1b@glitchtip.s2.openimis.org/3"
6566
}
6667

6768
productFlavors {
@@ -171,8 +172,8 @@ android {
171172
}
172173

173174
compileOptions {
174-
sourceCompatibility JavaVersion.VERSION_11
175-
targetCompatibility JavaVersion.VERSION_11
175+
sourceCompatibility JavaVersion.VERSION_1_8
176+
targetCompatibility JavaVersion.VERSION_1_8
176177
}
177178
buildFeatures {
178179
viewBinding true
@@ -220,5 +221,6 @@ dependencies {
220221
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
221222
implementation group: 'com.squareup.picasso', name: 'picasso', version: '2.71828'
222223
implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '1.2.7'
224+
implementation 'io.sentry:sentry-android:5.3.0'
223225

224226
}

claimManagement/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
android:resource="@xml/paths" />
5858
</provider>
5959

60+
<meta-data
61+
android:name="io.sentry.dsn"
62+
android:value="@string/glitchip_dsn" />
63+
6064
<activity
6165
android:name=".MainActivity"
6266
android:exported="true"

claimManagement/src/main/java/org/openimis/imisclaims/MainActivity.java

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
import java.util.ArrayList;
5959
import java.util.List;
6060

61+
import io.sentry.Sentry;
62+
import io.sentry.android.core.SentryAndroid;
63+
6164

6265
public class MainActivity extends ImisActivity {
6366
private static final int REQUEST_PERMISSIONS_CODE = 1;
@@ -109,49 +112,53 @@ public boolean onCreateOptionsMenu(Menu menu) {
109112
@Override
110113
protected void onCreate(Bundle savedInstanceState) {
111114
super.onCreate(savedInstanceState);
112-
setContentView(R.layout.activity_main);
115+
try {
116+
setContentView(R.layout.activity_main);
113117

114-
isSDCardAvailable();
118+
isSDCardAvailable();
115119

116-
broadcastList = new ArrayList<>();
117-
broadcastList.add(SynchronizeService.ACTION_CLAIM_COUNT_RESULT);
120+
broadcastList = new ArrayList<>();
121+
broadcastList.add(SynchronizeService.ACTION_CLAIM_COUNT_RESULT);
118122

119-
progressDialog = new ProgressDialog(this);
120-
progressDialog.setCancelable(false);
123+
progressDialog = new ProgressDialog(this);
124+
progressDialog.setCancelable(false);
121125

122-
Toolbar toolbar = findViewById(R.id.toolbar);
123-
setSupportActionBar(toolbar);
124-
actionBar = getSupportActionBar();
126+
Toolbar toolbar = findViewById(R.id.toolbar);
127+
setSupportActionBar(toolbar);
128+
actionBar = getSupportActionBar();
125129

126-
new Thread(this::checkForUpdates).start();
130+
new Thread(this::checkForUpdates).start();
127131

128-
drawer = findViewById(R.id.drawer_layout);
129-
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
130-
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
131-
drawer.addDrawerListener(toggle);
132-
toggle.syncState();
132+
drawer = findViewById(R.id.drawer_layout);
133+
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
134+
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
135+
drawer.addDrawerListener(toggle);
136+
toggle.syncState();
133137

134-
NavigationView navigationView = findViewById(R.id.nav_view);
135-
navigationView.setNavigationItemSelectedListener(this::onNavigationItemSelected);
138+
NavigationView navigationView = findViewById(R.id.nav_view);
139+
navigationView.setNavigationItemSelectedListener(this::onNavigationItemSelected);
136140

137-
View header = navigationView.getHeaderView(0);
138-
loginText = header.findViewById(R.id.LoginText);
139-
loginText.setText(global.isLoggedIn() ? R.string.Logout : R.string.Login);
140-
RelativeLayout loginButton = header.findViewById(R.id.LoginButton);
141-
loginButton.setOnClickListener((view) -> changeLoginState());
141+
View header = navigationView.getHeaderView(0);
142+
loginText = header.findViewById(R.id.LoginText);
143+
loginText.setText(global.isLoggedIn() ? R.string.Logout : R.string.Login);
144+
RelativeLayout loginButton = header.findViewById(R.id.LoginButton);
145+
loginButton.setOnClickListener((view) -> changeLoginState());
142146

143-
accepted_count = findViewById(R.id.accepted_count);
144-
rejected_count = findViewById(R.id.rejected_count);
145-
entered_Count = findViewById(R.id.entered_count);
147+
accepted_count = findViewById(R.id.accepted_count);
148+
rejected_count = findViewById(R.id.rejected_count);
149+
entered_Count = findViewById(R.id.entered_count);
146150

147-
accepted_count.setText("0");
148-
rejected_count.setText("0");
149-
entered_Count.setText("0");
151+
accepted_count.setText("0");
152+
rejected_count.setText("0");
153+
entered_Count.setText("0");
150154

151-
AdminName = findViewById(R.id.AdminName);
155+
AdminName = findViewById(R.id.AdminName);
152156

153-
if (checkRequirements()) {
154-
onAllRequirementsMet();
157+
if (checkRequirements()) {
158+
onAllRequirementsMet();
159+
}
160+
} catch (Exception exception) {
161+
Sentry.captureException(exception);
155162
}
156163
}
157164

@@ -283,6 +290,7 @@ protected void onActivityResult(int requestCode, int resultCode, @Nullable Inten
283290
(d, i) -> finish());
284291
}
285292
} catch (Exception e) {
293+
Sentry.captureException(e);
286294
Log.e(LOG_TAG, "Error while copying master data.", e);
287295
}
288296
}
@@ -303,6 +311,7 @@ public void PickMasterDataFileDialog() {
303311
try {
304312
startActivityForResult(intent, REQUEST_PICK_MD_FILE);
305313
} catch (ActivityNotFoundException e) {
314+
Sentry.captureException(e);
306315
Toast.makeText(getApplicationContext(), getResources().getString(R.string.NoFileExporerInstalled), Toast.LENGTH_SHORT).show();
307316
}
308317
}).setNegativeButton(getResources().getString(R.string.No),
@@ -319,6 +328,7 @@ public AlertDialog confirmRefreshMap() {
319328
try {
320329
doLoggedIn(() -> DownLoadDiagnosesServicesItems(global.getOfficerCode()));
321330
} catch (Exception e) {
331+
Sentry.captureException(e);
322332
e.printStackTrace();
323333
}
324334
},
@@ -409,6 +419,7 @@ public AlertDialog DownloadMasterDialog() {
409419
}
410420
} catch (Exception e) {
411421
e.printStackTrace();
422+
Sentry.captureException(e);
412423
DownloadMasterDialog();
413424
}
414425
} else {
@@ -442,6 +453,7 @@ private void checkForUpdates() {
442453
try {
443454
mNotificationManager.notify(SIMPLE_NOTIFICATION_ID, builder.build());
444455
} catch (Exception e) {
456+
Sentry.captureException(e);
445457
e.printStackTrace();
446458
}
447459

@@ -479,6 +491,7 @@ public void run() {
479491
});
480492
} catch (Exception e) {
481493
e.printStackTrace();
494+
Sentry.captureException(e);
482495
runOnUiThread(() -> {
483496
progressDialog.dismiss();
484497
ErrorDialogBox(e.getMessage());
@@ -519,6 +532,7 @@ public void getClaimAdmins() {
519532
});
520533
} catch (Exception e) {
521534
e.printStackTrace();
535+
Sentry.captureException(e);
522536
runOnUiThread(() -> progressDialog.dismiss());
523537
}
524538
});
@@ -553,6 +567,7 @@ public void validateClaimAdminCode(final String claimAdminCode) {
553567
progressDialog.dismiss();
554568
doLoggedIn(() -> DownLoadDiagnosesServicesItems(claimAdminCode));
555569
} catch (Exception e) {
570+
Sentry.captureException(e);
556571
e.printStackTrace();
557572
}
558573
}
@@ -636,6 +651,7 @@ public void run() {
636651
});
637652
} catch (Exception e) {
638653
e.printStackTrace();
654+
Sentry.captureException(e);
639655
runOnUiThread(() -> {
640656
progressDialog.dismiss();
641657
Toast.makeText(MainActivity.this, e.getMessage() + "-" + getResources().getString(R.string.SomethingWentWrongServer), Toast.LENGTH_LONG).show();
@@ -680,6 +696,7 @@ public void run() {
680696
});
681697
} catch (Exception e) {
682698
e.printStackTrace();
699+
Sentry.captureException(e);
683700
runOnUiThread(() -> {
684701
progressDialog.dismiss();
685702
Toast.makeText(MainActivity.this, e.getMessage() + "-" + getResources().getString(R.string.AccessDenied), Toast.LENGTH_LONG).show();

claimManagement/src/main/java/org/openimis/imisclaims/domain/entity/Claim.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ public String getJustification() {
501501
return justification;
502502
}
503503

504-
public static final Creator<Service> CREATOR = new Creator<>() {
504+
public static final Creator<Service> CREATOR = new Creator<Service>() {
505505
@Override
506506
public Service createFromParcel(Parcel in) {
507507
return new Service(in);
@@ -611,7 +611,7 @@ public String getJustification() {
611611
return justification;
612612
}
613613

614-
public static final Creator<Medication> CREATOR = new Creator<>() {
614+
public static final Creator<Medication> CREATOR = new Creator<Medication>() {
615615
@Override
616616
public Medication createFromParcel(Parcel in) {
617617
return new Medication(in);

claimManagement/src/main/java/org/openimis/imisclaims/domain/entity/ClaimAdmin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public String getHealthFacilityCode() {
7272
return hfCode;
7373
}
7474

75-
public static final Creator<ClaimAdmin> CREATOR = new Creator<>() {
75+
public static final Creator<ClaimAdmin> CREATOR = new Creator<ClaimAdmin>() {
7676
@Override
7777
public ClaimAdmin createFromParcel(Parcel in) {
7878
return new ClaimAdmin(in);

claimManagement/src/main/java/org/openimis/imisclaims/domain/entity/DiagnosesServicesMedications.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public List<Medication> getMedications() {
7070
return medications;
7171
}
7272

73-
public static final Creator<DiagnosesServicesMedications> CREATOR = new Creator<>() {
73+
public static final Creator<DiagnosesServicesMedications> CREATOR = new Creator<DiagnosesServicesMedications>() {
7474
@Override
7575
public DiagnosesServicesMedications createFromParcel(Parcel in) {
7676
return new DiagnosesServicesMedications(in);

claimManagement/src/main/java/org/openimis/imisclaims/domain/entity/Diagnosis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public String getName() {
4646
return name;
4747
}
4848

49-
public static final Creator<Diagnosis> CREATOR = new Creator<>() {
49+
public static final Creator<Diagnosis> CREATOR = new Creator<Diagnosis>() {
5050
@Override
5151
public Diagnosis createFromParcel(Parcel in) {
5252
return new Diagnosis(in);

claimManagement/src/main/java/org/openimis/imisclaims/domain/entity/HealthFacility.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public String getCode(){
4646
public String getName(){
4747
return name;
4848
}
49-
public static final Creator<HealthFacility> CREATOR = new Creator<>() {
49+
public static final Creator<HealthFacility> CREATOR = new Creator<HealthFacility>() {
5050
@Override
5151
public HealthFacility createFromParcel(Parcel in) {
5252
return new HealthFacility(in);

0 commit comments

Comments
 (0)