This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sriyank.mdccomponents | |
import android.os.Bundle | |
import android.widget.Toast | |
import androidx.appcompat.app.AppCompatActivity | |
import com.google.android.material.snackbar.Snackbar | |
import kotlinx.android.synthetic.main.activity_main.* | |
class MainActivity : AppCompatActivity() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.DatagramPacket; | |
import java.net.DatagramSocket; | |
import java.net.InetAddress; | |
import java.net.SocketException; | |
public class UDPClient{ | |
/* The server port to which | |
the client socket is going to connect */ | |
public final static int SERVICE_PORT = 50001; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.DatagramPacket; | |
import java.net.DatagramSocket; | |
import java.net.InetAddress; | |
import java.net.SocketException; | |
public class UDPServer{ | |
// Server UDP socket runs at this port | |
public final static int SERVICE_PORT=50001; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MulticastClient{ | |
public final static int MULTICAST_PORT = 50001; | |
public final static String MULTICAST_GROUP = "127.0.0.1"; | |
public static void main(String[] args){ | |
try { | |
MulticastSocket clientSocket = new MulticastSocket(MULTICAST_PORT); | |
clientSocket.joinGroup(InetAddress.getByName(MULTICAST_GROUP)); | |
byte[] dataBuffer = new byte[]; | |
DatagramPacket inputPacket = new DatagramPacket(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MulticastServer { | |
public final static int MULTICAST_PORT = 50001; | |
public final static String MULTICAST_GROUP = "127.0.0.1"; | |
public static void main(String[] args){ | |
try { | |
DatagramSocket serverSocket = new DatagramSocket(); | |
byte[] dataBuffer = new byte[1024]; | |
DatagramPacket outputPacket = new DatagramPacket( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.Socket; | |
public class SocketClient { | |
public static void main(String[] args){ | |
try { | |
Socket clientSocket = new Socket ("localhost",50001); | |
InputStream is = clientSocket.getInputStream(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
public class SocketServer { | |
public static final int SERVER_PORT = 50001; | |
public static void main (String[] args){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sriyank.mdccomponents | |
import android.content.Context | |
import android.util.AttributeSet | |
import android.view.MotionEvent | |
import android.view.View | |
import androidx.coordinatorlayout.widget.CoordinatorLayout | |
import androidx.customview.widget.ViewDragHelper | |
import java.util.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CallBackTask { | |
void PickiTonUriReturned(); | |
void PickiTonPreExecute(); | |
void PickiTonProgressUpdate(int progress); | |
void PickiTonPostExecute(String path, boolean wasDriveFile, boolean wasSuccessful, String reason); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PostModel extends AndroidViewModel { | |
@Nullable | |
private JsonLiveData postsList; | |
private int index; | |
public MutableLiveData getRefresh() { | |
return refresh; | |
} |