how to connect adb to a target that uses DHCP to get IP addr

by David Turner » Wed, 29 Apr 2009 06:59:39 GMT


Sponsored Links
 No, ADB doesn't support this at all at the moment. The easy fix is to
configure your DHCP server to
always return the same IP address for your board, based in its MAC address.





--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Other Threads

1. how to send data withGPRS

Hi, i am a student and developpe an application with android.I don't
use the real phone,only the android emulator.I want to know how i can
use the GPRS with this emulator.I have tested to  use the package
org.apache, but i did know how to use this package correctly.

Another thing, i have tried to use the java.io.* and java.net.*,
always not succes.Please help me.

 i have add the permission,<uses-permission
android:name="android.permission.INTERNET"></uses-permission>

My code is below

/////////////////:**** On android
phone***/////////////////////////////:



192.168.1.6 is the ip address for the server web
3000 is a port that server listen to retrieve the data which are
sended by the emulator android

public class androidtracabilite extends Activity

{

/** Called when the activity is first created. */


private Socket socket;



public androidtracabilite()

{

try

{

socket=new Socket("192.168.1.6",3000);

}catch(Exception e)

{
}

}


@Override

public void onCreate(Bundle tracabilite)

{

super.onCreate(tracabilite);

setContentView(R.layout.main);

try{

envoiesocket();

}

catch(Exception e)

{
}

}



public void envoiesocket() throws Exception

{

System.out.println("Entrer dans la fonction");

TextView tv = (TextView)findViewById(R.id.myTextView);

StringBuilder sb = new StringBuilder("Envoie Socket");



BufferedReader plec = new BufferedReader(new InputStreamReader
(socket.getInputStream()));

PrintWriter pred = new PrintWriter(new BufferedWriter(new
OutputStreamWriter(socket.getOutputStream())),true);


pred.println("envoie de socket");

String read= plec.readLine();

plec.close();

pred.close();

socket.close();

sb.append(read);

tv.setText(sb);

}





Thank you for your help


--~--~---------~--~----~------------~-------~--~----~

2. Server Socket on Real Device

Basically what I want to achieve is have a server running on an
android device that a P.C/Laptop/whatever can connect to using
sockets.

Currently I have this working on an emulator, where I can send a
simple text String, but obviously networking on a real divice is
different.

I was just wondering what changes to my code I would have to make to
get this to work a real device?

Here is the code which works on the emulator. Thanks in advance


<<<Android Server>>>

public void run() {

                try {
                        ss = new ServerSocket(1234);
                }
                catch(IOException e) {
                        System.out.print(e);
                        System.exit(1);
                }

                while (true) {
                        try {
                                socket = ss.accept();

                                in = new BufferedReader(
                                              new InputStreamReader(
                                              socket.getInputStream
()));

                                String text = in.readLine();

                        }
                        catch (IOException e) {
                                e.printStackTrace();
                        }
                }
        }



<<<Development Machine Client>>>

public TestClient() {

                try {
                        socket = new Socket("127.0.0.1", 1234);
                        out = new PrintWriter(socket.getOutputStream(), true);
                        out.println("TEST");
                }
                catch (UnknownHostException e) {
                        e.printStackTrace();
                }
                catch (IOException e) {
                        e.printStackTrace();
                }
}

--~--~---------~--~----~------------~-------~--~----~

3. Where is the source code for "Pictures" app

4. Your UK sales?

5. is there are europe-based developer conference.. or will there be one..?

6. Need help in finding screen coordinates of a view

7. Required apps ?