diff --git a/android-json-form-wizard/build.gradle b/android-json-form-wizard/build.gradle index 709beae15..eac01747b 100644 --- a/android-json-form-wizard/build.gradle +++ b/android-json-form-wizard/build.gradle @@ -151,7 +151,7 @@ dependencies { implementation "org.greenrobot:eventbus:3.2.0" implementation 'androidx.multidex:multidex:2.0.1' - implementation 'io.sentry:sentry-android:5.0.1' + api 'io.sentry:sentry-android:5.0.1' // PowerMock def powerMockVersion = '2.0.9' diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java index 48c79d7ae..c1f9aaa5f 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/activities/JsonFormBaseActivity.java @@ -43,8 +43,6 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import io.sentry.ITransaction; -import io.sentry.Sentry; import timber.log.Timber; import static com.vijay.jsonwizard.utils.NativeFormLangUtils.getTranslatedString; @@ -84,7 +82,6 @@ public abstract class JsonFormBaseActivity extends MultiLanguageActivity impleme protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.native_form_activity_json_form); - ITransaction transaction = Sentry.startTransaction("revealFormOpening", "insideJsonFormBase oncreate"); findViewById(R.id.native_form_activity).setFilterTouchesWhenObscured(true); mToolbar = findViewById(R.id.tb_top); setSupportActionBar(mToolbar); @@ -112,8 +109,6 @@ protected void onCreate(Bundle savedInstanceState) { for (LifeCycleListener lifeCycleListener : lifeCycleListeners) { lifeCycleListener.onCreate(savedInstanceState); } - - transaction.finish(); } private String readDataSource() { diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/Utils.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/Utils.java index 4a011ba03..7ba534d22 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/Utils.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/Utils.java @@ -795,6 +795,7 @@ public static boolean isEmptyJsonObject(JSONObject jsonObject) { * @return * @throws JSONException */ + @Nullable public static JSONObject getRepeatingGroupCountObj(@NotNull WidgetArgs widgetArgs) throws JSONException { String repeatingGroupCountObjKey = widgetArgs.getJsonObject().get(KEY) + "_count"; JSONObject stepJsonObject = widgetArgs.getFormFragment().getStep(widgetArgs.getStepName()); diff --git a/sample/build.gradle b/sample/build.gradle index 81bfb98d6..5f5e2113b 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -29,6 +29,8 @@ android { versionCode 1 versionName "1.0" multiDexEnabled true + + buildConfigField("String", "SENTRY_DSN", "\"" + getProps("sentry.dsn") + "\"") } buildTypes { @@ -60,3 +62,14 @@ dependencies { implementation 'org.smartregister:opensrp-client-utils:0.0.6-SNAPSHOT' } + +// get property from local.properties +def getProps(String propName) { + def propsFile = rootProject.file('local.properties') + if (propsFile.exists()) { + def props = new Properties() + props.load(new FileInputStream(propsFile)) + return props[propName] + } + return ""; +} diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 75c11a6ab..1eae6330d 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" + android:name=".MainApplication" android:theme="@style/NativeFormsAppTheme"> { + options.setEnvironment("opensrp-native-form-sample"); + options.setDsn(BuildConfig.SENTRY_DSN.trim()); + }); + } + + } +}