Android Tutorial Walkie Talkie - Audio streaming over Wifi or Bluetooth

Discussion in 'Tutorials & Examples' started by Erel, Jun 30, 2013.

Thread Status:
Not open for further replies.
  1. Rick Harris

    Rick Harris Well-Known Member Licensed User

    Is there a way to automatically pair both devices via WiFi? This question applies both to the walkie talkie and the Filetranser library.
    Having to set IP numbers nearly every time is cumbersome. Automatic linking is already possible between a PC and an Android (using a local server on the PC and handshaking via a PSP script on a website), as described in another thread.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The connection step is not really related to this example. Any method that enables you to find the other device ip address will work with this example as it will work in all other cases.
     
  3. Avansys

    Avansys Member Licensed User

    Hi Erel,

    How many devices can be connected via wifi at the same time?

    Is it possible?

    Thanks
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Many devices can be connected via wifi. This example only supports a single connection. However you can modify it to support multiple connections.

    However all the data will need to go through the "server" device.
     
    Avansys likes this.
  5. Avansys

    Avansys Member Licensed User

    Can you help me please¡?
     
  6. Rick Harris

    Rick Harris Well-Known Member Licensed User

    I realize that automatic Wifi connection could also apply to other situations than the Walkie Talkie.
    To which methods are you referring? Kindly provide guidance how to automatically find other WiFi devices in one's own home network and to automatically connect to them.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    I'm sorry but I cannot write such a solution for you. Maybe this B4J example will help you: http://www.basic4ppc.com/android/forum/threads/b4j-cctv-example.34695/#post-203347

    It allows multiple devices to be connected to the same server.

    You can send a broadcast UDP message to all connected device and then reply with the device IP address. For further related questions please start a new thread.
     
    Avansys likes this.
  8. macguiwer

    macguiwer Member Licensed User

    Hello Erel.
    I tried using your code on a 3G connection.
    this is the only modification I made
    Code:
    Sub pe_ConnectivityChanged (NetworkType As String, State As StringIntent As Intent)
    '    MyIP = server.GetMyWifiIP 'only for wifi
        MyIP = server.GetMyIP 'for  3G y wifi.

        UpdateUI
    End Sub
    but can not get it to work

    Error:
    (SocketTimeroutExcention) java.net.SockelTimeExcention:fault to connect to


    any idea?

    PD: I think the application is good.
    I think the problem is that the 3G connection is behind a proxy server.

    PD2 :works perfectly
    the problem was that after a trip outside my country.
    my internet settings was going through a Proxy.
     
    Last edited: Jun 22, 2014
  9. Periklis Koutsogiannis

    Periklis Koutsogiannis Active Member Licensed User

    As its name indicates, it works only over Wifi (local network).
     
  10. macguiwer

    macguiwer Member Licensed User

    and we can rename ;)
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    You cannot connect two devices over a cellular network as the network provider blocks incoming connections.
     
  12. luke2012

    luke2012 Well-Known Member Licensed User

    Hi @Erel,
    it's possible to send a MP3 file instead of the mic audio ?
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    You can send any data you like. However it will be difficult to play the mp3 data. You will need to first save the complete file and then play it.
     
    lemonisdead likes this.
  14. alan dodd

    alan dodd Member Licensed User

    Hello, Philip.
    I read your post about code you have for sending audio from android to pc.
    Could you be so kind to send it to me?
    I already use lakeofsoft with delphi between two pcs and it works, your code could help me get things working with android <-> windows.

    Thank you.
    Alan
     
  15. vangogh

    vangogh Member Licensed User

    Can I send the voice message (half duplex is OK) to ALL devices connected?

    many devices connected toghether so a single "COME HERE" can be heard from anyone?

    thank you
     
  16. lemonisdead

    lemonisdead Well-Known Member Licensed User

    Hello,
    Using UDP could let you do Multicast. You'll have to send the message to the IP 192.x.x.255 so all the UDP receivers could get the same message.
     
    Last edited: Feb 10, 2015
  17. vangogh

    vangogh Member Licensed User

    I analyzed the code but I cannot understand how to select the protocol tcp/udp...

    can you help me?

    I simply have to send a message like "come here" to all devices

    everybody should be able to send a message that is received from anybody...

    thank you
     
  18. Erel

    Erel Administrator Staff Member Licensed User

    It is not so simple to change tcp to udp. AsyncStreams only work with tcp. You will need to change the code to use UDPPacket / UDPSocket.
     
  19. vangogh

    vangogh Member Licensed User

    a multicast chat found in the market uses RTP - Real-time Transport Protocol - that is based on UDP
    have you any suggestion or hints about how to use it the the walkietalkie app?
    I still haven't found a solution I can develope *easily* ;-)
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    I never worked with RTP so I cannot offer you a simple solution. It shouldn't be difficult to use UDP instead of TCP here. Multicasting requires some reflection code which you can find in the forum.
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice