How can I stop the incoming message tone in Symbian - symbian

I there anyway in Symbian to stop the incoming message tone after it starts playing ?
I tried to use the following code to stop the sound after it starts, but it didn't work:
User::ResetInactivityTime();
I'm using Symbian C++
Targeting Symbian S60 5th Ed, Symbian^3 and Symbian Anna
Any suggestions would be appreciated.

You'll probably need the MultimediaDD capability, which you will never, ever get (legally)

I assume that you want to catch some of your own specific messages not all user messages.
AFAIK there is no easy solution. You could try to listen the sockets and catch your message before it arrives to the Inbox.

Related

asmack - make sent message don't shown in Gtalk

I have added online playing function for my chess game, with the help of asmack api. It works, but there's some minor issues left:
When I send/receive messages, these messages are not only received by by my game client, but also captured by Gtalk client on android phone. It's annoying and may bother user. How to make these messages captured just by my game client?
Thanks.
Did you have forgot to implement a MessageListener?

How to use AT command to detect phone line is busy

I have a USB modem. Is it possible to detect the phone line is busy or not?
I thought I could use AT Command to detect dial tone, but I'm not sure are there any commands support that.
Thanks.
I believe you have to do this the same as a human would... take it off hook and wait for dial tone.
Ripped from http://michaelgellis.tripod.com/modem.html
D alone will take the modem off-hook and wait for a dial tone. (see
X command for exceptions). The length of time to wait for a dial tone
before dialing is programmable in register S6.
If you try call, and it's busy, modem send you message BUSY or NO ANSWER

detect non responsive windows in mac os x

I am developping an objective c application and I would like to detect non responsives windows even if they are not own by my application.
Is there a way to be notified when a such case occurs?
Thanks in advance for your help,
Regards,
I think the only way to detect whether an window is hanging is to detect when its application is hanging. And I think the only way to - reliably - do this is to talk to it. Send it some inter-process message and await an action. I think that's exactly how the system detects it: there is some delay before the beach ball appears. And this is because the system sent a message and received no answer in x seconds.
What kind of message that might be is hard to say. Must be something that goes through the main event loop but can be sent by every application. I'm sure Google will be of some help finding it. I'm no pro in inter-process communications and would have to search as well.
You can use the Instruments application with a "Spin Monitor" instrument track. If you set it to monitor "All Processes", it will capture stack traces whenever an application hangs (doesn't process the main event loop for a long time).

Terminating Another App Running - Cocoa

How can I terminate another app that is running in cooca. Let's say I have iTunes running, and I type in quit in my app, it would quit itunes. "iTunes" is just an example, it could be anything the user wants. I can open any app from my application, but I want to know how to close any app running.
thanks
kevin
AppleScript is a pretty high-level way to send a single Quit event. SIGTERM is a pretty brute-force, low-level way.
The correct way to quit another application is to obtain its Process Serial Number (psn) and send it a kAEQuitApplication Apple event with these two lines of code:
result = AEBuildAppleEvent( kCoreEventClass, kAEQuitApplication, typeProcessSerialNumber, &currentProcessPSN,
sizeof(ProcessSerialNumber), kAutoGenerateReturnID, kAnyTransactionID, &tAppleEvent, &tAEBuildError,"");
result = AESend( &tAppleEvent, &tReply, kAEAlwaysInteract+kAENoReply, kAENormalPriority, kNoTimeOut, nil, nil );
You can do this from C, C++, or Objective-C, and you have to link with CoreServices.framework.
If you're running on Mac OS X 10.6, Snow Leopard, you can use the new NSRunningApplication terminate method.
For high-level applications like iTunes, based on Carbon or Cocoa, they're going to respond to Applescript. "Quit" is part of the standard package. You just need to send:
tell application "iTunes" to quit
There are lots of ways to do that. The simplest to implement is to make a system call to osascript:
osascript -e 'tell application "iTunes" to quit'
You can go up from there to more powerful tools like Apple Events, which would be very appropriate for this problem. You could even go so far as Scripting Bridge, but for terminating an app, that would be overkill.
This will only work for programs that respond to Applescript, but that should be any program that you would see in your dock (and which I assume you mean by "applications"). For lower-level processes like daemons, you need other techniques like launchctl or kill, but we can talk about those if you need them.

How to get NMEA from the GPS Device?

im trying to read the current position of GPS Device...using N95 from Nokia.
I read tht i will need my device to return the NMEA lines to the serialport and then i will parse/split it to get things I want but all along I dont know what to write to the serialport to make device return the NMEA ?
Like There are other commands of AT for messaging etc...Is there any specific command to send to serialport to get NMEA ???
I found this site site which seems to guide you through everything you need to do.
I am not sure how it works in the N95, but in my HTC phone you cannot send commands to the GPS device to have it behave in a certain manner. Once I am connected to the serial port that the GPS device uses I can read a stream of data coming from it, which happens to be NMEA data. There is no way that I have found to send commands to the device to tell it how to behave.
I haven't used that specific GPS device before, but for mine, I just have to open the port and I start receiving the NMEA data immediately.
I have an N82, and as far as I know it doesn't speak NMEA directly. I use a script from this page - specifically one the titled "# Turn your S60 phone with an internal GPS (eg your N95) into a Bluetooth GPS" - to get NMEA strings.
Ahh oki so I need to run some script.Oki I think i should buy a specific GPS Device for it.
Which device will do my job in cheapest manner ?
I've never worked specifically with the N95, but most GPS devices will just start spitting out NMEA as soon as they're powered up, regardless of whether or not they have a lock. I don't know how the N95 is designed, but I'll bet it probably wasn't designed to give you access to the raw NMEA data from the GPS. You'll probably need some pretty fancy trickery to get it to do that.
If you don't need to use the N95, you might find it easier to just get a GPS module and use that instead. I've always purchased mine from SparkFun. They have some good evaluation boards boards and tutorials to help you get started.
A great way of doing this in Java ME is to use JSR 179: the Location API. Your app needs to create an implementation of LocationListener, then set it on the default LocationProvider. When your listener's locationUpdated method gets called, call:
location.getExtraInfo("application/X-jsr179-location-nmea");
This will provide access to the NMEA sentences.
You can send this over a serial port by using the Java ME commports mechanism (use:
System.getProperty("microedition.commports");
as described here).
Hope this helps,
funkybro