android_overview.pdf
(
555 KB
)
Pobierz
Android Overview
Android Overview
Dongsu Han
1
Outline
•
Java network programming overview
•
Android Overview
•
Android Emulator Overview
•
Project Overview
•
Getting Started
2
Java Network Programming
•
Java.net.* programming model
–
Blocking model, you wait until work is done, maybe
forever
–
One thread required per connection
–
Socket exposes input and output stream
•
Java.nio.* programming model
–
Introduced in Java 1.4, non-blocking IO
–
New Interface: SocketChannel
(in java.nio.channels)
–
Reading/writing via
Buffer
objects rather than
input/output streams
–
Select() implemented
3
Java.net.* Socket API
•
Part of the java.net package
–
import java.net.*;
•
Provides two classes of sockets for TCP
–
Socket : client side of socket
–
ServerSocket : server side of socket
•
Provides one socket type for UDP
–
DatagramSocket
4
Java.net.Socket
•
Making a connection
Socket s = new Socket(“hostname”, port);
•
The constructor not only creates a socket, but
makes a TCP connection.
•
Socket exposes input and output stream.
s.getOutputStream()
s.getInputStream()
•
Most of the time you'll chain the input/output
stream to some other input/output stream or
reader object to more easily handle the data.
5
Plik z chomika:
kamil6966
Inne pliki z tego folderu:
Android_Application_Developmen.pdf
(5671 KB)
pro Android.pdf
(5781 KB)
ANDROID-A-PROGRAMMERS-GUIDE.pdf
(7398 KB)
Manning_-_Unlocking_Android__2.pdf
(9302 KB)
Android_Mobile_Application.pdf
(5 KB)
Inne foldery tego chomika:
ASP Kompendium programisty
ASPDOTNET-tekst
Assembler
C++ i C#
Delphi
Zgłoś jeśli
naruszono regulamin