mirror of
https://github.com/status-im/react-native-config.git
synced 2025-02-24 04:48:16 +00:00
update readme to explain usage from regular Java classes
This commit is contained in:
parent
ce0eb6f546
commit
ae4967d1cc
13
README.md
13
README.md
@ -25,7 +25,16 @@ Config.GOOGLE_MAPS_API_KEY // 'abcdefgh'
|
||||
|
||||
### Android
|
||||
|
||||
You can also refer to any variables set in `.env` from your Gradle configuration:
|
||||
Config variables set in `.env` are available to your Java classes via `BuildConfig`:
|
||||
|
||||
```java
|
||||
public HttpURLConnection getApiClient() {
|
||||
URL url = new URL(BuildConfig.API_URL);
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
You can also read them from your Gradle configuration:
|
||||
|
||||
```groovy
|
||||
signingConfigs {
|
||||
@ -38,7 +47,7 @@ signingConfigs {
|
||||
}
|
||||
```
|
||||
|
||||
They are also available to settings in `AndroidManifest.xml` and others:
|
||||
And use them to configure libraries in `AndroidManifest.xml` and others:
|
||||
|
||||
```xml
|
||||
<meta-data
|
||||
|
Loading…
x
Reference in New Issue
Block a user