Unofficial Virgin Mobile widget for Android
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


img VBalance

VBalance is a simple Android application I built so that I could have a quick glance overview of my prepaid cellphone account. The official Virgin Mobile app is decent, but this one function was missing.

VBalance presents the account balance as a homescreen widget. Behind the scenes it uses the same JSON API as the VM website.

How to use it

Screen 1

  1. Choose the VBalance widget
  2. Sign in and choose the appropriate phone number
  3. Place the widget on your homescreen

How it works

I anticipated I would need to scrape the website but it turns out it uses a JSON API for the account data. After some investigating with cURL, I found the following endpoints:

  • POST
    • pass in username and password in the request
    • a successful sign in response sets a JSESSIONID cookie; use it for the subsequent requests
  • GET
    • pretty self explanatory - kills the session specified by JSESSIONID cookie
  • GET
    • include the JSESSIONID cookie
    • include the header msisdn: 48123456789, where 48123456789 is your phone number
    • this retrieves a big JSON with all the balance info you could need; the challenge now is getting the appropriate fields from the JSON


VBalance is in no way affiliated with Virgin Mobile. It's just a personal project built to solve a personal issue and as such comes with no guarantees whatsoever.