Giter Site home page Giter Site logo

prepaidbalance's Introduction

Prepaid balance

Build App CodeFactor Crowdin

This app keeps track of your prepaid balance. It can automatically record it and post a notification if your balance drops under a configurable threshold. It does so by parsing the response of a USSD code, that can be set in the settings.

Get it on F-DroidDownload from GitHub

Screenshot

Maintenance notice

From my point of view this app is feature complete. I probably won't add new major features on my own, but I will:

  • Keep dependencies up-to-date
  • Merge new translations
  • Fix bugs
  • Review and merge PRs, even for new features

Translations

App strings and the app store description can be translated via Crowdin: https://crowdin.com/project/prepaidbalance

Translations have to be approved before being merged into the app. To become a translator with approval rights or to request a new language, please poke me on Crowdin or open an issue here on GitHub.

Troubleshooting

You might run into on of these issues with the app:

  • The USSD code is different than the default. In this case please configure the correct one and open an issue, so I can change the default code for your provider.
  • Your provider doesn't provide a USSD code to query your prepaid balance. In this case you cannot use this app.
  • The USSD code to query the balance is "menu based", i.e. if you enter it in the dialer app, you get a menu. See this issue for more details.
  • Depending on the response pattern the parsing might fail. In this case please open an issue.

Development

Fix parsing of an USSD code response

  • Add a new Matcher to MATCHERS in ReponseParser.kt
  • Add your USSD code to testGetBalance() in ResponseParserTest.kt
  • Check if all test succeed

Android permissions

  • CALL_PHONE: Used to query USSD codes.
  • POST_NOTIFICATIONS: Used to display notifications about your balance.
  • ACCESS_NETWORK_STATE, RECEIVE_BOOT_COMPLETED, FOREGROUND_SERVICE, WAKE_LOCK: Used by WorkManager to ensure work constraints are met and running workers aren't killed.

Credits

prepaidbalance's People

Contributors

dependabot[bot] avatar devendra34 avatar drmaxnix avatar imgbot[bot] avatar jensbin avatar mueller-ma avatar ohior avatar robho avatar sguinetti avatar snaik20 avatar tgo1014 avatar thepbone avatar yoobi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prepaidbalance's Issues

No notifications are shown

Android 13 requires a new permission before notifications are shown. This permission must be requested by Prepaid Balance.

information about its version

the program has no information about its version and there is no link to the source site, there is no author and there is no way of feedback.

add more information for the convenience of users.

Unable to get balance from response - Sunrise Switzerland

