I am trying to parse USSD response by carrier network.Found a link https://github.com/alaasalman/ussdinterceptor
but it does not support for 4.2.2 and above. Is there any api or method to attain such?
Finally able to get response, Basically a background "Accessibility Service" is running which receives callback by the system whenever system accessible events are fired and app filter out the event when alert dialogue after calling USSD which in our case "android.app.AlertDialog" is shown and at this instance we can retrieve the data sent by the operator.
"Accessibility Service" for particular app needs to be enabled manually by the end user not programmatically by code because of security purpose mentioned by android.
Related
I want to write an app that whenever user 1 touches the "buzz button" in the app,
immediately user 2's phone vibrates.
I have written the app code and when user 1 clicks on the button, a request sends to the server via post method and the database updates.
so I can send the vibrate request to the sever.
but what should I do to force the app always listen to the server that when a request sent to it, phone vibrates.
And if you recommend any other ways please share with me!
I also need to store the buzz history in a SQL
To manually handle background process use Service:
https://developer.android.com/guide/components/services
And when event occurs use Broadcast:(to send events to other Fragment/Activity/Application)
https://developer.android.com/guide/components/broadcasts
to hear the broadcast events Register it to Receiver:
https://developer.android.com/reference/android/content/BroadcastReceiver
JobScheduler can also be used in modern android applications:
https://developer.android.com/reference/android/app/job/JobScheduler
I am implementing Twilio SDK in the app and I've managed to make web to web calls and also web to phone calls.
I can't seem to manage to figure out how the switch from web to phone should be made.
I initially call the Voice.call() with an identity user_39 but if the user has no internet connection, and does not receive the push notification sent by me, how should the switch from web to phone be made?
Is it somehow done automatically by the Twilio SDK or should I listen for the error response to Voice.call() and based on some status decide to remake the call with the actual phone number of the user?
I haven't been able to find a clear documentation regarding this.
Twilio developer evangelist here.
If the user you are trying to call is not online then the call to them will fail. You will need to listen for this using a Call.Listener and the onConnectFailure event. If you detect that the call failed to the app then you can handle the failure and restart the call to the user's phone number.
Let me know if that helps at all.
I'm writing an app which sends a predefined message to a predefined number. It then gets the response and displays this to the user. I've got the mobile side working, and I am now working on the Wear app, however have become a little stuck as to how to do it.
I've managed to send the message from the Wear device by implementing a listener on the mobile app, which then triggers the activity to send a message. What I can't figure out how to do, is that the response the app gets and send it back to the Wear device.
Looking here:https://developer.android.com/training/wearables/data-layer/index.html
I have used the MessagesAPI for sending the message, however unsure what to use if I want to receive a message. Does anyone know what the best way to do this would be? My initial instinct says I'm going to have to ditch the messagesApi and use the Data one?
You should send the response the same way you used to send the first message, but this time the wearable will be listening for messages (usually in your WearableListenerService).
Take a look at this: https://github.com/heinrisch/talkclient
Either you can use the library or look at the code. I would look at the code, its quite easy to follow.
It sounds like you can use either data or message api, depending on your needs. To receive a message you either have the app active and get it though a listener, or you create a service.
Am in the feasibility study of an app which enables an automated message like, "I'll pick up the call in a second. Please wait.” or so as the user sets, without hanging up the call. So as to enable the user to get time to pick up the call if in case he is busy and also alerts the caller to be patient till the phone gets picked up.
The problem is I want to send it as voice data. Is it possible to send without attending or hanging up the call? Is it possible to send a voice data not as MMS!!!?????
According to what I suggested..
1>Pick the call intent when actually you got the call on you phone
You can find the helpful links over
here,
here
and here
2>have some prerecorded MMS or some SMS.
3> use threads sleep method to wait for some time(the time after which you actually want to send the informatory message to the caller).
4> do your job here to send the message to the caller in the background thru ur app.
I would like to make an activity where i can call a certain numer to check my prepaid phone balance.
In my provider its for example *555# then i will get a response like for example "Your remaining phone credit is 5 USD". I would like to use this data (5 USD) to save in the database.
I am just a beginner, does someone know how to proceed?
You could issue a CALL intent (which requires a permission) and use a broadcast receiver to listen for the SMS response (again, permission required).
However, this isn't a very robust solution as you have to check the SMS sender id and the message text, whcih may change in the future.
EDIT
As pointed out in comments, you will need to use the USSD protocol for this. It definitely appears possible, as there is an app that does just that: https://play.google.com/store/apps/details?id=com.iba.ussdchecker&hl=en.
These threads may be helpful:
Call (and get the response for) a USSD Code, in the background?
How to run USSD commands on android?
How is it possible to do USSD requests on Android?