Android Open Source - aperi Database Listener






From Project

Back to project page aperi.

License

The source code is released under:

Apache License

If you think the Android project aperi 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.hv15.aperi.interfaces;
/* ww w .ja va2s.c  o m*/
import java.util.ArrayList;

import com.hv15.aperi.services.SocketService;

/**
 * Interface for the SocketServer to interact with the SQLite Database
 * 
 * @author Hans-Nikolai Viessmann <hv15@hw.ac.uk>
 * @see SocketService
 */
public interface DatabaseListener
{
    /**
     * Add a new client to the database, or update an existing entry
     * 
     * @param mac
     *            The device's MAC address
     * @param ip
     *            The device's IP address
     */
    public void addClient(String mac, String ip);

    /**
     * Delete a client from the database
     * 
     * @param mac
     *            MAC address of device to be removed
     */
    public void delClient(String mac);

    /**
     * Drop the table in the database
     * <p>
     * <strong>This should only be done when the session is over</strong>
     */
    public void clearClients();

    /**
     * Get a list of clients
     * 
     * @return {@link ArrayList} of String arrays, format <code>{mac, ip}</code>
     */
    public ArrayList<String[]> getClients();

    /**
     * Get the number of rows in the database
     * 
     * @return number of rows
     */
    public int size();
}




Java Source Code List

com.hv15.aperi.AperiBroadcastReceiver.java
com.hv15.aperi.AperiMainActivity.java
com.hv15.aperi.DeviceListFragment.java
com.hv15.aperi.ItemDetailDialogFragment.java
com.hv15.aperi.SelfFragment.java
com.hv15.aperi.adaptors.TabsPagerAdaptor.java
com.hv15.aperi.database.DatabaseHelper.java
com.hv15.aperi.interfaces.DatabaseListener.java
com.hv15.aperi.interfaces.DeviceActionListener.java
com.hv15.aperi.interfaces.MacIpListener.java
com.hv15.aperi.network.NetPackage.java
com.hv15.aperi.services.FileTransferService.java
com.hv15.aperi.services.LocalSocketBinder.java
com.hv15.aperi.services.SocketService.java