Android Open Source - Android-Network-Intents Discovery Adapter






From Project

Back to project page Android-Network-Intents.

License

The source code is released under:

Apache License

If you think the Android project Android-Network-Intents listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.androidzeitgeist.ani.discovery;
//from w w w .j a  v a  2 s.  c o m
import java.net.InetAddress;

import android.content.Intent;

/**
 * This adapter class provides empty implementations of the methods from
 * {@link DiscoveryListener}.
 *
 * Any custom listener that cares only about a subset of the methods of this listener
 * can simply subclass this adapter class instead of implementing the interface
 * directly.
 *
 * @author Sebastian Kaspari <s.kaspari@gmail.com>
 */
public abstract class DiscoveryAdapter implements DiscoveryListener {
    /**
     * Called when the {@link Discovery} has successfully received an {@link Intent}.
     *
     * @param address The IP address of the sender of the {@link Intent}.
     * @param intent The received {@link Intent}.
     */
    @Override
    public abstract void onIntentDiscovered(InetAddress address, Intent intent);

    /**
     * The {@link Discovery} has been started and is now waiting for incoming
     * {@link Intent}s.
     *
     * Empty default implementation.
     */
    @Override
    public void onDiscoveryStarted() {
        // Empty default implementation
    }

    /**
     * The {@link Discovery} has been stopped.
     *
     * Empty default implementation.
     */
    @Override
    public void onDiscoveryStopped() {
        // Empty default implementation
    }

    /**
     * An unrecoverable error occured. The {@link Discovery} is going to be stopped.
     *
     * Empty default implementation.
     *
     * @param exception Actual exception that occured in the background thread
     */
    @Override
    public void onDiscoveryError(Exception exception) {
        // Empty default implementation
    }
}




Java Source Code List

com.androidzeitgeist.ani.discovery.DiscoveryAdapter.java
com.androidzeitgeist.ani.discovery.DiscoveryException.java
com.androidzeitgeist.ani.discovery.DiscoveryListener.java
com.androidzeitgeist.ani.discovery.DiscoveryThread.java
com.androidzeitgeist.ani.discovery.Discovery.java
com.androidzeitgeist.ani.internal.AndroidNetworkIntents.java
com.androidzeitgeist.ani.sample.intentchat.ChatActivity.java
com.androidzeitgeist.ani.transmitter.TransmitterException.java
com.androidzeitgeist.ani.transmitter.Transmitter.java