/**
* Get app Crash exception report
*
* @param ex
* @return
*/
Private String Getcrashreport (context context, throwable ex) {
PackageInfo pinfo = getpackageinfo (context);
StringBuffer exceptionstr = new StringBuffer ();
Exceptionstr.append ("Version:" +Pinfo.versionname+ "("//version number of the current app.) Corresponds to the version number set in the manifest
+ Pinfo.versioncode + ") \ n");
Exceptionstr.append ("Android:" +Android.os.Build.VERSION.RELEASEVersion number of the system
+ "(" +Android.os.Build.MODEL+ ") \ n"); Phone model
Exceptionstr.append ("Exception:" + ex.getmessage () + "\ n");
stacktraceelement[] elements = Ex.getstacktrace ();
for (int i = 0; i < elements.length; i++) {
Exceptionstr.append (elements[i].tostring () + "\ n");
}
return exceptionstr.tostring ();
}
/**
* Get Mobile Information
*/
public void Getphoneinfo ()
{
Telephonymanager TM = (Telephonymanager) this.getsystemservice (Telephony_service);
String mtyb = android.os.build.brand;//phone Brand
String mtype = Android.os.Build.MODEL; Phone model
String IMEI = Tm.getdeviceid ();
String IMSI = Tm.getsubscriberid ();
String Numer = Tm.getline1number (); Mobile phone number
String serviceName = Tm.getsimoperatorname (); Operators
Tvphoneinfo.settext ("Brand:" + mtyb + "\ n" + "model:" + mtype + "\ n" + "version: Android" + Android.os.Build.VERSION.RELEASE + "\ n "+" IMEI: "+ IMEI
+ "\ n" + "IMSI:" + IMSI + "\ n" + "mobile number:" + Numer + "\ n" + "operator:" + serviceName + "\ n");
}
Get the current app version number and system version number