This project uses local.properties to store sensitive information like API keys and tokens. These values should NEVER be committed to version control.
-
Copy
local.properties.exampletolocal.properties:cp local.properties.example local.properties
-
Fill in your actual values in
local.properties:API_BASE_URL: The base URL for API endpointsMAPBOX_ACCESS_TOKEN: Your Mapbox access token (get one from https://account.mapbox.com/)MAPBOX_STYLE_URL: Your Mapbox style URL
The build system reads values from local.properties and:
- Exposes them as
BuildConfigfields in Kotlin code - Generates string resources for XML usage (e.g., Mapbox token)
Kotlin:
import com.example.roomexample.BuildConfig
// Access API base URL
val apiUrl = BuildConfig.API_BASE_URL
// Access Mapbox style URL
val styleUrl = BuildConfig.MAPBOX_STYLE_URLXML (automatically generated):
<!-- Mapbox token is automatically available as a string resource -->
<string name="mapbox_access_token">@string/mapbox_access_token</string>