romellfudi / voipussd Goto Github PK
View Code? Open in Web Editor NEW:octocat: 📞 IMEI (USSD) Library in Android Devices by @romellfudi
Home Page: https://romellfudi.github.io/VoIpUSSD/
License: GNU General Public License v3.0
:octocat: 📞 IMEI (USSD) Library in Android Devices by @romellfudi
Home Page: https://romellfudi.github.io/VoIpUSSD/
License: GNU General Public License v3.0
On android Oreo OnServiceConnected is only called when you toggle on accessibility service for the first time thus the app will only work once, If you want to make it work again you'll need to reboot your device or to disable accessibility and enable it again
Hi, great work here. Do you have any idea how to fix the window that flashes and disappears?
I am using OPPO Reno5.
Android version 13.
Here VoIpUSSD not working properly.
Dialing ok but feedback no given. I mean it can't send me feedback. It over or not or continue dialing.
Over method can't give me response properly on my this mobile. But on my other mobile its working fine and everything is ok
hi buddy,it would be really great if you could add support for react native apps.
what do you think? :)
My phone is 2 sim
I want call ussd by sim2 or sim1.
Hepme! thank
Hello,
Any help
we are trying to close the ussd dialog using close() after receiving the first response but it doesn't seem to work. this is our invoke method:
ussdApi.callUSSDInvoke(phoneNumber, simSlot, responseMap, new USSDController.CallbackInvoke() {
@Override
public void responseInvoke(String message) {
ussdResult += message + "\n";
Log.d(TAG, "ussd request called: " + ussdResult);
ussdApi.cancel();
}
@Override
public void over(String message) {
ussdApi.cancel();
Log.d(TAG, "ussd request error: " + ussdResult);
}
});
what might be the cause?
USSDApi ussdApi = USSDController.getInstance(context);
I tried var ussdApi : USSDApi = USSDController.instance
I am using USSDController.callUSSDInvoke(context .....
is this the way?
Can I use this library to have a USSD session based on an event without user intervention?
For example an app detects something then initiates a USSD session in the background without user intervention.
Is this the right library for it?
Hi thank you for your amazing work, I am trying to separate the message by new line but if the first line response starts with a number the responseInvoke()
ignores the first line and then continue with the following line.
Example USSD Response:
Please choose promo
1 PromoSample1
2 PromoSample2
The response above works as expected but if the USSD response's first line has a number for example:
1 PromoSample1
2 PromoSample2
responseInvoke()
will emit only "2 PromoSample2" and ignore "1 PromoSample1"
Hi , Thank you for this great package and sorry if i chose the wrong category for this issue.
I have issue with some USSD that already timed out(invalid mmi code or request timeout) but like 5seconds later the result of the USSD will appear on the screen, the result of the last USSD that is displayed on the screen(waiting for input) is however disturbing the new USSD to be dialed. Is there any way to programatically cancel any showing dialog before executing another USSD ???
Thanks
hi thanks for good work. i have problem hopefully you can help me.
when i call multi send menu it loop send 1->2->1->2
it not call to 1->2->3
thank for read my english not good
@OverRide
public void responseInvoke(String message) {
// first option list - select option 1
ussdController.send("1",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
// second option list - select option 1
ussdController.send("2",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
// opntion - select otion 2
ussdController.send("3",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
...
}
}
});
}
});
}
Hello good day, the library Simslot selection used to work perfectly in my app while the android version was 9.0. But after I updated the phone to Android 10, the phone always uses Sim slot 1 irrespective of what Sim number I choose for the ussdApi. Kindly help me resolve this issue.
Hi Can you provide a
cordova integration?
My request is just for the documentation. It's hard to install voipussd if we are a newbie in gradle as Android studio do all for us (regarding gradle)
So it will be nice perhaps to detail your documentation and explain briefly why to add each file where and how it is supposed to give an output
Additional context
Maybe describe for differents versions of android should be good. But I think it's too much complicated and unnecessary
Thanks for reading
Goo day,
This great work, is really going to help me a lot.
I need help with auto relies. The code only correctly response with the first 2 answers the loop but to the 1st and I need to set 6 answers
Opening this issue will trigger GitHub Actions to fetch the lastest version of VoIpUSSD. More information will be provided in forthcoming comments below.
third option not working
ussdApi.callUSSDInvoke("*555#", map, new USSDController.CallbackInvoke() {
@Override
public void responseInvoke(String message) {
//
ussdApi.send("4",new USSDController.CallbackMessage(){
@Override
public void responseMessage(String message) {
// second option list - select option 1
ussdApi.send("3",new USSDController.CallbackMessage(){
@Override
public void responseMessage(String message) {
//
}
});
}
});
ussdApi.cancel();
}
@Override
public void over(String message) {
}
});
Hi i was looking for a way to make silent ussd calls i found the google new telephonymanager.sendussdrequest which works fine but it doesn’t support apis lower than 27 is there anyway to make ussd requests without loading in lower apis and read the response even something like creating the whole app in a system overlay
I download your app but I want to get information about service of LTE of my cellphone so I put *#11# and that doesnt work but it works when I put that ussd un my cell without app
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxx flg=0x10000000 cmp=com.android.server.telecom/.components.UserCallActivity (has extras) }
this occurs after permission grant
for example if we want to use second sim intent.putExtra("com.android.phone.extra.slot", 1);
I have an app that runs multiple USSD in intervals , how do i check if a USSD is currently running so they wont overlapp each other ??
In android 13, you can see a log of the result message in logcat from the ussd call but, the app still waits for a result and doesn't do anything.
How to, before Reply USSD, get response first ?
When I run the app for the first time the process work very good . But when I restart my app the process stop at the first step i don't understand.
followed readme procedure, to make a USSD request even after giving accessibility and Phone permissions
exceptions is being thrown:
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxxx flg=0x10000000 cmp=com.android.server.telecom/.components.UserCallActivity (has extras) } from ProcessRecord{7f583ae 31356:com.example.ussd/u0a46} (pid=31356, uid=10046) with revoked permission android.permission.CALL_PHONE
at android.os.Parcel.createException(Parcel.java:2074)
at android.os.Parcel.readException(Parcel.java:2042)
at android.os.Parcel.readException(Parcel.java:1990)
at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:3973)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1716)
at android.app.Activity.startActivityForResult(Activity.java:5258)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:676)
at android.app.Activity.startActivityForResult(Activity.java:5216)
for example if i call
3 times it get the first and second value the third one is still the same passed in the second paramter
ussdApi.send("1",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
ussdApi.send("397",new USSDController.CallbackMessage(){
@Override
public void responseMessage(String message) {
ussdApi.send("4",new USSDController.CallbackMessage(){
@Override
public void responseMessage(String message) {
ussdApi.send("4",new USSDController.CallbackMessage(){
@Override
public void responseMessage(String message) {
ussdApi.send("25580",new USSDController.CallbackMessage(){
@Override
public void responseMessage(String message) {
display.setText(message);
}
});
}
});
2024-04-19 17:10:39.442 26099-26155 OpenGLRenderer amrserver.android.ussddialer.debug W dequeueBuffer failed, error = -110; switching to fallback
2024-04-19 17:10:39.637 26099-26155 OpenGLRenderer amrserver.android.ussddialer.debug W dequeueBuffer failed, error = -110; switching to fallback
2024-04-19 17:10:40.313 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363366055; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.ProgressDialog; Text: [USSD code running…]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:40.316 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363366103; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: com.android.phone.MMIDialogActivity; Text: [Phone Services]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:40.345 26099-26155 OpenGLRenderer amrserver.android.ussddialer.debug W dequeueBuffer failed, error = -110; switching to fallback
2024-04-19 17:10:40.354 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363366188; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.ProgressDialog; Text: [USSD code running…]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:45.321 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363371178; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [bKash
1.Send Money
2.Send Money to Non-bKash User
3.Mobile Recharge
4.Payment
5.Cash Out
6.Pay Bill
7.Microfinance
8.Download bKash App
9.My bKash
10.Reset PIN
, CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:45.323 26099-26099 onAccessibilityEvent amrserver.android.ussddialer.debug D IS AN USSD
2024-04-19 17:10:45.427 26099-26099 in Not amrserver.android.ussddialer.debug D 4
2024-04-19 17:10:45.428 26099-26099 notIT amrserver.android.ussddialer.debug D android.widget.TextView
2024-04-19 17:10:45.428 26099-26099 notIT amrserver.android.ussddialer.debug D android.widget.EditText
2024-04-19 17:10:45.428 26099-26099 notIT amrserver.android.ussddialer.debug D android.widget.Button
2024-04-19 17:10:45.428 26099-26099 notIT amrserver.android.ussddialer.debug D android.widget.Button
2024-04-19 17:10:45.429 26099-26099 in Not2 amrserver.android.ussddialer.debug D 4
2024-04-19 17:10:45.429 26099-26099 onAccessibilityEvent amrserver.android.ussddialer.debug D YES Input
2024-04-19 17:10:45.430 26099-26099 Sending amrserver.android.ussddialer.debug D 1
2024-04-19 17:10:45.485 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363371303; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [bKash
1.Send Money
2.Send Money to Non-bKash User
3.Mobile Recharge
4.Payment
5.Cash Out
6.Pay Bill
7.Microfinance
8.Download bKash App
9.My bKash
10.Reset PIN
, CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:45.486 26099-26099 onAccessibilityEvent amrserver.android.ussddialer.debug D IS AN USSD
2024-04-19 17:10:45.518 26099-26099 in Not amrserver.android.ussddialer.debug D 0
2024-04-19 17:10:45.521 26099-26099 in Not2 amrserver.android.ussddialer.debug D 0
2024-04-19 17:10:45.522 26099-26099 onAccessibilityEvent amrserver.android.ussddialer.debug D NOT INPUT
2024-04-19 17:10:45.547 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363371405; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.ProgressDialog; Text: [USSD code running…]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:46.961 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363372818; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [Enter Receiver bKash Account No:
, CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
2024-04-19 17:10:47.074 26099-26099 onAccessib...yEvent ass amrserver.android.ussddialer.debug D EventType: TYPE_WINDOW_STATE_CHANGED; EventTime: 1363372932; PackageName: com.android.phone; MovementGranularity: 0; Action: 0; ContentChangeTypes: []; WindowChangeTypes: [] [ ClassName: android.app.AlertDialog; Text: [Enter Receiver bKash Account No:
, CANCEL, SEND]; ContentDescription: null; ItemCount: -1; CurrentItemIndex: -1; Enabled: true; Password: false; Checked: false; FullScreen: false; Scrollable: false; ImportantForAccessibility: true; AccessibilityDataSensitive: false; BeforeText: null; FromIndex: -1; ToIndex: -1; ScrollX: 0; ScrollY: 0; MaxScrollX: 0; MaxScrollY: 0; ScrollDeltaX: -1; ScrollDeltaY: -1; AddedCount: -1; RemovedCount: -1; ParcelableData: null; DisplayId: 0 ]; recordCount: 0
Look at the bottom parts
It fails to get latest screen contents from event
However
Setting android:notificationTimeout="500" or 200+ solves the issue in my case
https://stackoverflow.com/questions/45759236/why-onaccessibilityevent-method-of-accessibilityservice-is-reading-the-same
How to send text or click button with call ussd in screen locked. heplme
Issue:
I have a need to dial a bunch of USSDs. However, these USSDs will be canceled before the last step. The dialog is closed using the cancel() method provided. However, I noticed a weird issue. I am unable to dial a USSD manually after using the USSDController.
On checking the USSDService, I found that it is due to the isRunning flag not being updated.
Solution:
I have considered alternatives
This really not a bug, just a question.
Is it possible for VoIPUSSD to interact with client ? Like letting the user enter what he wants when the ussd interface appear in front of him instead of automatically writing response (ussdApi.send(data) function...)
how to click ok button
Hello,
Cool API, thank you!
Could you please edit the Readme file to include the correct way to add your library to my project.
I can't seem to understand what is the latestVersion
to be added to:
implementation 'com.romellfudi.ussdlibrary:ussd-library:{latestVersion}'
Secondly, the examples are written sometimes in Java and the other times in Kotlin.
Please share the complete ways to use the library in every language seperatley.
Again, thanks for this awesome API you created, I've been looking for it for a long time.
Roy
When I run the app the first time everything works smooth. But when I run the app second-time USSD dialog stays open nothing is getting input
I am using flutter for develope my application so in order to use your kotlin plugin I am make a package and I am using paltform channel to communique with flutter. I have make done all step in documentation but when I am trying to launch my application that using my plugin that implement platform channel I got this error :
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:/home/xxxxxx/.gradle/caches/transforms-3/3756990bc045279d3b35f6e16f4a3570/transformed/jetified-kotlin-ussd-library-1.4.a/res/menu/menu_activity.xml:11: AAPT: error: attribute showAsAction (aka com.example.dev:showAsAction) not found.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Some USSD codes last response includes the input box which does not let the dialogs close after last response.
Can you please add an option to close dialog programmatically. Thanks
Opening this issue will trigger GitHub Actions to fetch the lastest version of VoIpUSSD. More information will be provided in forthcoming comments below.
This is a simple response code
@OverRide
public void responseInvoke(String message) {
ussdApi.send("3",new USSDController.CallbackMessage(){
@OverRide
public void responseMessage(String message) {
Log.d("trim_log", "3 entered \n\n"+message);
}
});
what i want to loop 3 times(dynamic , it might be more) and to produce like below code using for loop
@OverRide
public void responseInvoke(String res) {
ussdApi.send("1",new USSDController.CallbackMessage(){
//
@OverRide
public void responseMessage(String ms) {
Log.d("trim_log", "1 entered");
//
ussdApi.send("2",new USSDController.CallbackMessage(){
//
@OverRide
public void responseMessage(String ms) {
Log.d("trim_log", "2 entered");
//
ussdApi.send("3",new USSDController.CallbackMessage(){
//
@OverRide
public void responseMessage(String ms) {
Log.d("trim_log", "3 entered");
});
});
});
}
???
Hello @romellfudi , I have added jcente() and maven. But it's showing the same error
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
}
So I add the following block to my build.gradle file:
repositories {
jcenter()
}
and then under dependencies, I add:
implementation 'com.romellfudi.ussdlibrary:ussd-library:1.1.i'
but after syncing, I get this error:
AGPBI: {"kind":"error","text":"error: attribute \u0027com.agict.voipussd:showAsAction\u0027 not found.","sources":[{"file":"/private/var/root/.gradle/caches/transforms-1/files-1.1/ussd-library-1.1.h.aar/28120cf25a73f1fef28d19fceab7322d/res/menu/menu_activity.xml","position":{"startLine":3}}],"original":"","tool":"AAPT"}
I have tried to proceed and added in the xml file, the permission requests, and the service in the manifest file. I hit Clean and Rebuild but to no avail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.