Search in sources :

Example 16 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class MousePadPlugin method sendDoubleClick.

public void sendDoubleClick() {
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_MOUSEPAD_REQUEST);
    np.set("doubleclick", true);
    device.sendPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 17 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class BatteryPlugin method onCreate.

@Override
public boolean onCreate() {
    IntentFilter intentFilter = new IntentFilter();
    intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
    intentFilter.addAction(Intent.ACTION_BATTERY_LOW);
    intentFilter.addAction(Intent.ACTION_BATTERY_OKAY);
    Intent currentState = context.registerReceiver(receiver, intentFilter);
    receiver.onReceive(context, currentState);
    // Request new battery info from the linked device
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_BATTERY_REQUEST);
    np.set("request", true);
    device.sendPacket(np);
    return true;
}
Also used : IntentFilter(android.content.IntentFilter) Intent(android.content.Intent) NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 18 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class BigscreenPlugin method sendRight.

public void sendRight() {
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_MOUSEPAD_REQUEST);
    np.set("specialKey", SpecialKeysMap.get(KeyEvent.KEYCODE_DPAD_RIGHT));
    device.sendPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 19 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class BigscreenPlugin method sendSTT.

public void sendSTT(String content) {
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_BIGSCREEN_STT);
    np.set("type", "stt");
    np.set("content", content);
    device.sendPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Example 20 with NetworkPacket

use of org.kde.kdeconnect.NetworkPacket in project kdeconnect-android by KDE.

the class MprisPlugin method requestPlayerStatus.

private void requestPlayerStatus(String player) {
    NetworkPacket np = new NetworkPacket(PACKET_TYPE_MPRIS_REQUEST);
    np.set("player", player);
    np.set("requestNowPlaying", true);
    np.set("requestVolume", true);
    device.sendPacket(np);
}
Also used : NetworkPacket(org.kde.kdeconnect.NetworkPacket)

Aggregations

NetworkPacket (org.kde.kdeconnect.NetworkPacket)77 IOException (java.io.IOException)6 SSLSocket (javax.net.ssl.SSLSocket)4 SMSHelper (org.kde.kdeconnect.Helpers.SMSHelper)4 BufferedReader (java.io.BufferedReader)3 InputStreamReader (java.io.InputStreamReader)3 ServerSocket (java.net.ServerSocket)3 Socket (java.net.Socket)3 SocketException (java.net.SocketException)3 ArrayList (java.util.ArrayList)3 Timer (java.util.Timer)3 SuppressLint (android.annotation.SuppressLint)2 Uri (android.net.Uri)2 SmsMessage (android.telephony.SmsMessage)2 SpannableString (android.text.SpannableString)2 InputStream (java.io.InputStream)2 OutputStream (java.io.OutputStream)2 DatagramSocket (java.net.DatagramSocket)2 InetAddress (java.net.InetAddress)2 InetSocketAddress (java.net.InetSocketAddress)2