> For the complete documentation index, see [llms.txt](https://docs.netsocks.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netsocks.io/spanish/android-sdk/integracion-del-sdk/instalacion-y-uso.md).

# Instalación y uso

En este punto, debes tener a la mano tu Publisher Key, la necesitarás para inicializar el SDK.

## Inicializar SDK

{% hint style="info" %}
Recuerda que tu PUBLISHER-KEY se encuentra en el portal de netsocks. Para visualizarla haz clic en '**Añadir nueva aplicación**'. O consulta la sección [Publisher Key](/spanish/portal/publisher-key.md).
{% endhint %}

Nuestra recomendación es inicializar el SDK en la clase `Application` de la app para garantizar los mejores resultados de monetización, aunque también se puede realizar en algún `Activity` principal.

{% tabs %}
{% tab title="Java" %}

```java
NetsocksSdk.enable(this, "TU PUBLISHER KEY");
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
NetsocksSdk.enable(this, "TU PUBLISHER KEY")
```

{% endtab %}
{% endtabs %}

Inicializar el SDK de esta manera habilitará de forma automática la monetización. No es necesario realizar ninguna otra acción a menos que quieras condicionar la monetización según el consentimiento del usuario.

## Verificar si la monetización esta habilitada

Para conocer si el SDK de netsocks esta habilitado, puedes utilizar el siguiente método proporcionando el contexto ya sea de la aplicación o del activity.

{% tabs %}
{% tab title="Java" %}

```java
NetsocksSdk.isEnabled(this);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
NetsocksSdk.isEnabled(this)
```

{% endtab %}
{% endtabs %}

## Deshabilitar la monetización

En caso de que un usuario no haya otorgado su consentimiento, puedes deshabilitar la monetización utilizando el siguiente método.

{% tabs %}
{% tab title="Java" %}

```java
NetsocksSdk.disable(this);
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
NetsocksSdk.disable(this)
```

{% endtab %}
{% endtabs %}

Recuerda revisar la sección de consentimiento para obtener más información respecto a qué puedes hacer si el usuario opta por no utilizar el SDK de netsocks.


---

# 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.netsocks.io/spanish/android-sdk/integracion-del-sdk/instalacion-y-uso.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.
