DEV Community

Mobile dApp developer
Mobile dApp developer

Posted on

Solana in Your Pocket: Create a Mobile dApp with Wallet Login & Token Transfers using React Native Expo

"If you’ve ever wanted to put Solana in the palm of your hand, this tutorial is for you".

We’ll be building a decentralized mobile app (dApp) using React Native + Expo CLI, where users can:

  • Log in with their Solana wallet
  • Receive and send SOL
  • Sign messages
  • View their wallet balance in real time

The goal is to keep things practical and beginner-friendly, so even if you’re new to Solana dApp development using React Native, you’ll be able to follow along. By the end, you’ll have a working mobile dApp that runs directly on your physical device or virtual device using a development build generated locally or using eas.

Let’s dive in and start building Web3 experiences that actually fit in your pocket.

Prerequisites:

1️⃣ Project Setup: To create a new project, run the following command

npm create solana-dapp@latest 
Enter fullscreen mode Exit fullscreen mode

Select the solana mobile template
Vscode terminal

Select any one of your choice; I'll be going with the web3js-expo
web3js-expo

After the template is done cloning; in your terminal, type:

cd [project-name] 
Enter fullscreen mode Exit fullscreen mode

install all packages

yarn install 
Enter fullscreen mode Exit fullscreen mode

2️⃣ Generate development Build:
There are two ways of generating a development build:

  1. Using eas
  2. Local build on your machine

Using eas to generate a development build is the easiest way, but when using free tier on eas, there's limit to the number of builds you can generate monthly, and with time, your build waits in queue for up to 3 hours before building starts. So with this I'll be showing you how to generate development build locally, which takes a bit longer process than eas, but faster!
Building locally on your laptop can work if you are using either a virtual device from android studio or your physical device.

To get started, open your project on your terminal, and type:

npx expo install expo-dev-client 
Enter fullscreen mode Exit fullscreen mode

Next is to generate your native android folder, but before doing this , make whatever changes you want to make to the app settings in the app.json file, then type

npx expo prebuild 
Enter fullscreen mode Exit fullscreen mode

Now your android folder has been generated!

Android Folder

Open your android studio, click more options, click sdk manager
Android Studio Image
Ensure the ticked sdk tools below are installed (latest version) on your android studio

Sdk Tools

Create a Virtual device under the virtual device manager (if you want to use virtual device to simulate your development build)

Virtual device manager
If you are using your physical device instead, connect your phone to your laptop using USB device, and make sure you have android debugging enabled.

Head over to your code editor, and check if you have your device connected (this works for both physical and virtual device), open the terminal and type:

adb devices 
Enter fullscreen mode Exit fullscreen mode

The output should be similar to this:

Adb Devices
Ensure your physical device is connected through out the process
Finally, in your terminal, type:

npx expo run:android 
Enter fullscreen mode Exit fullscreen mode

And watch it run, install to your device and open the application.

And that’s it, you’ve just built a fully functional Solana mobile dApp with React Native and Expo.

With the development client, you can:

  • Connect and authenticate with a Solana wallet
  • View balances in real time
  • Send and receive SOL
  • Sign messages securely
  • Run everything directly on a physical device or virtual device, using eas or locally

This is just the beginning. From here, you could extend your dApp with NFTs, token swaps, DeFi integrations, or even a full-fledged Web3 game. The building blocks are all in your hands.

If this tutorial helped you, drop a ❤️, share it with your fellow builders, and let me know what feature you’d like me to cover next. Let’s keep pushing the limits of what’s possible with Web3 + mobile.

Top comments (0)