1. Are you ready for the Galaxy S20? Here is everything we know so far!

How to create Socket connection via Wifi of Mobile Network?

Discussion in 'Android Development' started by levanphong7887, May 25, 2011.

  1. levanphong7887

    Thread Starter

    Hi all,
    I want to create a client socket connection with a special network
    type.
    Example:
    Socket socket = new Socket("10.0.0.21", 10000, "use wifi network");
    or
    Socket socket = new Socket("10.0.0.21", 10000, "use mobile network");

    How to do it?
    Many thanks !
     



    1. Download the Forums for Android™ app!


      Download

       
  2. miXer

    miXer Android Enthusiast

    Android uses wifi or mobile automatically. If mobile and wifi is turned on android uses wifi. So to use a specific connection, you need to turn off on or the other manually or with code.
     
    levanphong7887 likes this.
Loading...
Similar Threads - create Socket connection
  1. mysorian
    Replies:
    0
    Views:
    254
  2. mysorian
    Replies:
    0
    Views:
    337
  3. Kuldip Somwanshi
    Replies:
    0
    Views:
    351
  4. Davide Vergnani
    Replies:
    0
    Views:
    333
  5. xpressive
    Replies:
    0
    Views:
    513
  6. Nabeel Rajabali
    Replies:
    1
    Views:
    649
  7. androinewbi
    Replies:
    6
    Views:
    977
  8. MackOS
    Replies:
    0
    Views:
    444
  9. Youssef Hammad
    Replies:
    0
    Views:
    1,178
  10. Murphler
    Replies:
    0
    Views:
    762

Share This Page

Loading...