Android Open Source - mirror-notify-android App Item






From Project

Back to project page mirror-notify-android.

License

The source code is released under:

Apache License

If you think the Android project mirror-notify-android 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.rahulrav.glassnotify;
// ww  w  .j  a  v a2  s  . com
import android.graphics.drawable.Drawable;
import com.rahulrav.glassnotify.util.Logger;
import org.json.JSONException;
import org.json.JSONObject;

public class AppItem {

  public String packageName;
  public String applicationLabel;
  public Drawable drawable;
  public boolean isWhitelisted;

  public static AppItem fromJSON(final JSONObject jobj) {
    if (jobj == null) {
      return null;
    }
    final AppItem item = new AppItem();
    item.packageName = jobj.optString("packageName", null);
    item.isWhitelisted = jobj.optBoolean("isWhiteListed", false);
    return item;
  }

  public JSONObject toJSON() {
    try {
      final JSONObject jobj = new JSONObject();
      jobj.put("packageName", this.packageName);
      jobj.put("isWhiteListed", this.isWhitelisted);
      return jobj;
    } catch (JSONException e) {
      Logger.e("Error creating JSONObject", e);
    }
    return null;
  }
}




Java Source Code List

com.rahulrav.glassnotify.AppItemAdapter.java
com.rahulrav.glassnotify.AppItemViewHolder.java
com.rahulrav.glassnotify.AppItem.java
com.rahulrav.glassnotify.MainActivity.java
com.rahulrav.glassnotify.NotificationListenerService.java
com.rahulrav.glassnotify.NotifierService.java
com.rahulrav.glassnotify.WhitelistActivity.java
com.rahulrav.glassnotify.util.IOUtils.java
com.rahulrav.glassnotify.util.Logger.java