Android Open Source - LicenseModuleChecker-Client-Android J S O N Reader






From Project

Back to project page LicenseModuleChecker-Client-Android.

License

The source code is released under:

<?xml version="1.0" encoding="UTF-8"?> <module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4"> <comp...

If you think the Android project LicenseModuleChecker-Client-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.asynhkm.productchecker.Util;
/*from   w ww. j  av  a  2 s .com*/
import org.json.JSONException;
import org.json.JSONObject;

public class JSONReader {
  private JSONObject j;
  private final static String key_user_name = "user_name", code = "id_code",
      expiry = "offer_expiry_date", stock_name = "stock_name",
      is_payment_done = "payment_done", warn = "warnings";

  public JSONReader(JSONObject j) {
    this.j = j;
  }

  public String to_dialog_string() throws JSONException {
    StringBuilder htmlContent = new StringBuilder();

    htmlContent.append("Name:");
    htmlContent.append(j.getString(key_user_name));
    htmlContent.append("\nID: ");
    htmlContent.append(j.getString(code));
    htmlContent.append("\nExpiry Date: ");
    htmlContent.append(j.getString(expiry));
    htmlContent.append("\nStock Title: ");
    htmlContent.append(j.getString(stock_name));

    String result = htmlContent.toString();
    return result;
  }

  public String to_dialog_string(boolean on_text_field) throws JSONException {
    StringBuilder htmlContent = new StringBuilder();

    htmlContent.append("Name:");
    htmlContent.append(j.getString(key_user_name));
    htmlContent.append("\nID: ");
    htmlContent.append(j.getString(code));
    htmlContent.append("\nExpiry Date: ");
    htmlContent.append(j.getString(expiry));
    htmlContent.append("\nStock Title: ");
    htmlContent.append(j.getString(stock_name));
    htmlContent.append("\nExtra Information: ");
    htmlContent.append(j.getString(is_payment_done));
    if (on_text_field) {
      htmlContent.append("\nWarnings: ");
      htmlContent.append(j.getString(warn));
    }
    String result = htmlContent.toString();
    return result;
  }
}




Java Source Code List

com.asynhkm.example.ApplicationTest.java
com.asynhkm.example.MainExample.java
com.asynhkm.productchecker.ApplicationTest.java
com.asynhkm.productchecker.PreferenceControl.java
com.asynhkm.productchecker.Checker.CheckerCB.java
com.asynhkm.productchecker.Checker.CheckerTask.java
com.asynhkm.productchecker.Checker.HKMCheckerPlugable.java
com.asynhkm.productchecker.Checker.param.java
com.asynhkm.productchecker.Util.JSONReader.java
com.asynhkm.productchecker.Util.RootDialog.java
com.asynhkm.productchecker.Util.Tool.java
com.asynhkm.productchecker.schema.DataProductVersion.java
com.asynhkm.productchecker.schema.RDataDeserialize.java
com.asynhkm.productchecker.schema.RRDeserialize.java
com.asynhkm.productchecker.schema.ReturnData.java
com.asynhkm.productchecker.schema.ReturnResult.java
com.asynhkm.productchecker.schema.requestCheck.java