Skip to content

improve android docs, just little tweaks #1508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 21, 2020
Merged
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
21 changes: 11 additions & 10 deletions src/collections/_documentation/platforms/android/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public class DemoClass {
/**
* An Example of how to report an error and how to enrich the error context.
*/
void logWithStaticAPI() {
public void logWithStaticAPI() {
/*
Record a breadcrumb in the current context, which will be sent
with the next event(s). By default, the last 100 breadcrumbs are kept.
Expand Down Expand Up @@ -193,12 +193,12 @@ buildscript {
}

dependencies {
classpath 'io.sentry:sentry-android-gradle-plugin:1.7.30'
classpath 'io.sentry:sentry-android-gradle-plugin:1.7.31'
}
}
```

The plugin will automatically generate appropriate ProGuard mapping files and upload them when you run `gradle assemble{BuildVariant}`. For example, `assembleRelease` — Release is the default, but the plugin works for others if you have enabled ProGuard. The credentials for the upload step are loaded via environment variables.
The plugin will automatically generate appropriate ProGuard mapping files and upload them when you run `gradle assemble{BuildVariant}`. For example, `assembleRelease` — Release is the default, but the plugin works for others if you have enabled ProGuard/R8. The credentials for the upload step are loaded via environment variables.

For more information, see the [full sentry-cli documentation]({%- link _documentation/cli/configuration.md -%}#configuration-values).

Expand Down Expand Up @@ -242,7 +242,7 @@ sentry {
}
```

And that's it! Now when you build your app, the plugin will upload the proguard/R8 mappings,
And that's it! Now when you build your app, the plugin will upload the ProGuard/R8 mappings,
source bundle, and native symbols, as you configured them to Sentry.

## Releases
Expand Down Expand Up @@ -359,7 +359,8 @@ For more information, see [Tagging Events]({%- link _documentation/enriching-err

### Setting the Level

You can set the severity of an event to one of five values: `fatal`, `error`, `warning`, `info`, and `debug`. `error` is the default, `fatal` is the most severe, and `debug` is the least severe.
You can set the severity of an event to one of five values: `fatal`, `error`, `warning`, `info`, and `debug`.
`error` is the default, `fatal` is the most severe, and `debug` is the least severe.

```java
Sentry.setLevel(SentryLevel.WARNING);
Expand Down Expand Up @@ -538,8 +539,8 @@ You can configure which package prefixes belong in your application and which do

```java
// This can be set only during the initialization of the SDK.
SentryAndroid.init(this,options -> {
//set all sub packages of java. as packages that do not belong to your application
SentryAndroid.init(this, options -> {
// set all sub packages of java. as packages that do not belong to your application
options.addInAppExclude("java.");

// set all sub packages of io.sentry as packages that belong to your application
Expand All @@ -555,7 +556,7 @@ Sentry exposes a `beforeSend` callback, which can be used to filter out informat
The callback can be registered during the initialization of the SDK.

```java
SentryAndroid.init(this,options -> {
SentryAndroid.init(this, options -> {

// Add a callback that will be used before the event is sent to Sentry.
// With this callback, you can modify the event or, when returning null, also discard the event.
Expand Down Expand Up @@ -622,7 +623,7 @@ Now you can use the Sentry NDK API just by including the sentry.h in your code:
extern "C" JNIEXPORT jstring JNICALL

Java_io_sentry_demo_NativeDemo_crash(JNIEnv *env, jclass cls) {
__android_log_print(ANDROID_LOG_WARN, "", "About to crash.");
__android_log_print(ANDROID_LOG_WARN, "", "Capture a message.");
sentry_value_t event = sentry_value_new_message_event(
/* level */ SENTRY_LEVEL_INFO,
/* logger */ "custom",
Expand All @@ -638,5 +639,5 @@ Example of uploading all your .so files:

```bash
sentry-cli login
sentry-cli upload-dif -o {YOUR ORGANISATION} -p {PROJECT} build/intermediates/merged_native_libs/{variantFolder}
sentry-cli upload-dif -o {YOUR ORGANISATION} -p {PROJECT} build/intermediates/merged_native_libs/{buildVariant}
```
6 changes: 3 additions & 3 deletions src/collections/_documentation/platforms/android/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Example of the configuration in the Manifest:

```xml
<application>
<!-- Example of the Sentry DSN setting -->
<!-- Example of the Sentry DSN setting -->
<meta-data android:name="io.sentry.dsn" android:value="___PUBLIC_DSN__" />
</application>
```
Expand All @@ -26,7 +26,7 @@ If you want to set the configuration manually in the code, you need to initializ

### Installation

The new SDK can initialize automatically; all you need to do is provide the DSN in your Manifest file, as shown in the previous example in [Configuration](#configuration).
The new SDK can initialize automatically, all you need to do is provide the DSN in your Manifest file, as shown in the previous example in [Configuration](#configuration).

**Manual Installation**

Expand Down Expand Up @@ -171,7 +171,7 @@ release {
}
```

And, add to the `multidex-config.pro` to the following lines:
And, add to `multidex-config.pro` the following lines:

```
-keep class io.sentry.android.core.SentryAndroidOptions
Expand Down