Android Open Source - craft-support-email-intent Craft Support Email






From Project

Back to project page craft-support-email-intent.

License

The source code is released under:

MIT License

If you think the Android project craft-support-email-intent 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.yeokhengmeng.craftsupportemailintent;
//from   ww w.  ja  v  a  2 s  . c  o  m
import java.text.DateFormat;
import java.util.ArrayList;

import android.content.Context;

public class CraftSupportEmail extends CraftIntentEmail {


  private ArrayList<GetInfoAbstract> getInfos = new ArrayList<GetInfoAbstract>();
  
  private Context context;


  public CraftSupportEmail(Context context){
    this.context = context;
    initAllGetInfos(context);
  }

  public CraftSupportEmail(Context context, String recipient, String subject) {
    super(recipient, subject);
    this.context = context;
    initAllGetInfos(context);
  }

  public CraftSupportEmail(Context context, String recipient, String subject, String content) {
    super(recipient, subject, content);
    this.context = context;
    initAllGetInfos(context);
  }


  private void initAllGetInfos(Context context){
    getInfos.add(new GetInfoSummary(context));
    getInfos.add(new GetInfoWifi(context));
    getInfos.add(new GetInfoBluetooth(context));
    getInfos.add(new GetInfoLocation(context));
    getInfos.add(new GetInfoCarrier(context));
    getInfos.add(new GetInfoBattery(context));
  }
  
  public void appendAppDetailsToContent(DateFormat dateFormatForCompileTime){
    appendContent(getAppDetails(dateFormatForCompileTime));
  }
  
  public void appendMinimalDetailsToContent(){
    appendContent(getMinimalDetails());
  }
  
  public void appendMinimumDetailsToContent(){
    appendContent(getMinimumDetails());
  }

  public void appendBasicDetailsToContent(){
    appendContent(getBasicDetails());
  }

  public void appendAllDetailsToContent(){
    appendContent(getAllDetails());
  }
  
  public String getAppDetails(DateFormat dateFormatForCompileTime){
    GetInfoSummary summ = new GetInfoSummary(context);
    return summ.getPackageVersionAndName(null);
  }
  
  public String getMinimumDetails(){
    GetInfoSummary summ = new GetInfoSummary(context);
    return summ.getMinimumDetails();
  }
  
  public String getMinimalDetails(){
    GetInfoSummary summ = new GetInfoSummary(context);
    return summ.getMinimalDetails();
  }

  public String getBasicDetails(){

    StringBuffer buf = new StringBuffer();

    for(GetInfoAbstract info : getInfos){

      try{  
        buf.append(info.getBasicDetailsOnly() + "\n");
      } catch(Exception e){
        String message = e.getMessage();
        if(message!= null) {
          buf.append(message + "\n");
        } else {
          buf.append(info.getClass() + "\n");
        }
      }
    }

    return buf.toString();

  }

  public String getAllDetails(){

    StringBuffer buf = new StringBuffer();

    for(GetInfoAbstract info : getInfos){

      try{  
        buf.append(info.getAllDetails() + "\n");
      } catch(Exception e){
        String message = e.getMessage();
        if(message!= null) {
          buf.append(message + "\n");
        } else {
          buf.append(info.getClass() + "\n");
        }
      }
    }

    return buf.toString();

  }



}




Java Source Code List

com.lamerman.FileDialog.java
com.lamerman.SelectionMode.java
com.yeokhengmeng.craftsupportemailintent.CraftIntentEmail.java
com.yeokhengmeng.craftsupportemailintent.CraftSupportEmail.java
com.yeokhengmeng.craftsupportemailintent.GetInfoAbstract.java
com.yeokhengmeng.craftsupportemailintent.GetInfoBattery.java
com.yeokhengmeng.craftsupportemailintent.GetInfoBluetooth.java
com.yeokhengmeng.craftsupportemailintent.GetInfoCarrier.java
com.yeokhengmeng.craftsupportemailintent.GetInfoLocation.java
com.yeokhengmeng.craftsupportemailintent.GetInfoSummary.java
com.yeokhengmeng.craftsupportemailintent.GetInfoWifi.java
com.yeokhengmeng.craftsupportemailintent.MainActivity.java