I am using sinch services in my android app and using mobile number as userID now. I want to know Suppose I am inside some activity and I want to get the number of other person he can be a caller or receiver. So can we get that number in
"As we have given to the sinch"
not in Return type "Call" but it should be same as we have given to Sinch like this "8888888888" so I should get this in my activity
Purpose : Same Feedback form for both receiver and caller will be created as soon as the call ends. So caller will rate receiver and vice versa. So I have to give the other person's number to the api to update rating.
OK I have Solved my own problem by using call.getRemoteUserId(); in callscreenactivity
Related
I have a contact app, I created an Action Project which eventually decide a number to call based on user conversation. The number to call is being decided at backend (Fullfilment using Webhook).
I want to start call on number being decided at backend(As it is when you say 'Call 55555555' in Google Assistant).
I am not able to find any document on how to start a call using response from Fullfilment.
Please suggest.
You cannot programmatically start a phone call with Actions on Google.
I'm developing an app with the SDK API SIP. Ive got all the call stablishment ok, but my real problem is that i want to show the location of the user that is calling me during the proccess of call.
I've been reading about PARCEL cause SIP API have 2 functions of it, but i dont think thats the way. I just want to send the coordinates to put them in the API that Google offers me to show the map.
Does anybody can tell me an idea of how to send those values from the caller to the receiver??
Could be a solution, put those values as extra values in the PendingIntent that u create for the open function? If i the caller put them in, the receiver will receive them?
Thanks!!!
Yep, I'm noob in android. It's my first app XD
In Android Open Source Project, a lot of core API declarations have an integer parameter userId in the end. I traced back and figured out the integer comes from a class called "UserHandle.java". There is a simple comments saying this class represents a user on the device. It still confuses me. Why do we need such a class? What's the difference between different values of the class, such as "USER_OWNER", "USER_CURRENT", "USER_CURRENT_OR_SELF"?
Thanks in advance!!!
Ever since Jelly Bean, Android platform has supported multiple users. This means that multiple users may be able to use one device, yet not be able to access other user's files or communicate with another user's app.
The first user on the device is user 0. The rest start their numbering from 10,11,... (In JB the numbering was 1,2...).
USER_OWNER is user 0.
He has some extra privileges over the other users (mostly access certain settings that others can't or uninstall an app for all users).
Multiple users on one device requires that only one user can be active in a specific point in time, this user is referred to as USER_CURRENT (since Kitkat().
In general one user's application can't send a broadcast message or an Intent to other user's apps.
Only apps with system permissions can do that (for example when the battery is running low, an intent will be sent to all).
Whenever you send an Intent from your app, the system service verifies whether this is a valid Intent i.e. if its supposed to reach all users then it's not.
This means that even if you were to use a certain api with the wrong userId (for example you force userId=0 even though this is user 10), then your call will receive a SecurityException.
To avoid such exceptions, there is also the option to send an Intent with USER_CURRENT_OR_SELF.
This means you're trying to send to the current user, but if he's not allowed to receive the Intent, let the same user who sent the Intent receive it.
How to check if intent or app has started ?
My use case is I am showing up notifications through my app and I want to clear them all via myBuilder.cancelAll() if default messaging app has started since my app shows sms notifications. So I am kind of looking for something like:
if (smsAppStarted) {
myBuilder.cancelAll();
}
Thanks
To check if an app has started:
Get the package name of the sms app you want to check.
Then refer to my answer here:
Android how to know an app has been started and range apps priority according the starting times
By using that code, the list taskInfo will contain the list of all apps currently running. Search that list using the package name of the sms app. If it is present in that list, it means that that app has started and currently running.
If I get you right, you need to determine, if another app is currently running. If so, then use this solution.
I'm writing a BroadcastReceiver that responds to the NEW_OUTGOING_CALL action. Meaning, every time the user makes a new phone call - my BroadcastReceiver is called.
I want to get the email of the contact the user is calling.
Here are the extras I can get from the intent:
Bundle[{android.phone.extra.ALREADY_CALLED=false, android.intent.extra.PHONE_NUMBER=123, android.phone.extra.ORIGINAL_URI=tel:123}]
Any ideas? Thanks.
You may want to have a look at the Contacts API which allows you to look up various contact informations in different ways. And then maybe go via the PhoneLookup table to quickly find a contact id for a phone number.
If you haven't used the Contacts API be prepared to learn some 'interesting' approaches and bear in mind that, more and less behind the scenes, it's all only about building select statements for DB tables. - But see for yourself: Using contacts API.