Get and Update Project Settings

Get and Update Project Settings

The Get and Update Project Settings feature ensures that your Android application always stays in sync with the latest Full Stack configuration defined in PageSense.

Project settings include:

  • Active experiments

  • Variations and traffic allocation

  • Goals

  • Audience targeting rules

Since experiments can be updated over time, the SDK provides a polling-based mechanism to fetch the latest configuration automatically.

How project settings are updated  

The Android SDK uses a foreground-aware polling strategy to refresh project settings efficiently without unnecessary network usage.

There is no webhook support for Android Full Stack SDK.
All updates are handled through controlled polling.

Polling strategy  

Default behavior  

  • Default polling interval: 5 minutes

  • Project settings are refreshed automatically when:
    The app enters the foreground
    The network connection becomes available

This ensures the app always starts with the latest configuration when the user opens it.

Polling interval rules  

The polling interval is user-configurable, with the following constraints:

  • Minimum allowed interval: 5 minutes

  • Any value greater than or equal to 5 minutes is permitted

  • Polling intervals shorter than 5 minutes are not allowed

  • If a value lower than 5 minutes is configured, it is automatically normalised to 5 minutes

This prevents excessive network usage and ensures stable SDK behavior.

Polling lifecycle  

Polling starts when:  

  • The app enters the foreground

  • Network connectivity becomes available

Polling stops when:  

  • The app enters the background

  • The app process is terminated

  • The app is closed

Every time the app moves from background to foreground:

  • Project settings are refreshed immediately

  • The polling timer is reset

If the app remains active for more than 5 minutes, polling will automatically fetch updates again based on the configured interval.

Manually triggering a project settings refresh  

You can manually request the latest project settings using the following API,This call fetches the latest configuration from PageSense and updates the SDK state accordingly.

pageSenseClient.getAndUpdateProjectSettings("accountName","sdkKey","projectName")

Parameter details:  

Parameter

Type

Required

Description

accountName

String

Yes

The unique identifier of your PageSense account.

sdkKey

String

Yes

The secure key for the environment, available under the Environment section of the PageSense application.

projectName

String

Yes

The name of the project as defined in your PageSense account.

 

API response behavior  

When updates are available  

If new project settings are detected, the API responds with a 200 OK status and updates the following fields internally:

  • projectVersion

  • schemaVersion

  • lastUpdatedTime

These values indicate that new configuration changes have been applied.

When no updates are available  

If there are no changes in the project configuration, the API returns a 204 No Content response.

This means:

  • The SDK continues using the existing project settings

  • No changes are applied

  • No action is required

Important notes  

  • Polling happens only when the app is active

  • Configuration updates are lightweight and optimized

  • Developers do not need to manage background threads manually

  • This mechanism ensures users are not served outdated experiment configurations

Best practices  

  • Keep the default polling interval unless you have a strong reason to change it

  • Avoid forcing frequent polling to reduce battery and network usage

  • Let the SDK manage foreground and background transitions automatically