In my Android app, while calling a remote phone I need to keep track of the number of times the remote phone rings before it (i.e. remote phone) goes to off-hook or idle state. Googling for this topic hasn't yielded anything of much help. A brute force method could be to process the audio and count the rings -- but this seems ugly and avoidable and may not work with all carriers/phones. I'm looking for a pointer to some documented/undocumented API that Android may have to address this requirement.
Any suggestions for solution or pointers to where shall I explore will be much appreciated.
Thanks in advance,
B.Sodhi
Take a look at SIP protocol!
If you go deep enough in your Android you can have a callback, when the remote phone is received the call signal. From there you will count X seconds and is done.
Not so easy to implement as it said, but is possible. A technical man, never says it is imposible :)
Related
We want to track some data for water sports, so something that is really important for us is to store information in the DataLogger module.
We noticed the logger stops approximately one minute after we lose the Bluetooth connection with the device. So, my question is, is there a timeout or something related to the DataLogger module that forces to stop the logger? Is there any way to avoid this behavior? If there is a constant, where is it located? We need to keep logging as much as the storage permits. What is the best way to do it?
My guess is that you are using the default app that Movesense sensor comes with (hr_wakeup_app or similar) that goes to power off after 1 minute without Whiteboard/BLE connection. If you flash your sensor with plain_app or some other app that never shuts down the logging will continue.
We are in process of improving the sample app to take into account the running DataLogger when deciding to go PowerOff, but that is not out yet.
Full disclaimer: I work for the Movesense team
I have an app that successfully reads different bluetooth characteristics. It works, but only if I wait a certain time between reading a different characteristic. This time varies between 70 and 200 milliseconds and i find it very annoying. Doesn anyone else experience this problem? Or does anyone know of a way to fix this?
This is a prevalent issue, i used to a request queue and a GATT timeout in processing different requests, it solved the problem for a certain extent i should say.
Have a look at this https://git.ti.com/sensortag-20-android
Ti people has a demo implementation of a BluetoothLeService, which has request queuing, may work for you.
It may sound stupid but. I've set the timeout to 5 seconds and testing with a 3g connection it seems to be too little when in my experience it really sounds like an eternty.
What's a common use value for users not to desperate and keep the things together?
There are really no special, commonly used values for something like timeouts. A value that works for one user may not work for the other. The important thing from a UX perspective is, when the timeout does occur, the user is informed of:
A timeout has occurred.
The next appropriate action to recover from it, such as, restart the app, wait a while, contact support etc.
via unambiguous error message.
Doesn't sound stupid, but it depends on the interaction between your app and the server. Unlike a router based timeout, some routers begin their calculation when they begin to do the work (Heroku comes to mind). In this case, anything under 30 seconds is good.
Short skippable intro:
I work at a rehabilitation hospital that's a couple kilometers from where I live. The hospital pays a bus service that picks the employees up at certain fixed locations. There's this bus driver, that picks us at 7:00. The guy is FREAKISHLY PUNCTUAL. I mean, this guy has to be in the tenth of a second order. The clock turns from 6:59 to 7:00 EXACTLY when he opens the bus door. And I was thinking of recording his punctuality for like 30 days and make a nice Excel spreadsheet for him. Error propagation and everything. He might even get a raise, who knows?
I'll make a simple app to save time in milliseconds, that seems easy enough, there're like half a dozen solutions for that here in Stackoverflow.
So, to the question:
I hit a button on a widget. It gets a time in ms. It saves it on a file (.txt, .csv, whatever)
How would you estimate the mean error of an NTP synchronized Android phone? What's the most precise and exact way to save a timestamp?
Thanks in advance
First thing that comes to mind is that time is relative, in the Einstein kind of way :) So if your reference is an Android phone synchronized with NTP, what is the driver's time reference? What if synchronization or timing somehow gets off, delayed on your phone and you have the impression that he's late one day, when in fact he's precisely on time relative to his reference?
But for the sake of solving the problem i think you can start by assuming he has the same time reference with you: some place in a network. I don't know the details of Android synchronization via time protocols, but i do know i built a so called Network Synchronization API. In your case i think my Java API might be of help. It tries to make a request for the number of milliseconds since the Unix epoch and then reads the response. The feature is that it gives you a framework on which you can estimate your true time compared to the server's by trying to discard network lag.
One thing to bear in mind: the solution above makes a request to my site (a.k.a. GoDaddy servers) which is probably different than the network location Android phones sync with. Feel free to change the request location.
Second thing to bear in mind: this rabbit hole goes deep :) No measurement can be perfect. You can try to achieve human / reasonable precision but it can never be perfect (e.g. there are other unknowns: what if there's a lag in your Android CPU just as you press the button, or what if your own reaction takes a few milliseconds? The moment you press the button is not the same as the moment the doors actually open and my impression is they're at least a few millis apart)
Is it possible to find another phone number is on or off.
I think it depends on service provider and in India there is no service provider gives information. In Uruguay it is possible!! and if it is possible so how i can check this in India?
Thanks in advance.
There is no standard for determining if a cell phone is powered on or off. Most of us can tell if a cell phone is powered off when calling a phone by the fact that it goes to voice mail immediately. Usually there is no ring-back when this occurs but it may differ slightly from carrier to carrier. The other issue with using this as a determination is that the user can select to avoid the call which if they are fast enough may give similar results to the caller.
You may be able to make a determination on whether a cell phone is on or off using call progress analysis, but for the fore mentioned reasons it will not be 100% accurate. One way to get call progress analysis is to use Call Control XML (CCXML) with a platform that has good call progress analysis like Voxeo's Prophecy. If you look at their documentation on CCXML there is a section on outbound dialing that covers call progress analysis. You would look to see if there was no ring-back before the answer to determine if the phone is off.