Mobile Wallet Adapter (Android)
Integrate Morsel with Android dApps using the Solana Mobile Wallet Adapter protocol.
Morsel implements the Solana Mobile Wallet Adapter (MWA) protocol on Android. This allows native Android dApps to request connections, signatures, and transactions from Morsel without requiring a browser extension.
Mobile Wallet Adapter is an Android-only protocol. For iOS and web, use the Morsel Wallet Connect adapter or the window provider.
How It Works
When a dApp calls the MWA authorize or sign methods, the Android system routes the request to Morsel. Morsel shows an approval screen, and the result is returned to the dApp.
- The dApp calls MobileWalletAdapter.authorize() or a sign/send method
- Android forwards the request to the installed MWA-compatible wallet (Morsel)
- Morsel shows an approval screen with the dApp details
- The user approves — the result is returned to the dApp
Supported MWA Methods
| Method | Description |
|---|---|
| authorize | Request wallet connection and get the public key |
| reauthorize | Silently reconnect a previously authorized session |
| deauthorize | Revoke a previous authorization |
| sign_transactions | Sign one or more transactions without broadcasting |
| sign_and_send_transactions | Sign and broadcast transactions to the network |
| sign_messages | Sign arbitrary byte messages |
Integration for dApp Developers
Use the official Solana Mobile Wallet Adapter client library in your Android or React Native app:
bash
# React Native / Expo
npm install @solana-mobile/mobile-wallet-adapter-protocol
npm install @solana-mobile/mobile-wallet-adapter-protocol-web3js javascript
import { transact } from "@solana-mobile/mobile-wallet-adapter-protocol";
import { toUint8Array } from "@solana-mobile/mobile-wallet-adapter-protocol-web3js";
const authorizationResult = await transact(async (wallet) => {
const result = await wallet.authorize({
cluster: "mainnet-beta",
identity: {
name: "My dApp",
uri: "https://mydapp.com",
icon: "https://mydapp.com/icon.png",
},
});
return result;
});
console.log("Public key:", authorizationResult.accounts[0].address);Session Persistence
Morsel persists MWA authorization sessions so users do not need to re-approve every time they open your dApp. Sessions remain valid for 30 days of inactivity.
Supported Networks
- Solana Mainnet — cluster "mainnet-beta"
- Cookie Mainnet — cluster "gorbagana-mainnet"