Skip to main content

Android API Reference

API reference for the Azeoo SDK on Android. The current flow is AzeooSDK.initialize(...) then AzeooSDK.shared.connectUser(token, gender, height, weight, callback); see Android Quick Start and SDK API.

AzeooSDK

Single entry point. Call AzeooSDK.initialize(context, apiKey, config?, theme?, deepLinks?, safeArea?, callback) to start the SDK (Flutter engine + Pigeon setup). Use AzeooSDK.shared thereafter.

Connect a user with AzeooSDK.shared.connectUser(token, gender, height, weight, callback) where callback is (user: AzeooUserProfile?, error: Exception?) -> Unit.

Ready / lifecycle: onReady(callback), isReady, disconnect(callback), dispose(). Note: disconnect uses callback: (error: Exception?) -> Unit (error is null on success). Access user, theme, navigation, modules.nutrition after connect.

Initialize (non-suspend)

AzeooSDK.initialize(
context = context,
apiKey = "your-sdk-api-key",
config = config,
theme = themeConfig,
deepLinks = deepLinkConfig,
safeArea = safeAreaConfig,
callback = { error ->
// error == null -> SDK initialized (use AzeooSDK.shared)
}
)

AzeooClient (legacy / internal)

Legacy internal API (not exposed in the current public Android wrapper). Use AzeooSDK.initialize + AzeooSDK.shared.connectUser + AzeooSDK.shared.modules.* instead.

Properties

  • apiKey: String - The API key used for initialization
  • subscriptions: List<String> - List of active subscriptions
  • isAuthenticated: Boolean - Authentication status

Methods

suspend fun validateApiKey(): Boolean

Validates the API key with the server.

AzeooUser (access profile via AzeooSDK.shared.user)

User management and profile operations (available on AzeooSDK.shared.user after connectUser).

Initialization

class AzeooUser(
client: AzeooClient,
userId: String
)

Methods

suspend fun logout()

Logs out the current user and clears user-specific data.

suspend fun changeHeight(height: Double)

Updates the user's height.

suspend fun changeWeight(weight: Double)

Updates the user's weight.

suspend fun getProfile(): UserProfile

Retrieves the user's profile information.

suspend fun getToken(): String

Gets the current authentication token.

suspend fun update(data: Map<String, Any>)

Updates user information.

suspend fun delete()

Deletes the user account.

AzeooUI (legacy / internal)

Legacy UI / v1-style APIs. In the current Android wrapper, use AzeooSDK.shared.modules.nutrition.

Initialization

fun initialize(
client: AzeooClient,
config: SDKConfig,
callback: (Error?) -> Unit
)

Instance Access

val instance: AzeooUI?

Nutrition Module

val nutrition: NutritionModule

Methods

fun showHome(callback: (Result<Unit>) -> Unit = {})

Shows the main nutrition screen.

fun showPlans(callback: (Result<Unit>) -> Unit = {})

Shows the nutrition plans screen.

fun showPlan(planId: String, callback: (Result<Unit>) -> Unit = {})

Shows a specific nutrition plan.

fun getUserPlanData(callback: (Result<Map<String?, Any?>?>) -> Unit)

Fetches user nutrition plan data.

fun showRecipes(callback: (Result<Unit>) -> Unit = {})

Shows the recipes screen.

fun showRecipe(
recipeId: Long,
recipeName: String? = null,
callback: (Result<Unit>) -> Unit = {},
)

Shows a specific recipe.

fun showScanner(callback: (Result<Unit>) -> Unit = {})

Shows the barcode scanner.

fun showMobileScanner(callback: (Result<Unit>) -> Unit = {})

Shows the mobile scanner.

fun showCart(callback: (Result<Unit>) -> Unit = {})

Shows the shopping cart.

fun showSearch(callback: (Result<Unit>) -> Unit = {})

Shows the nutrition search screen.

fun showAddSelection(callback: (Result<Unit>) -> Unit = {})

Shows the add selection screen.

fun showAddFood(callback: (Result<Unit>) -> Unit = {})

Shows the add food screen.

fun showAddMeal(callback: (Result<Unit>) -> Unit = {})

Shows the add meal screen.

Theme Management

AzeooSDK.shared.theme.setPrimaryColor(color: Long, callback: (Result<Unit>) -> Unit)

Changes the primary color (light/dark) and applies it to the SDK theme.

AzeooSDK.shared.theme.setLightMode(callback: (Result<Unit>) -> Unit)

Sets theme mode to light.

AzeooSDK.shared.theme.setDarkMode(callback: (Result<Unit>) -> Unit)

Sets theme mode to dark.

AzeooSDK.shared.theme.setSystemMode(callback: (Result<Unit>) -> Unit)

Sets theme mode to follow system setting.

AzeooSDK.shared.theme.toggleMode(callback: (Result<Unit>) -> Unit)

Toggles between light and dark theme modes.

Reset

AzeooSDK.shared.disconnect { error ->
// error == null -> disconnected
}
AzeooSDK.shared.dispose()

Disconnects the current user session (SDK stays initialized unless you call dispose()).

SDKConfig Builder

Configuration builder for SDK initialization.

class SDKConfig {
class Builder {
fun setUserId(id: String): Builder
fun setAuthToken(token: String): Builder
fun setLocale(locale: String): Builder
fun setAnalyticsEnabled(enabled: Boolean): Builder
fun setOfflineSupport(enabled: Boolean): Builder
fun setTheme(theme: ThemeConfig): Builder
fun setSafeArea(safeArea: SafeAreaConfig): Builder
fun setDeepLinkConfig(config: DeepLinkConfig): Builder
fun build(): SDKConfig
}
}

Error Types

sealed class AzeooSDKError : Exception() {
object InvalidApiKey : AzeooSDKError()
object NetworkError : AzeooSDKError()
object InitializationError : AzeooSDKError()
object AuthenticationError : AzeooSDKError()
object ConfigurationError : AzeooSDKError()
}

Next Steps