Auto response to incoming call with SMS - java

Is it possible to auto respond to incoming call with an SMS?
For example if a user is on a metting and want to set is phone state to busy, and automaticlly send reponse SMS saying "I am busy, call you later".
I saw that blocking incoming phones is impossible, but here i want the call to come and simply send reply SMS automaticlly.
Thanks.

Yes it is possible,it can be done by creating a broadcast listener and sms Manager,that is whenever the app is turned to do not disturb mode,you can register any incoming phone number in the app and can send an automated sms reply to the number as soon as possible. and as the matter of fact there's already an app present in the app store

Related

How to cancel Firebase Realtime Database ongoing write or delete operation in Android

I am building a chat app, and like Whatsapp, I need to provide users the facility to save their messages as undelivered when internet connectivity is OFF, and as soon as the internet is back then that data should be retried to be sent to the receiver.
But, in case I scheduled a write operation using Firebase .setValue(), then how could I cancel that process in case the user changes his mind and doesn't want that message to be sent, or in technical terms does not want to setValue(), how could I stop that ongoing write.
As I understand from your scenario, the problem arises when the device is offline and you want to let the user the possibility to delete the message, so it cannot be displayed once it regains connectivity. Because the setValue() method returns a Task<Void> object and because I don't see any cancel method in this class, the only thing to do it to simply remove the message. In this case, when the user is back online, no other users will see the deleted message.
On the other side, it's true that there is a chance in which the user sends the message and right after that he loses connectivity. Even if there was a cancel method, you would have nothing to cancel, as the message is already set on the server. Again, the single option that you have is to delete the message. The delete operation will remain in queue until the device regains connectivity and right after the synchronization the message will be deleted.
Besides that, remember to set the persistence enabled, because it's not enabled by default:
setPersistenceEnabled(true);

Does android system blocks FCM notification

I am sending a data notification every 2 min for the device in order to collect data (GPS, Signal strength ...).
The FCM trigger service that sends the collected data to an API
However, The device stops receive FCM notification to starts that app in some cases or even till restart it.
Is there any reason for this and how Can I pass it?
Note: I have Add server up to white list in the firebase console
Generally there are two types of FCM messages we can send to registered devices. First one is data message and the other one is notification message. The default priority of data message is NORMAL where as the notification messages have a HIGH priority. Messages with HIGH priority are considered to be delivered first (That means there is a chance of not receiving data messages in some case). But it is possible to change the priority of data message to HIGH while sending them from server.
https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message
But in my case i had some situations when i was not able to receive FCM messages even after setting priority to HIGH. Thus i opted to use FCM wrapper services like Onesignal to send push notification. It is way better in case of message delivery. Inside it is FCM, but they handled the message delivery problem up to an extent. Take a look at
https://onesignal.com/

Java,Spring,Push Notification

I want to implement push notification in java so please help me out
1-Each time a new record(Message) pushed into data base(due to event created by some other user), a push notification should be sent to specific Logged in user automatically.
2-Content of the push notification should be the message present in the db.
3-If there are multiple messages, then the user should receive them one by one in a queue fashion.
4-Most important thing is the logged in user need not have to trigger any event to get notification, user should receive it automatically throughout the session.
You could use Server Sent Events. Java provides SseEmitter to send timely notifications.
You can use EventSource API in JavaScript to trigger the SSE event stream and in the server-side, loop the database query code which is wrapped by an ExecutorService - which can spin of separate thread based on the initialization.
Put SSE timeout to -1 for listening for an infinite amount of time.
Please note this answer is only a hint. Use these to explore more from the internet.

Alert dialog display even when the application is not running

I want to notify the user of my app when he receives special news (from my app).
How can i display some kind of a messeage to the user, even if my app is running in the background (or not running at all if possible).
I want him to be notified by text, and sound.
Thanks.
You need to write a service for doing this. Then in your service code use Notification class to show text and sound alerts.
Use Broadcast Receiver, to notify abt some action. Like updates, sms, or abt indicate when booting of a phone completes,etc... BroadCast Receiver works on the principle of Publisher and Subscriber pattern.
If your app is not running and you want to do something you'll need some kind of broadcast receiver to receive a trigger.
Probably what you'll end up doing is starting up at device boot, to schedule some stuff. This answer here should get you into the right direction
After that, the best way to notify the user is with notifications (or Toast messages if you're a great fan;))
Have a look at
Status Bar Notifications

Android: receive dialer number press from the other party

I'm wondering if it's possible to receive a notification if user presses a number in dialer on the other side of connection during the phone call. Like the scheme used by various automated support services - "Press 1 to..., press 2 to...". So I would like to receive that number pressed.
Thanks
AFAIK it is not possible to tap into the phone's incoming audio stream...
There's a lot of "record incoming call" issues on that matter.
You would need the incoming audio stream to read the DTMF-codes being sent.

Categories

Resources