/** Get device information * @param c * @return */public static void Setdeviceinfo (Context c,requestparams params) {Telephonymanager TM = (T Elephonymanager) C.getsystemservice (context.telephony_service); if (tm!=null) {try{params.add ("DeviceId", Tm.getdeviceid ());//device IMEI number Params.add ("Line1number", Tm.getline1number () )///Telephone number Params.add ("Subscriber", Getprovidersname (c));//Operator Params.add ("brand", Android.os.Build.BRAND);// Mobile phone brand Params.add ("model", Android.os.Build.MODEL);//Mobile Phone model Params.add ("Versioncode", Getversioncode (c) + "");// Application Version number Params.add ("Connecttype", Getconnecttype (c));//network connection mode}catch (Exception e) {log.e ("MyView", e.tostring ());}}}
A try catch is required, otherwise the information obtained by some models will not be caused by an exception.