|
@@ -11,6 +11,7 @@ import com.sheep.gamegroup.util.PreferenceUtils;
|
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
import com.sheep.gamegroup.util.UMConfigUtils;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
|
|
|
|
|
|
|
+import rx.Subscriber;
|
|
|
import rx.android.schedulers.AndroidSchedulers;
|
|
import rx.android.schedulers.AndroidSchedulers;
|
|
|
import rx.schedulers.Schedulers;
|
|
import rx.schedulers.Schedulers;
|
|
|
|
|
|
|
@@ -45,7 +46,7 @@ public class AppStatistics {
|
|
|
*
|
|
*
|
|
|
* @param subString
|
|
* @param subString
|
|
|
*/
|
|
*/
|
|
|
- public void sendDataToServer(int type,int subType,String subString){
|
|
|
|
|
|
|
+ synchronized public void sendDataToServer(int type,int subType,String subString){
|
|
|
String openid = PreferenceUtils.getPrefString(SheepApp.mContext, UMConfigUtils.LOGIN_OPENID,"");
|
|
String openid = PreferenceUtils.getPrefString(SheepApp.mContext, UMConfigUtils.LOGIN_OPENID,"");
|
|
|
|
|
|
|
|
String deviceId = DeviceUtil.getDeviceId(SheepApp.mContext);
|
|
String deviceId = DeviceUtil.getDeviceId(SheepApp.mContext);
|
|
@@ -56,13 +57,17 @@ public class AppStatistics {
|
|
|
jsonObject.put("type",type);
|
|
jsonObject.put("type",type);
|
|
|
jsonObject.put("subtype",subType);
|
|
jsonObject.put("subtype",subType);
|
|
|
jsonObject.put("substring",subString);
|
|
jsonObject.put("substring",subString);
|
|
|
-
|
|
|
|
|
|
|
+//System.out.println("sendDataToServer --> " + jsonObject.toString());
|
|
|
apiService.appEventTracking(jsonObject).subscribeOn(Schedulers.io())
|
|
apiService.appEventTracking(jsonObject).subscribeOn(Schedulers.io())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
- .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.mContext) {
|
|
|
|
|
|
|
+ .subscribe(new Subscriber<BaseMessage>() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onCompleted() {
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void onError(BaseMessage baseMessage) {
|
|
|
|
|
- System.out.println("sendDataToServer onError");
|
|
|
|
|
|
|
+ public void onError(Throwable throwable) {
|
|
|
|
|
+ System.out.println("sendDataToServer onError-->>"+throwable.toString());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|