Hey
I get the error message "Unabe to get balance from response" when I try to use the app. I entered the right USSD Code (*121#). I assume that my provider isn't in the parser yet. The details are as following:

Cellphone provider: Sunrise
Country: Switzerland
USSD Code: *121#
MCC/MNC: 228/2
Answer when dialing USSD code: Ihr Guthaben beträgt CHF 24.50.

I hope this helps. If anymore details are needed, don't hesitate to ask.
Best regards

Add support for Globe Telecom

Describe the bug
I'd like to see support added for Globe Telecom in the Philippines, please. They use the USSD code *143#.

Device (please complete the following information):

  • Device: Realme C3
  • Android version: 12.1
  • MCC and MNC (Shown in settings):
    MCC: 515
    MNC: 2
    Last request failed with code -1

[Thailand] TrueMove-H

Cellphone provider and Country
Carrier name: Truemove-H
Country: Thailand
MMC: 520
MNC: 65535 (but maybe 00 ?)

Actual USSD answer

คุณมี xx.yy บ. ถึง dd/mm/yyyy

Additional notes
The *123 is use for refill balance with *123*{cardnumber}# pattern, but an actual balance check number is #123#, the app said USSD code must begin with *, so this app will fail for this carrier.

showing balance changes since the last check

Is your feature request related to a problem? Please describe.
I want to see not only the balance but also how much it has changed since the last check

Describe the solution you'd like
next to the balance value, it shows the balance change in a different color (red decrease, green addition of balance):

81.00    -0.6      20.06.2022 20:17
81.60   +30.0      20.06.2022 19:10
51.60    -0.4      20.06.2022 18:30
52.00    -1.5      20.06.2022 17:20
53.50              20.06.2022 16:53


USSD Sub-Menu

My Provider - Boost Mobile Australia; 505 1
Only supports accessing balance using #100# and then choosing option 3 from the USSD menu.

Would it be possible to support this sub-menu configuration within this app?

Thanks!

Failed to request ussd code

Describe the bug
Failed to request USSD Code

To Reproduce
Steps to reproduce the behavior:

  1. Set *101# for my ussd code
  2. pull down screen
  3. a toast appears with the message "Failed to request USSD Code"

Expected behavior
that my current balance is displayed

Screenshots
IMG_20210613_174640.jpg

Device (please complete the following information):

  • Device: Oneplus 7 Pro
  • Android version: 11
  • MCC and MNC (Shown in settings): 262 07
    All permissions are granted.

Display all entries in MainActivity

Is your feature request related to a problem? Please describe.
Currently MainActivity only displays the entries from the last 12 months. This is done to avoid performance issues.

Describe the solution you'd like
When scrolling to the bottom, load older values on the fly.

custom balance refresh rate

It appears now that the app checks twice a day if you have periodic check enabled, it would be nice if the user could set the refresh time 4x a day to maybe once every 2 weeks.

support 2 sim cards

Is your feature request related to a problem? Please describe.
the phone has 2 different SIM cards. there are different USSD balance request codes for cards.

Describe the solution you'd like
add the ability to work with two different SIM cards. specify different USSD codes.

support Android 6+

A lot of older Android devices never got updates past Android 6 or 7 either from the oem or from custom ROM developers fire many reasons, but many many of these older devices are being used by those with limited funds like the elderly and students. Also many of those people are also on pre paid plans..

Is there any reason why the app could not be made compatible with Android 6 and newer? Or at least Android 7 or 7.1

Translations

The app strings and the description for F-Droid could be translated to a few more languages. See "Translations" in the Readme for more information.

Parsing fails for Vodafone Germany

Cellphone provider and Country

  • Vodafone
  • Germany

Actual USSD answer

Aktuelles Guthaben: XX,XX EUR
Wähl bitte aus:
1 Aufladen
2 Guthaben & Verbrauch
3  Tarife & Optionen
4 Spracheinstellungen
5 Vorteilsangebot

Additional notes

Tasker integration

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
I would like to have integration with Tasker.
This would allow custom triggers for checking account balance.
Also, the response could be returned to Tasker for further processing (for purposes such as widgets, notifications etc.)

Support more than one USSD code

Is your feature request related to a problem? Please describe.
My operator provides two separate codes. One is using to get balance in $$$ (*111#), the second one shows me the number of MB is left (*121#)
There is no way to combine it.

Describe the solution you'd like
Something like +sign (icon) to add one more USSD code

Describe alternatives you've considered
Just finding your app and find it pretty useful.

Additional context
Well, that's all I think

Show reponse in error messages

Describe the bug
Sometimes my provider responds with "Request temporary not available".

Expected behavior
This message should be shown in the error snackbar and notification.

balance expiry date notification

it would be great if the app also got the expiry date and had the option for a notification for a set time before the expiry

Preferably a user set notification days weeks and repeating for the notification

Parsing failing for O2 UK

Provider details
MCC: 234
MNC: 10

USSD:
O2: Your balance is £6.45. Text BALANCE free to 20202 to check your remaining tariff and Bolt On allowances.

Thanks for your work!

Polish Plus network support

Describe the bug
Balance is incorrectly parsed when on Polish Plus network. Instead phone number is shown as balance.

To Reproduce
Steps to reproduce the behavior:

  1. Refresh balance

Expected behavior
Actual account balance is shown in app.

Device (please complete the following information):

  • MCC and MNC (Shown in settings): 260 1

Additional context
USSD response: Aktualny stan konta dla numeru 48123456789: 1,23 PLN. Konto wazne do dnia 01-01-2022 01:02:03.Doladuj PLUSem!

I've modified source to add this matcher on first place (and it works), but I don't know if it's behaving correctly with other ones:
Matcher("^(.*?)((\\d)+\\.(\\d){1,2}) PLN(.*?)\$".toRegex(), 2),

battery usage issue

I recently added this to my s7 edge running Android 11.
The phone is for emergency use only so sits for days at a time.
Before the app the device was using 0.21% an hour after i installed and set up prepaid balance app it went up to 1.02% an hour. Which is 5x more, which is a bit much for 2 text a day.i uninstalled the app and it went back down to 0.2% an hour.

Regex parsing / Display only account balance

Is your feature request related to a problem? Please describe.
My Provider adds many useless characters to the USSD response, which makes it cluttered.

Describe the solution you'd like
I would like to be able to configure a regular expression to parse the USSD answer with.

Describe alternatives you've considered
Automatically (probably using a regular expression) parse the repose to find the exact account balance - display only digits.

Enable Minification

The app is quite large for a seemingly small functionality. I think it would be worth to enable minificatiojln with proguars/r8.

App doesn't work with my device/provider

Hi there,

thank you for this app, I stumbled upon it on F-Droid and I have been looking for something like this for some time. However, it doesn't work with my device, so I hope, it's easily fixable (Version 1.8 from F-Droid).

How to reproduce

  • I entered the USSD code of my provider in the settings (*106#, Lidl Connect, Germany, Vodafone network)
  • I swiped down as requested. An error message appears: "Auslesen des Guthabens fehlgeschlagen. Dieser Dienst steht in Ihrem Tarif nicht zur Verfügung". However, if I dial the above mentioned USSD code manually, my balance is shown correctly. See the screenshot:

Screenshot

Device (please complete the following information):

  • Device: Realme 8 Pro, most recent firmware. Both SIM slots used, but configured to use a dedicated SIM (this Lidl Connect one) for outgoing phone calls
  • Android version: 12
  • MCC: 262
  • MNC: 7

showing statistics for the month and year

Is your feature request related to a problem? Please describe.
I need to know the expenses for the month and year

Describe the solution you'd like
I ask you to make it possible to visually view the statistics of spending for the month and for the year. It is advisable to choose dates and years when to view statistics. the simplest option is to show in the form of a graph the costs by month for the last whole year for 12 months. And be able to choose the year to view.
the red column is the expense, the green one is the arrival of money this month.

expm

711 speakout Canada used code

7-11 Speak out Canada ussd code for prepaid balance is *777#
And the response is

"Your account balance is $20.00 and expires on Aug 28 2021."

(Set it manually and everything works good, like the app)

US - Tmobile response

Currently Tmobile US response after parsing show balance as month(eg 8) instead of actual balance.

Here is full response if it helps:

Current plan active until 08/10/2022 and will renew for $15.00. Account Balance $15.00. Add money by dialing *233 or redeem a refill card.

Invalid ussd code

The correct ussd code for my network is *123*8*2#

The regex for validation doesn't seem to allow for that.

fun String.isValidUssdCode() = matches("^([*#][*#]?)(\\d)+([*#][*#]?)$".toRegex())

Additionally, and I'm not sure how to fix this, but i tried running a normal ussd code in the app, but it says "failed to request ussd code". It has phone permission, so I don't know what's wrong.

I'd be happy to collect more information to fix this.

It's on a Samsung note 20 with stock firmware, if that helps.

Thanks for making this otherwise nice app!

Notification limit for used credits in a day

Is your feature request related to a problem? Please describe.
Sometimes a data package I buy runs out without me realising it. Then my phone uses credits directly, using them up quickly.

Describe the solution you'd like
When I could set a limit for used credits in a certain time (1 day, ...), this could help to see the problem early. (Being able to set the interval of requesting the credit could help even further.)

Describe alternatives you've considered
I currently set the limit a bit lower than my balance. I have to adapt this value each time I buy a package or load credits.

Additional context
The balance of used credits could be enabled and set in the settings, similar to the (absolute) limit.

Scrabbing error.

Don't know if I should create new issue or reopen another with same problem: #11

Describe the bug
Main function doesnt work. Error appear on extracting data.

To Reproduce

  1. Turn on your phone
  2. Install the app
  3. Open app
  4. Enter your USSD in app settings: "*133#"
  5. "swipe down",
  6. wait, after 5 seconds error message appear: "Failed to receive USSD code".
  7. wait, after 1 minute appear system error, like: "Network problem, or wrong MMI code"

Expected behavior
See scrabed data, instead of error message.

Screenshots
Screenshot_20220522-082831_Prepaid Balance
Screenshot_20220522-082815_Prepaid Balance
Screenshot_20220522-082728_Prepaid Balance

Device:
Phone: Samsung s21+
Android: 12
MCC: 259
MNC: 1

Additional context
Last error for V 1.5: "Last request failed to complete"
Last error for previous app version was like: ...-1...

downgrade android version

now the minimum version for work is android 8. I ask you to downgrade the android version to at least version 6. there are a lot of people who use old devices, including me.

I am sure it is possible to do this because the program is very simple and does not strictly require the presence of android 8. I think even on android 4 you can run your program.

Select sim card for ussd code

De app chooses the wrong SIM card for checking the prepaid Balance using the ussd code.

To Reproduce
Steps to reproduce the behavior:
Install the app and enter the ussd code that is needed to check the prepaid Balance.
If there are two SIM cards the app will give an error when reading the prepaid Balance is triggered
If I remove the SIM card that is not supported with USSD than the app will choose the right SIM card. If I enter the Second SIM card again then the app chooses the wrong SIM card again.

Expected behavior
I would like that we app gives you a choice for the sim card to use the ussd code with.

Screenshots
I don't have a screenshot.

Device (please complete the following information):

  • Device: Nokia X10
  • Android version: 12
  • MCC and MNC (Shown in settings):
  • MCC: 204
  • MNC: 16 should be 8

Additional context
I tried to install the app with only the right SIM card in the phone. That works until I put the second SIM card in the phone again.

Parsing of balance for O2 (UK) fails

Describe the bug
The balance for O2 within the UK is not parsed correctly.

To Reproduce
Run USSD.
Balance is reported incorrectly.

Expected behavior
Balance is parsed correctly.

Screenshots
Screenshot_2022-10-13-08-48-40-495_com github muellerma prepaidbalance

Device (please complete the following information):
Xiaomi Note 9

MCC: 234
MNC: 10

Balance is reported as 2.00 for the response:

O2: Your balance is £9.58. Text BALANCE free to 20202 to check your remaining tariff and Bolt On allowances.

Additional context
Add any other context about the problem here.

ussd code for Djibouti Telecom is *168#

Describe the bug
The ussd code for Djibouti Telecom is *168#.

No problem to set it manually. But you write this shall be reported.

Device (please complete the following information):

  • Device:
  • Android version:
  • MCC and MNC (Shown in settings):
    MCC: 638
    MNC: 1

Special USSD string showing multiple sub-balances

Describe the bug
When you're on "Kaufland mobil", a german prepaid reseller, their USSD strings are a bit out of the norm, to say the least.
The string looks like this:

Dein Guthaben betraegt: 10,00 EUR Startguthaben, 0,00 EUR Kaufguthaben und 0,01 EUR Geschenkguthaben.

So it is split into multiple sub-balances, Startguthaben is the credit you get gifted for joining the carrier, Kaufguthaben is the amount you actually topped up with your own money, and Geschenkguthaben is special credits like a bonus for bringing your old phone number with you.
When there's no Startguthaben and/or Geschenkguthaben left, the respective subsection disappears from the USSD response.
For example, when you received no Geschenkguthaben and only have Startguthaben, it will look like this:

Dein Guthaben betraegt: 10,00 EUR Startguthaben und 0,00 EUR Kaufguthaben.

Kaufguthaben will always appear in the response.

The app currently only reads the first balance that appears in the string, so the 10,00 EUR.
I attached a screenshot which shows the situation, and also the toast notification with the USSD string at the bottom.

To Reproduce
Steps to reproduce the behavior:

  1. insert Kaufland mobil SIM card
  2. dial their USSD code, which is *144#
  3. See that the above described string appears

Expected behavior
I would expect the app to just sum up all balances it finds in the string.

Screenshots
grafik

with auto update failed attempts at ussd should retry

Right now when on auto update a failed attempt to getting the balance will leave an error in the notification window. Possibly even after a day and it updates.

On automatic The app should try a second time in 30 minutes after a failure and possibly try a third time, after which it should error out and give the time of the error. Then stop trying.
If it gets a response it should clear the error from the notification area.

keep full text of ussd response

My ussd command gives me more information other then just the credit. It would be nice if the app kept the full text as a viewable note or maybe an expanded view for each time ussd is queried.
Or maybe just an option to keep the expanded info each time the info is manually updated in the app., That would be great also.

F-Droid says: "No versions compatible with device"

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Open F-Droid
  2. Search for "Prepaid Balance"
  3. F-Droid does not display "Install" button"
  4. Scroll down to bottom to see the text "No versions compatible with device"

Expected behavior
I would expect this app to work on my phone ;)

Device (please complete the following information):

  • Device: Samsung Galaxy SII (GT-I9100)
  • Android version: 7.1.2 (LineageOS 14.1)
  • MCC and MNC (Shown in settings):

Additional context
Mostly out of curiosity is my device incompatible or is the version of Android too old?
Thanks!

Feature request: Disable data auto deletion & support data takeout/export

Thanks for this nice idea and tool.

I wonder about the data deletion after 6 months? I failed to find an option to turn this off.

My use case: In my country you can deduct 20% of you phone bills if you used your phone (partially) for tax relevant purposes.

Prepaid Balance would help me, if I could

  • collect & store my balance much longer and
  • either export them in CSV to use excel to filter the topups or at least filter them to find out the dates and amounts of my balance topups.

Nota bene: My prepaid phone contract is charged every 28 days and most usage is included. Therefore my balance is mostly static in comparison to one charged per each call.

Can we drop or allow to disable the autodeletion?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.