Detecting dropped call in Mobile - mobile

I'm using Motorola device and developed it with J2ME . I'm searching for a functionality to detect incomming or outcomming calls when dropped .
I mean , when the call is dropped I need to recognize this event.
Thanks

There is no standard J2ME telephony API.
There could be a working proprietary java-based API on that particular handset but that's both unlikely and not obvious to verify.

You could use the life-cycle of the application to detect interrupts. Your device can detect when a phone-call comes in and ends, and trigger shownotify(), hidenotify(), startApp(), pauseApp(), then do something accordingly. See the canvas class. So if you have an application running, you can detect an incoming phone-call, wait for it to end then do something. This is of course very device/manufacturer specific and you are in a world of hurt when it comes to porting this for many devices. I'm not sure if you can do something like this for outgoing calls, since your app will be in the background and paused for most devices.

You could try checking the motorola developer webpage. Motorola has its own set of libraries for j2me, it may support the case you need.

Related

Use DroneKit to build a Ground Control Station for Windows

On the DroneKit.io page, it mentions using DroneKit Python when creating Ground Control Stations for Windows. However, there appears to be no documentation for this.
Is it meant to simply simulate a com port and act as a proxy for other Ground Control Stations, which just makes it easier hijack the MAVLink?
Also, it mentions Python being used for low-latency processes. This seems to be oxymoronic. Is there a reason that it would be better than just using C/C++ for the purpose of hijacking the MAVLink?
Thanks!
DroneKit-Python can be used either to create a python-based ground station or it can be run on a companion computer. There is no practical difference between the two except how you set up the connection to the vehicle from the computer running the script. The different ways of starting MAVProxy for the different connections are covered in the Getting Started documentation.
The reason that there is no "specific" documentation on using DK-Python for GCS is primarily "marketing". The far bigger market for ground station GCS software is in tablets/phones that will use DK-Android or a future iOS port. DK-Python has been positioned solely as for use in the air interface. Even though there is no "specific" documentation, in fact all the existing documentation is relevant.
Is it meant to simply simulate a com port and act as a proxy for other Ground Control Stations, which just makes it easier hijack the MAVLink?
No. See above.
Also, it mentions Python being used for low-latency processes. This seems to be oxymoronic. Is there a reason that it would be better than just using C/C++ for the purpose of hijacking the MAVLink?
It doesn't mention low-latency processes, so the answer is "invalid question".
You're probably misreading the text "that require a low-latency link". The point here is that if you have dronekit-python running on a companion computer and connected by a fast link you can do real time handling of incoming sensor data. This allows computer vision control of the UAV. However if you run DK-Python on a ground control station you will have a much slower link. You can still control movement of the UAV but the latency will be much higher.
Hope that helps!

Register virtual sound device from within application

I want to be able to process audio output of applications (VLC, Rhythmbox, ...) within my own one. Moreover, one should be able to select my application as the sink for the sound (e.g., in VLC or pavucontrol my application should appear as an output device).
How is this possible? Can it be done with ALSA, Pulseaudio, ...? Currently I am seeking for the easiest solution while later performant ones may become preferable. It would be great if most of the configuration could be done via API calls.
Thank you for your support!
I ended up writing a PulseAudio module. There one can create own sinks and directly get access to the audio stream. Have a look at my implementation here.

How to determine the last time the audio device was playing a file?

I would like to use C in order to get the last time the soundboard was playing a file. Is there a way I could do that?
None of the components you are using (tools, libraries, sound servers, drivers, kernel) logs the time when a sound is played.
If you are using one specific tool to play sounds, you could modify it to log the time.
Otherwise, you have to actively monitor the current status of the sound device.
(With ALSA, you could poll /proc/asound/card*/pcm*/sub*/status.)
I think it's not possible because of ALSA(Advanced Linux Sound Architecture) is just kernel component that provide device drivers for sound card.But i don't know if some user-space API's and library's like (alsa-ustils) can do that!,I advice may is better to check Sound-Player applications(VLC etc..) log ?!

Cross-platform Bluetooth interoperability

I have a requirement to have a cross-platform program --- intended for mobile devices such as Android, Brew, Bada, WinCE etc --- be able to communicate with other instances of itself via Bluetooth.
Unfortunately:
the Bluetooth APIs on such devices are all radically, radically different.
the terminology they use is also radically different.
what actually works is frequently radically different to what they say works.
So far I've discovered that Android will allow you to connect to or listen on RFCOMM services specified by a simple UUID, but does not allow more complicated manipulation of SDP records; Brew claims to support SPP but the API appears to allow arbitrary RFCOMM; Bada supports SPP but doesn't allow you to specify the UUID, so I have no idea how you're supposed to do service discovery or listen for two things at once...
Oh, and iOS doesn't allow Bluetooth communication at all to non-iOS devices.
So:
I can't be the first person to need to do this. Is there a known subset of Bluetooth functionality that I should be using in order to maximise portability?
Device makers usually implement some bluetooth profiles such as A2DP, OBEX, etc. Depending what you want to do, you should check that all your target devices implement the required profiles.
Note that even though a device can implement an specific profile, there may not be an API that will allow you to use it.
See http://en.wikipedia.org/wiki/Bluetooth_profile.

OS X/Linux audio playback with an event-based interface?

I'm working on a streaming audio player for Linux/OS X with a bizarre use case that has convinced me nothing that already exists will work. For the first portion, I just want to receive MP3 data and play it. I'm currently using libmad for decoding and libao for playback. My problem is with libao, and I'm not convinced it's my best option.
In particular, the ao_play function is blocking. It doesn't return until the entire buffer passed to it has been played. This doesn't give enough time to decode blocks between calls to ao_play, so the decoding has to be done either entirely ahead of time, or concurrently. Since this is intended to be streaming, I'm rejecting ahead-of-time decoding offhand. (It's conceivable I could send more than an hour's worth of audio data - I don't want to use that much memory.) This leaves concurrency. But while pthreads is standard across Linux and OS X, many of the surrounding libraries are not. I'm not really convinced I want to go to concurrency - so I'm reconsidering my choice of libao.
For my application, the best model I can think of for audio playback would be getting a file descriptor I could select on to get notified when it's ready for writes, then issue non-blocking writes to. (This is due to the rest of the details of the use case, which imply I really want a select loop anyway.)
Is there a library that works on both Linux and OS X that works this way?
Although it's much hated, PulseAudio basically works exactly like you describe (using the Asynchronous API, not the simple one).
Unless what you want to do involves low-latencies or advanced sound work, in which case you might want to look at the JACK Audio Connection Kit.
PortAudio is your one. It has a simple callback driven API. It is cross-platform and low-latency. It is the best solution if you don't need any fancy features (3D, audio-graphs,...).

Resources