Skip to content
Open
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
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,40 @@ Snapshot documentation is available at [jakewharton.github.io/timber/docs/latest
</p>
</details>

Set Up
------
I added more details on the existing ReadMe file , focusing on setting up Timber once the dependencies have been downloaded.

### Step 1 : Create an Application class that inherits from Application class .
```
open class MyProjectApplication : Application() {
}
```

### Step 2 : import the application package
import android.app.Application
Comment on lines +125 to +130
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These steps should be merged.


### Step 3 : override the onCreate() method and initialize the Timber class
override the onCreate() method in your Application class
```
open class MyProjectApplication : Application() {
if (BuildConfig.DEBUG) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't place them in onCreate here.

Timber.plant(new DebugTree());
} else {
Timber.plant(new CrashReportingTree());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not in the public APIs.

}
}
```
### Step 4 : Finally Define it in your Android Manifest , Application tag
In your application tag, add it as a name attribute :
```
<application
....
android:name=".MyProjectApplication"
android:theme="@style/AppTheme"
.... >
```

License
-------

Expand Down