Coder Social home page Coder Social logo

udpmulticast's Introduction

UDP Multicast text messenger

UDP Messenger by Giacomo Furlan.

This software is being distributed under the CC BY 3.0 licence.

You are not allowed to use this source code for pirate purposes.

This software is provided "as-is" and it comes with no warranties.

SDK versions

Minimum: 8

Target: 17

Android UDP multicast text messenger library

This library aims to send simple text messages to a multicast group just joining a WiFi network (which allows UDP packets transmission).

The message group is identified by a TAG, which is being set when the class is being constructed. It's up to the developer to analyse the packet and do whatever he/she likes.

Setup

  1. Include the library in your Android project
  2. Extend the UDPMessenger class implementing the abstract getIncomingMessageAnalyseRunnable method. The message to analyse is incomingMessage (type: Message)
  3. Instantiate an object of the extended UDPMessenger type (now for reference: myExtClassObj).

Sending messages

myExtClassObj.sendMessage("my message here")

Receiving messages

  1. start the receiver: myExtClassObj.startMessageReceiver()
  2. analyse the Message incomingMessage in the implemented Runnable getIncomingMessageAnalyseRunnable. Note that this runnable will be run in the main Looper.

Message class methods

  • String getTag(): gets the TAG used to identify the multicast group
  • String getMessage(): gets the message contained in the packet
  • long getEpochTime(): gets the time in epoch format of the message
  • InetAddress getSrcIp(): may be null, the address from which the packet is being sent from.
  • String toString(): "TAG EPOCH MESSAGE"

udpmulticast's People

Contributors

elegos avatar

Watchers

Joielechong avatar

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.