Android Open Source - schat Database Manager






From Project

Back to project page schat.

License

The source code is released under:

MIT License

If you think the Android project schat 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 data;
//from w  w w.  j a va 2 s  . c om
import data.contents.ChatContent;

import java.security.PublicKey;
import java.util.ArrayList;

/**
 * @author Gary Ye
 * @version 12/2/13
 */
public interface DatabaseManager {
    /**
     * Calls the given create script. The create script is only allowed to have DDL statements like
     * CREATE, DROP, ALTER.
     *
     * @param createScriptFile the filename of the create script
     */
    public void createTables(String createScriptFile);

    /**
     * Return the user from the given id
     *
     * @return null if the user was not found or otherwise the data of the user
     */
    public User getUserFromGivenId(String id);

    /**
     * Returns the public of the given user
     *
     * @param id the given id
     * @return the public key of the given user
     */
    public PublicKey getPublicKeyFromId(String id);

    /**
     * Returns whether the user exists or not.
     *
     * @param id the given user id
     * @return whether the user exists or not
     */
    public boolean userExists(String id);

    /**
     * This method will insert the given user to the database.
     * Every attribute of the user will be inserted into.
     *
     * @param user the user
     */
    public void insertUser(User user);

    /**
     * Returns a list of all users in the lexicographical order from the database.
     *
     * @return all users in the lexicographical order as a list,
     */
    public ArrayList<User> loadUsers();

    /**
     * Remove the user with the given id from the database
     *
     * @param id the id of the user to remove
     * @return if the operation was successful
     */
    public boolean removeUser(String id);

    public void insertMessage(Message<ChatContent> chatContentMessage);

    public ArrayList<Message<ChatContent>> loadMessagesFromReceiver(String id);

    public ArrayList<Message<ChatContent>> loadMessagesFromSender(String id);

}




Java Source Code List

.ServerMain.java
com.activities.Activity_Chat.java
com.activities.Activity_ContactList.java
com.activities.ContactView.java
com.data.AddContact.java
com.data.AndroidSQLManager.java
com.data.ApplicationUser.java
com.data.ChatAdapter.java
com.data.ChatArrayList.java
com.data.MySQLiteHelper.java
com.security.AndroidKeyPairManager.java
com.security.PRNGFixes.java
com.services.MessageService.java
crypto.CryptoConstants.java
crypto.Cryptography.java
crypto.Envelope.java
crypto.SecureMessage.java
crypto.TestCrypto.java
data.ChatMessage.java
data.Content.java
data.DatabaseManager.java
data.KeyPairManager.java
data.Message.java
data.SQLiteManager.java
data.User.java
data.contents.ChatContent.java
data.contents.LoginSuccess.java
data.contents.Login.java
data.contents.PublicKeyRequest.java
data.contents.PublicKeyResponse.java
data.contents.Registration.java
networking.SChatClientListener.java
networking.SChatClientWriter.java
networking.SChatClient.java
networking.SChatServerThread.java
networking.SChatServer.java