Skip to main content

Posts

Showing posts from October, 2020

Transport Layer Protocols

There are two fundamental protocols in the transport layer  1. TCP Transmission Control Protocol-- connection-oriented protocol 2. UDP User Datagram Protocol -- connectionless protocol Connection-oriented communication : establishes a logical (virtual) connection prior to sending data. Connectionless communication : sends data right away without establishing a logical connection Qn why do we have transport layer protocal?  IP provides a weak, but efficient service model (best-effort ) How should hosts send into the network?      i.)Flow Control      ii.) Too fast is bad; too slow is not efficient IP packets are addressed to a host           How to decide which application gets which packets?         NOTE TRASPORT LAYER IS RESPONSIBLE FOR PROCESS TO PROCESS DELIVERY PORTS port is a communication endpoints  Since there are many applications running on a computer, there is a need to decide which application gets which packet. A port number is a way to identify a specific application (proc

Simple Android RecyclerView example

  Start with an empty activity. You will perform the following tasks to add the RecyclerView. All you need to do is copy and paste the code in each section. Later you can customize it to fit your needs. Add dependencies to gradle Add the xml layout files for the activity and for the RecyclerView row Make the RecyclerView adapter Initialize the RecyclerView in your activity Update Gradle dependencies Make sure the following dependencies are in your app  gradle.build  file: implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:recyclerview-v7:28.0.0' Create activity layout Add the  RecyclerView  to your xml layout. activity_main.xml <?xml version="1.0" encoding="utf-8"?> < RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:layout_width = "match_parent" android:layout_height = "match_parent" > < androi