lundi 5 janvier 2015

[Q] Stream voice over WifiDirect strategy topic

20:04






Hi all.

I am currently developing an app which allow users to make a voice call over wifidirect (p2p calling)
Currently I am using Socket to establish a receiver-sender connection in each client side, and an UDP socket to transfer data. The sequence looks like diagram below:
Device 1 <========================> Device 2
Sender ======== Request call =========> Receiver
||
Receiver <======= Call responses ========= Accept / deny call

The receiver - sender are 2 separate services. Call request / accept / deny ... are using Intents.
There is an Activity which has a broadcastreceiver will process intents.
I want my app works line the normal call: User can request a call, accept a call, premature end a dialing, end a call.
But shortly I was overwhelmed by too many intents and the interaction between them.
For example, when I request a call, a CALL_REQ intent is sent.
The other device receives the CALL_REQ intent and pops up a dialog to accept or deny a call.
Then in device 1 I end the dial but at the same time I accept the call in the device 2.
The result is: device 1 ended the calling, device 2 starts a call session then sends back a CALL_ACCEPTED intent resulted in crash in device 1.

I believe that my design has problem with handling intents that may interfere each other because of latency introduced by Socket-Client model.
So please help me improve my design. I am thinking of looking for source code of Android normal Call but it seems very different from wifi-direct data stream.






Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 commentaires:

Enregistrer un commentaire

 

© 2013 Mobile Probleme. All rights resevered. Designed by Templateism

Back To Top