Android Open Source - YourConsole M Text






From Project

Back to project page YourConsole.

License

The source code is released under:

MIT License

If you think the Android project YourConsole 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.akisute.yourconsole.app.model;
/*  w ww . j a v  a 2 s  .  c  om*/
import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;
import com.activeandroid.query.Delete;
import com.activeandroid.query.Select;
import com.akisute.yourconsole.app.intent.Intents;

import java.util.Date;
import java.util.List;

@Table(name = "MText")
public class MText extends Model {

    @Column(index = true, notNull = true)
    private Date mTimestamp;
    @Column(index = true, notNull = true)
    private String mSenderPackageName;
    @Column(notNull = true)
    private String mMimeType;
    @Column
    private String mText;

    public Date getTimestamp() {
        return mTimestamp;
    }

    public void setTimestamp(Date mTimestamp) {
        this.mTimestamp = mTimestamp;
    }

    public String getSenderPackageName() {
        return mSenderPackageName;
    }

    public void setSenderPackageName(String mSenderPackageName) {
        this.mSenderPackageName = mSenderPackageName;
    }

    public String getMimeType() {
        return mMimeType;
    }

    public void setMimeType(String mMimeType) {
        this.mMimeType = mMimeType;
    }

    public String getText() {
        return mText;
    }

    public void setText(String mText) {
        this.mText = mText;
    }

    public LogcatLine getLogcatLine() {
        if (Intents.MIME_TYPE_LOGCAT.equals(mMimeType)) {
            return LogcatLine.newLogLine(mText, true);
        } else {
            return null;
        }
    }

    public static MText newInstance(String senderPackageName, String mimeType, String text) {
        if (senderPackageName == null) {
            return null;
        }
        if (mimeType == null) {
            mimeType = Intents.MIME_TYPE_PLAINTEXT;
        }
        if (text == null) {
            return null;
        }
        MText instance = new MText();
        instance.setTimestamp(new Date());
        instance.setSenderPackageName(senderPackageName);
        instance.setMimeType(mimeType);
        instance.setText(text);
        return instance;
    }

    public static List<MText> getAll() {
        return new Select().from(MText.class).orderBy("mTimestamp ASC").execute();
    }

    public static void removeAll() {
        new Delete().from(MText.class).execute();
    }
}




Java Source Code List

com.akisute.yourconsole.app.AppModule.java
com.akisute.yourconsole.app.Application.java
com.akisute.yourconsole.app.ConsoleViewerFragment.java
com.akisute.yourconsole.app.LogcatRecordingService.java
com.akisute.yourconsole.app.MainActivity.java
com.akisute.yourconsole.app.SaveIntentService.java
com.akisute.yourconsole.app.dagger.DaggeredActivity.java
com.akisute.yourconsole.app.dagger.DaggeredApplicationModule.java
com.akisute.yourconsole.app.dagger.DaggeredApplication.java
com.akisute.yourconsole.app.dagger.DaggeredFragment.java
com.akisute.yourconsole.app.dagger.DaggeredIntentService.java
com.akisute.yourconsole.app.dagger.DaggeredService.java
com.akisute.yourconsole.app.dagger.ForApplication.java
com.akisute.yourconsole.app.dagger.ForInjecting.java
com.akisute.yourconsole.app.helper.LogcatHelper.java
com.akisute.yourconsole.app.helper.RuntimeHelper.java
com.akisute.yourconsole.app.intent.Intents.java
com.akisute.yourconsole.app.model.ConsoleListAdapter.java
com.akisute.yourconsole.app.model.LogcatLine.java
com.akisute.yourconsole.app.model.LogcatRecordingManager.java
com.akisute.yourconsole.app.model.MText.java
com.akisute.yourconsole.app.reader.LogcatReader.java
com.akisute.yourconsole.app.reader.SingleLogcatReader.java
com.akisute.yourconsole.app.util.GlobalEventBus.java
com.akisute.yourconsole.app.util.GlobalPreference.java