Android Example Subnet Scanner

Discussion in 'Tutorials & Examples' started by Didier9, Aug 25, 2019.

  1. Didier9

    Didier9 Active Member Licensed User

    Here is a simple subnet scanner. It scans the current class C subnet for a particular port number and tries to open a connection.

    It logs all the IPs that are found to have that port open in a listview. I use it with my IoT gizmos on an Android 5.1 phone (just realize I have not tried on anything else).


    It is a little more complicated than it needs to be. For one, the Starter module is unnecessary. But this is the structure I use for my network-aware apps where I like the socket to be opened in Starter so that I can keep it open when switching activities.
    The Callback mechanism (Dispatch) can be used to steer the messages from the socket in the Starter module back to the proper, currently open activity.

    Attached Files:

    Last edited: Aug 25, 2019
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice