Android SDK for integrating bandwidth sharing into your app. Users earn money by sharing their unused mobile bandwidth while you earn proxy credits.
The Android SDK is one of several ways to join the Peer Network. See Other Integration Paths below for Node.js, Go/Linux and Windows clients, including notes for container deployments.
implementation("com.github.bolivian-peru:android-peer-sdk:v1.3.2")v1.3.2 (2026-09-02) fixes three things every integrator hit:
- Status never reached
CONNECTED. The library setCONNECTINGonstart()and nothing moved it afterwards, so every app built ononStatusChangeshowed "Connecting…" while the device was registered, probed and serving traffic. The foreground service now reportsCONNECTEDwhen the relay socket opens andCONNECTINGagain while it reconnects.- Earnings, wallet and payout calls were rejected (401). Those endpoints require the device JWT issued at registration; the library sent only the farmer API key, or nothing, so
getEarnings()/getDetailedEarnings()returned zeros. They now sendAuthorization: Bearer <device token>. (The backend also accepts the registeringX-API-Keyfor the device it registered, so 1.3.1 apps get real numbers on manual refresh without an update.)- Token refresh hit a route that does not exist. The library issued
GET /peer/token/{id}(404) and re-registered on every launch. It now stores the refresh token and callsPOST /peer/token/{id}/refresh, re-registering only when the backend rejects it. Earnings polling also waits until the device is registered instead of calling/devices/null/earnings.v1.3.1 delivered fast, full-throughput bandwidth sharing. Four things make it fast:
- Full-throughput tunnels — the SDK signals
tunnel_connectedthe instant its outbound socket opens, so the relay streams the customer's traffic immediately instead of stalling on the TLS handshake. This is what lets a device serve traffic at its real uplink speed.- Nearest-relay routing — the
/peer/registerresponse carries arelayfield; the SDK connects to the geographically nearest relay (US/LATAM →wss://relay-us.proxies.sx, everyone else →wss://relay.proxies.sx) and honors runtimerelay_redirect, so no device tunnels across an ocean. Guards: only*.proxies.sxwss targets are honored, a 60s anti-flap interval applies, and an explicitConfig.relayUrlpin disables redirects.- Binary tunnel protocol + compression — minimal CPU and per-frame overhead.
- Encrypted credential storage — AES-256-GCM via Android Keystore.
API surface:
ProxiesPeerSDK.init / start / stop / getEarnings. Relay routing is fully automatic —Config.relayUrlis optional (leave unset to geo-route).
Add JitPack to your root build.gradle.kts (or settings.gradle.kts):
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}Or in Groovy (build.gradle):
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}In your app's build.gradle.kts:
dependencies {
implementation("com.github.bolivian-peru:android-peer-sdk:v1.3.2")
}Or in Groovy:
dependencies {
implementation 'com.github.bolivian-peru:android-peer-sdk:v1.3.2'
}// In your Application class or main Activity
import sx.proxies.peer.ProxiesPeerSDK
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
ProxiesPeerSDK.init(
context = this,
apiKey = "psx_your_api_key", // Get from farmer.proxies.sx > Account > API Keys
config = ProxiesPeerSDK.Config(
userId = "optional-user-id", // Link to your user system
onStatusChange = { status ->
Log.d("ProxiesSDK", "Status: $status")
},
onEarningsUpdate = { earnings ->
Log.d("ProxiesSDK", "Earned: $${earnings.totalEarnedCents / 100.0}")
}
)
)
}
}The apiKey (format: psx_...) auto-links the device to your farmer account. After signing in to your farmer dashboard, your devices appear under the Peers page immediately after connecting. (The /peers page requires login; for public peer-network info and the agent skill file see https://agents.proxies.sx/peer/.)
val sdk = ProxiesPeerSDK.getInstance()
// Start sharing (runs as foreground service)
sdk.start()
// Stop sharing
sdk.stop()
// Check status
val isRunning = sdk.isRunning()lifecycleScope.launch {
val earnings = sdk.getEarnings()
println("Total earned: $${earnings.totalEarnedCents / 100.0}")
println("Traffic shared: ${earnings.totalTrafficMB} MB")
}Once your device is connected, manage it from the farmer dashboard:
- farmer.proxies.sx → Peers (sign in first) — See all your devices, status, IP type, country, ISP, traffic, earnings
- Auto-listing — Healthy, verified, online devices are listed in the pool gateway automatically. You can also toggle "Listed for Sale" per device, and enable/disable auto-listing for your account.
- Automated verification — System checks IP quality, ISP legitimacy, VPN/proxy detection, GeoIP match
- Quality score — Each device gets a 0-100 score; verified devices serve customer traffic and earn more
| Check | Requirement |
|---|---|
| IP Type | Must be residential or mobile |
| ISP/ASN | Checked against datacenter and VPN databases |
| GeoIP | Country must match claimed location |
| Uptime | Minimum 1 hour online |
| Quality | Score must be >= 50/100 |
The v1.3.2 library does not implement SDK-side airplane-mode rotation. The classes AirplaneModeAccessibilityService, IPRotationManager and the methods sdk.rotateIP(), sdk.isIPRotationAvailable(), sdk.rotateIPAsync(), sdk.openIPRotationSettings() are not present in the artifact — earlier README revisions documented them in error.
Use the methods shipped in the tagged Android library. For other clients, check the rotation capability documented for that device type.
The SDK automatically adds these permissions via manifest merge:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.WAKE_LOCK" />Note: For Android 13+, you'll need to request POST_NOTIFICATIONS permission at runtime.
- When the app is in the background
- When the device is charging
- When connected to mobile data (more valuable than WiFi)
- During idle periods in games or apps
Always obtain clear user consent before enabling bandwidth sharing:
// Show consent dialog first
AlertDialog.Builder(this)
.setTitle("Earn Money")
.setMessage("Share your unused bandwidth to earn rewards. You control when sharing happens.")
.setPositiveButton("Enable") { _, _ ->
sdk.start()
}
.setNegativeButton("Later", null)
.show()The SDK uses minimal resources and runs as a foreground service with a persistent notification. Users can see their sharing status at all times.
Your device's exit IP and identifiers are never publicly enumerable through the Proxies.sx API. Specifically:
- The previously-public
GET /v1/peer/board,/v1/peer/proxy/credentials,/v1/peer/proxy/devices,/v1/peer/stats/online, andrelay.proxies.sx/healthendpoints have all been locked to admin-only authentication. - Customer-facing endpoints (
gw.proxies.sx:7000/:7001,/v1/gateway/pool/availability) expose aggregate counts only — never per-device IPs or carriers. - Credentials persisted on your device are AES-256-GCM encrypted via Android Keystore (
androidx.security:security-crypto) since v1.1.4. - Refresh tokens, wallet addresses, and your developer API key are stripped from any admin-side debug response.
This means anti-bot vendors (DataDome, PerimeterX, Cloudflare Bot Manager, Akamai) cannot pre-emptively blacklist your device by scraping our pool listing — a common failure mode for shared-proxy networks. Your IP enters the customer routing pipeline cold, not on a public reputation feed.
Earnings are tiered by IP type — mobile IPs earn the most:
| IP Type | Rate Tier | Examples |
|---|---|---|
| Mobile | Highest | AT&T, Verizon, T-Mobile, Vodafone |
| Residential | Mid | Comcast, Spectrum, Cox, BT |
| Datacenter | Base | AWS, GCP, Azure, VPNs |
IP type is classified server-side via ASN lookup. Earnings accumulate per-GB and are paid out in USDC on Solana. Minimum payout: $5.
| Method | Description |
|---|---|
init(context, apiKey, config) |
Initialize SDK (call once) |
getInstance() |
Get SDK instance |
start() |
Start sharing service |
stop() |
Stop sharing service |
isRunning() |
Check if service is running |
getStatus() |
Get current status enum |
getEarnings() |
Get earnings (suspend function) |
| Status | Description |
|---|---|
STOPPED |
Service not running |
CONNECTING |
Connecting to relay server |
CONNECTED |
Active and sharing bandwidth |
ERROR |
Connection error (check logs) |
ProxiesPeerSDK.Config(
// Link earnings to your user system
userId = "user-123",
// Status change callback
onStatusChange = { status -> },
// Earnings update callback
onEarningsUpdate = { earnings -> },
// Operator relay pin (optional). Leave unset to let the platform
// geo-route this device to the nearest relay and migrate it at runtime.
// Set this ONLY to force a specific relay (disables geo-routing).
relayUrl = "wss://relay.proxies.sx",
// Maximum bandwidth to share (MB per hour)
maxBandwidthMBPerHour = 100,
// Only share when charging
onlyWhenCharging = false,
// Only share on mobile data (not WiFi)
mobileDataOnly = true
)The Android SDK is best for mobile apps. For other environments, use these alternatives:
Choose the Android integration guide for the SDK in this repository. Other operating systems have independently versioned clients and release checks.
| Client | Installation |
|---|---|
| Node.js | Use the reference client linked from the peer installation guide. |
| Go / Linux | The Linux guide covers architecture-specific packages, checksums, the service installer and source builds. |
| Windows | The peer installation guide links to the versioned Windows Node ZIP and checksum. Extract it and follow its setup instructions. |
For container deployments, build from a documented reference client. Configure the SDK key at runtime and preserve the saved device identity across container restarts. A successful relay connection confirms admission. Inventory and earnings depend on listing and customer traffic.
AI agents register programmatically:
curl -X POST https://api.proxies.sx/v1/peer/agents/register \
-H "Content-Type: application/json" \
-d '{"name":"my-agent","type":"claude","apiKey":"psx_your_key"}'Full API reference: agents.proxies.sx/peer/skill.md
See the /app module for a complete sample application demonstrating:
- SDK initialization
- Start/stop sharing
- Displaying earnings
- Handling status changes
- Foreground notification
If you use ProGuard/R8, the SDK includes consumer ProGuard rules automatically. No additional configuration needed.
Your app is built against 1.3.1 or older: that library never emitted CONNECTED. Rebuild against 1.3.2 (no code change on your side). The device itself was working the whole time.
Same cause and same fix: the 1.3.1 library did not send the device token on the earnings endpoints. Until you rebuild, tapping a manual refresh that calls getEarnings() returns real numbers on backends deployed after 2026-09-02.
- Check internet connectivity
- Verify API key is correct (format:
psx_...) - Check if VPN is blocking WebSocket connections
- Disable battery optimization for your app
- On MIUI/EMUI, add app to protected apps list
- Earnings depend on traffic demand in user's region
- Mobile data connections are more valuable than WiFi
- Peak hours have higher demand
- List your device for sale in the farmer dashboard to serve customer traffic
- Make sure you're using an API key (
psx_...) from your farmer account - The
apiKeyininit()auto-links the device — without it, the device registers but isn't linked to your account
| Resource | URL |
|---|---|
| Farmer Dashboard (login required) | https://farmer.proxies.sx → Peers |
| Peer Landing Page (public) | https://agents.proxies.sx/peer/ |
| AI Agent Skill File | https://agents.proxies.sx/peer/skill.md |
| Register endpoint (POST) | https://api.proxies.sx/v1/peer/agents/register |
| API Docs (Swagger) | https://api.proxies.sx/docs/api |
| MCP Server | https://www.npmjs.com/package/@proxies-sx/mcp-server |
- Telegram: https://t.me/proxies_sx
- GitHub Issues: https://github.com/bolivian-peru/android-peer-sdk/issues
MIT License - See LICENSE for details.