Giter Site home page Giter Site logo

android-udpsender's Introduction

android-udpsender

UDP Sender is a simple application to allow sending UDP packets.

Landscape Screenshot

It supports the implicit Intent Intent.ACTION_SENDTO with a udp://host:port/data format URI.

  • data is treated as hex if it starts with 0x.
  • If a string starting with 0x is to be sent it can be escaped as \0x

Added in v1.3.1 - Current in Beta see http://goo.gl/reibxw to join

  • Allow broadcast packets to be sent.
  • Fixed a bug causing a period to be prematurely inserted when entering an IP.

Added in v1.3

  • Added support for Tasker to do variable replacement for the host/port as well as the text.
  • Remembers your settings when you quit and re-launch the app.

Added in v1.2

  • Now supports multi line text messages.
  • Bugfix for Send button not working in Landscape mode.

Added in v1.1

  • Also acts as a plugin for Locale and Tasker.
  • Variable replacement is supported for the Tasker plugin in the text field.
  • Changed theme to Holo (Dark)
  • Removed unused permissions
  • Various tweaks/fixes

Tasker Integration

Tasker plugin support is now complete and should be straight forward to use.

Tasker Plugin

Alternatively UDP packets can be sent via Tasker with the Misc/Send Intent action.

Just set it up as follows:

  • Action = android.intent.action.SENDTO
  • Data = udp://host:port/data
  • Target = Activity

Tasker Intent

Example for a www.limitlessled.com Wi-Fi bridge at 192.168.1.100 to turn on all the white LEDs

  • Action = android.intent.action.SENDTO
  • Data = udp://192.168.1.100:50000/0x350055
  • Target = Activity

Tasker Example Project

Lights Scene

You can get a copy of my current Tasker project (or at least a portion of it) Lights.prj.xml that I'm using for controlling my lights.

To give you an idea of how I'm using it I have the following:

  • Gesture control via my launcher (Nova) to turn all lights on/off/full bright/night mode and dim/brighten lights.
  • Using the Scene shown above I can turn all/individual zones on/off and control bright/dim/warm/cool.
  • NOTE: A swipe up/down in the colored square controls a bright/dim ramp and left/right for warm/cool.
  • An NFC tag on my bed that when tapped will turn the lights off, or keep some in night mode if I have guests.
  • When my phone connects to the Wi-Fi, and it's between sunrise and sunset, my entry hall light is turned on.

NOTE: It should be obvious but you will need to edit this to use it

  • Insert your own Weather Underground API key instead of <YOURAPIKEYHERE>.

See http://www.wunderground.com/weather/api/d/docs for more info on getting one.

It's used by the "Get Sunrise/set" which is called once a day to update the global variables. I use this in "Check Night Time" to only turn my entry light on at night when I arrive home and connect to my Wi-Fi.

  • You'll want to replace the string for my SSID with your own. Search and replace C86241. Or remove the Stop commands that prevent things working when not on the correct Wi-Fi.

  • You'll obviously need to change IPs and Names to suit your setup.

  • Finally if you're using a device that has a different size screen (my S4 is 1920x1080) you'll need to edit the scene so it fits and adjust the maths for the gestures.

android-udpsender's People

Contributors

hastarin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-udpsender's Issues

No way to send broadcast packets

Currently UDP Sender doesn't allow to send packets to broadcast UDP addresses. This should be very easy to fix using DatagramSocket.setBroadcast()

Fetaure request

hi,
found your source by chance. if you ever proceed with this, maybe you want to consider my suggestion:

would like to have "profiles" or pre-stettings for IP+PORT+TEXT to call from ui.

this would allow not only to have one single text/IP/Port setting in UI and to send different messages from ui by fingertip.

good work, nevertheless, thanks.
ozett

doesn't work in landscape orientation

I have found a problem with your app, it silently breaks when the device is in landscape mode. I have confirmed this problem on both my phone and tablet - the data only gets sent out in portrait orientation. This is especially problematic when using a physical keyboard which forces the device to landscape mode, because it makes it unusable.

Based on the sound my device makes when the "send" button is tapped I don't think the send button is registering presses in landscape mode.

small bug: input IP

When you enter IP, if you enter the number 25 will be automatically added to the dot behind. ths

Using tasker variable for destination IP?

I access the app through Tasker's plugin menu, and tried to edit it in the configuration, but the keyboard that comes up only has numbers in it, and not the '%' needed for me to specify the variable.

I know that the 1.3 version added the tasker variable replacement, but I couldn't figure out how to do it. For now, I simply used the intent function.

Error after sending 1 command?

I keep getting an error when I try to use the tasker plugin. The standalone UDP app works fine when I try to turn off my Milight bulbs (text command 0x420x000x55) but whenever I use UDP sender in tasker (intent or tasker plugin) for just a simple off or on command (single action task), it works the fist time. However, every time after that, it gives an error:

java.net.SocketException: sendto failed: EPERM (Operation not permitted)

It usually (but not always) works if I try again in say 10 minutes.

Device: Samsung Galaxy S6 on Android 6.0.1

I think these guys found a fix to a similar issue: EsotericSoftware/kryonet#106

How to send multiline message ?

I have to send xPL message that looks like:

xpl-cmnd
{
hop=1
source=****
target=****
}

How to handle multiline ?? "\n" ?? or "%0d" or "%0a" or "%0d%0a" ??
I have tried the 3 ways without success.

Is not updated

Can make the UDP sender run in android studio, gradle version is updated.

Create a brother Plugin for UDP Receive?

The plugin will be a Blocking task,
so when it is run, it will wait till a UDP Message arrives...

With the addition of the Receiving plugin, we will be able to have 2 android devices communicating between them...

Thank you

UDP source port.

Could you add the possibility to specify the source/local port please? Now it is chosen random (by Android).
The app "UDP Sender / Receiver" from "JC Accounting & Innovative Technologies, Inc" has this feature, but this app is not usable as a plugin for Tasker ...

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.