Android Open Source - Amppercent7 I F Message






From Project

Back to project page Amppercent7.

License

The source code is released under:

GNU General Public License

If you think the Android project Amppercent7 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 my.amppercent.remoteservice;
/*from  w w  w. ja v  a 2 s  .  c o m*/
import org.jivesoftware.smack.packet.Message;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Messaggio tra mittente e destinatario
 * 
 * @author giacomo
 * 
 */
public class IFMessage implements Parcelable {
  private XUser mittente;
  private XUser destinat;
  private String body;

  public IFMessage(String mittuid, String destuid, String body) {

    this.mittente = new XUser(mittuid, mittuid);
    this.destinat = new XUser(destuid, destuid);
    this.body = body;
  }

  public IFMessage(Parcel purzel) {
    this.mittente = new XUser(purzel.readString(), purzel.readString());
    this.destinat = new XUser(purzel.readString(), purzel.readString());
    this.body = purzel.readString();
  }

  public IFMessage(Message androidmessage) {
    this(androidmessage.getFrom(), androidmessage.getTo(), androidmessage
        .getBody());
  }

  public IFMessage(Message androidmessage, String mittnick, String destnick) {
    this.mittente = new XUser(androidmessage.getFrom(), mittnick);
    this.mittente = new XUser(androidmessage.getTo(), destnick);
    this.body = androidmessage.getBody();
  }

  public XUser getMitt() {
    return this.mittente;
  }

  public XUser getDest() {
    return this.destinat;
  }

  public String getMessage() {
    return this.body;
  }

  public IFMessage setMittNick(String nick) {
    this.mittente.setNickname(nick);
    return this;
  }

  public String[] getArray() {
    String[] sa = new String[2];
    sa[0] = this.mittente.getNickname();
    sa[1] = this.body;
    return sa;
  }

  public static final Parcelable.Creator<IFMessage> CREATOR = new Parcelable.Creator<IFMessage>() {

    public IFMessage createFromParcel(Parcel arg0) {
      return new IFMessage(arg0);
    }

    public IFMessage[] newArray(int size) {
      return new IFMessage[size];
    }
  };

  public int describeContents() {
    return 0;
  }

  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.mittente.getJid());
    dest.writeString(this.mittente.getNickname());
    dest.writeString(this.destinat.getJid());
    dest.writeString(this.destinat.getNickname());
    dest.writeString(this.body);
  }
}




Java Source Code List

my.amppercent.adapters.AdapterChat.java
my.amppercent.adapters.AdapterElems.java
my.amppercent.adapters.AdapterIM.java
my.amppercent.adapters.AdapterUStatus.java
my.amppercent.adapters.ListViewAdapting.java
my.amppercent.adapters.ListView_XUser.java
my.amppercent.chatrequest.AvailabilitySettings.java
my.amppercent.chatrequest.SelectConnActivity.java
my.amppercent.chatrequest.connActivity.java
my.amppercent.chatrequest.serverActivity.java
my.amppercent.chattables.UberChat.java
my.amppercent.chattables.XConnect.java
my.amppercent.chattables.XRoster.java
my.amppercent.chattables.myChat.java
my.amppercent.project.Amppercent4Activity.java
my.amppercent.project.DownloadManager.java
my.amppercent.project.IBindRemoteService.java
my.amppercent.project.LaunchMe.java
my.amppercent.project.PrefActive.java
my.amppercent.project.TabFragment.java
my.amppercent.project.TextEntryActivity.java
my.amppercent.remoteservice.IFMessage.java
my.amppercent.remoteservice.IntentManage.java
my.amppercent.remoteservice.XUser.java
my.amppercent.remoteservice.chatAdapter.java
my.amppercent.types.Couple.java
my.amppercent.types.State.java
my.amppercent.types.myATask.java
my.amppercent.types.myNotification.java
my.amppercent.types.myYesNoDialog.java
my.amppercent.types.newActivity.java
org.jivesoftware.smackx.filetransfer.myOutgoingFileTransfer.java