Android Open Source - TextSpam Conversation Model






From Project

Back to project page TextSpam.

License

The source code is released under:

Apache License

If you think the Android project TextSpam 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.andrew749.textspam.Database;
//ww w  . ja  va  2 s .  c  om
import android.util.Log;

import com.andrew749.textspam.Custom;

import java.util.ArrayList;

/**
 * Created by andrew on 08/12/13.
 */
public class ConversationModel {
    public long id;
    private String sendingString;
    private ArrayList<String> phoneNumbers = new ArrayList<String>();
    private String numberlist;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public void addphoneNumber(String phoneNumber) {
        phoneNumbers.add(phoneNumber);
    }

    public String getSendingString() {
        return sendingString;
    }

    public void setSendingString(String input) {
        sendingString = input;
    }

    public ArrayList<String> getPhoneNumbers() {
        return phoneNumbers;
    }

    public void setDBResult(String dbResult) {
        phoneNumbers = parseDbresult(dbResult);
    }

    public String getNumberString() {
        return numberlist;
    }

    public ArrayList<String> getResult() {
        return phoneNumbers;
    }

    public ArrayList<String> parseDbresult(String dbResult) {

        ArrayList<String> tempmodel = new ArrayList<String>();
        String tempString = "";
        numberlist = dbResult;
        for (int i = 0; i < dbResult.length(); i++) {
            if (dbResult.indexOf(",", i) > 0) {
                tempString = dbResult.substring(i, dbResult.indexOf(",", i));
                Log.d("number:", tempString);

                tempmodel.add(tempString);
                i = dbResult.indexOf(",", i);
            } else {
                tempString = dbResult.substring(i);
                tempmodel.add(tempString);
                i = dbResult.length();
            }
        }
        return tempmodel;
    }

    public ArrayList<Custom> getNumbersAsCustom() {
        ArrayList<Custom> temparray = new ArrayList<Custom>();
        for (String i : phoneNumbers) {
            temparray.add(new Custom(i));

        }
        return temparray;
    }

    @Override
    public String toString() {
        return sendingString + ": " + numberlist;
    }

}




Java Source Code List

com.andrew749.textspam.Custom.java
com.andrew749.textspam.MainActivity.java
com.andrew749.textspam.MessageReciever.java
com.andrew749.textspam.Messager.java
com.andrew749.textspam.SwipeDismissListViewTouchListener.java
com.andrew749.textspam.Adapters.AutoCompleteCursorAdapter.java
com.andrew749.textspam.Adapters.ContactListAdapter.java
com.andrew749.textspam.Database.ConversationModel.java
com.andrew749.textspam.Database.DataSource.java
com.andrew749.textspam.Database.DatabaseHelper.java
com.andrew749.textspam.Fragments.Conversations.java
com.andrew749.textspam.Fragments.QuickMessageFragment.java
com.andrew749.textspam.Fragments.TutorialActivity.java
com.inscription.ChangeLogDialog.java
com.inscription.WhatsNewDialog.java