> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/server-side/sdks/android/android/migration.md).

# Migration to v4.X

## Overview

This guide will assist developers to move from Flagship 3.X to Flagship 4.X.

The main breaking changes are:

* Général implementation
* SDK Status
* Visitor consent
* Get Flag value

See the full change log on [Github](https://docs.developers.flagship.io/docs/ios-sdk).

\\

## Changes

\\

### SDK Status

Flagship SDK statuses have been renamed or changed:

| 4.X              | 3.X                | Description                                                                                                             |
| ---------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| NOT\_INITIALIZED | NOT\_\_INITIALIZED | Flagship SDK has not been started or initialized successfully.                                                          |
| INITIALIZING     | STARTING           | Flagship SDK is initializing.                                                                                           |
| INITIALIZING     | POLLING            | Flagship SDK has been started successfully but is still polling campaigns.                                              |
| PANIC            | PANIC              | Flagship SDK is ready but is running in Panic mode: All features are disabled except the one which refresh this status. |
| INITIALIZED      | READY              | Flagship SDK is ready to use.                                                                                           |

\\

Flagship status listener have been renamed accordingly:

\\

```kotlin
val config = FlagshipConfig.Bucketing()
	.withFlagshipStatusListener { flagshipStatus ->
    //use status
  })
```

```kotlin
val config = FlagshipConfig.Bucketing()
	.withFlagshipStatusListener { flagshipStatus ->
    //use status
  })
```

\\

### Visitor consent

The Flagship **`newVisitor`** method now takes `consent` as mandatory parameter.

*Example*:

```kotlin
 val visitor = Flagship.newVisitor("visitor_id", true).build()
```

```kotlin
 val visitor = Flagship.newVisitor("visitor_id").build()
```

\\

### Get flag value

In version 4.X, the approach to setting a flag's default value has been modified. The default value is no longer set using the [getFlag](doc:android-reference#getflag-method) method of visitor instance. Instead, it is now set using the [getValue](doc:android-reference#getvalue-method) of [flag](doc:android-reference#ifsflag-interface) instance.

\\

```kotlin
val flag = fsVisitor.getFlag("myFlagKey")
val flagValue = flag.value("myDefaultValue")
```

```kotlin
val flag = fsVisitor.getFlag("myFlagKey", "myDefaultValue")
val flagValue = flag.value()
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.abtasty.com/server-side/sdks/android/android/migration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
