# Methods

The following shows the methods provided by the Wepin widget Android SDK.

## `openWidget`

The <mark style="color:blue;">`openWidget`</mark> method shows the widget window. The screen displayed in the widget window varies depending on the user's login status. If a user is not logged in, the login screen is displayed.

### Example

```javascript
wepin.openWidget()
```

## `closeWidget`

The <mark style="color:blue;">`closeWidget`</mark> method closes the widget window. Closing the window does not log users out.

### Example

```javascript
wepin.closeWidget()
```

## `getAccounts`

The <mark style="color:blue;">`getAccounts`</mark> method returns user accounts of the networks available in the app. The returned value is an array of <mark style="color:blue;">`Account`</mark> object. <mark style="color:blue;">`getAccounts`</mark> is a method available after widget login.

```java
List<Account> accounts = wepin.getAccounts();
```

### `Account`

The interface of the class returned by the <mark style="color:blue;">`getAccounts`</mark> function is as follows.

```java
public class Account {
    String address;  // The account address
    String network;  // The blockchain network of the account
}
```

* **`address`:** *string*\
  The account address
* **`network`**: *string*\
  The blockchain network of the account. The name of each network can be found below.

{% content-ref url="/pages/c58QTBKZd8FibB8m3Pc4" %}
[Supported blockchains](/en/wepin/supported-blockchains.md)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://docs.wepin.io/en/deprecated/android-java-and-kotlin-sdk/method.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
