add push idk

This commit is contained in:
wangmi 2016-12-21 21:37:26 +08:00
parent b8eb5043c6
commit 642034b8a5
11 changed files with 69 additions and 63 deletions

View File

@ -144,6 +144,8 @@ import com.qiyou.mb.android.utils.log.QLog;
import com.umeng.analytics.MobclickAgent;
import com.umeng.message.PushAgent;
import com.umeng.message.IUmengRegisterCallback;
import com.umeng.message.UTrack;
import com.umeng.message.ALIAS_TYPE;
//import com.qiyou.mb.android.service.TrackDbService;
public class QiYouApplication extends Application {
@ -3188,7 +3190,7 @@ public TypeStatistics getTracksStat(int trackType,long startDate,long endDate)
QLog.getLogger().d(dTAG,TAG+ " print cookies ~~ version():"+c.getVersion() );
}
*/
String token;// =Utils.encodeBase64(QiYouConstant.PV_ACCESS_TOKEN);
token =QiYouConstant.PV_ACCESS_TOKEN;

View File

@ -15,7 +15,7 @@ public final static String BASE_MD_URL = BASE_URL;//+"upload/";
public final static String BASE_STATIC_URL = BASE_URL +"staticmap/";
public final static String TENCENT_APP_ID = "1104563148";
// TODO Turn off when deploying.
public static boolean DEVELOPER_MODE = true;
public static boolean DEVELOPER_MODE = false;
public static boolean PLAYBACK_CAN_RECORD = false /*DEVELOPER_MODE*/ ;

View File

@ -15,6 +15,7 @@ public class NoteMessage {
private String userAlbum;
private String lastEditBy;
private int cateOwnerId ;
private int noteOwnerId;
public String getUserName() {
return userName;
}
@ -88,4 +89,10 @@ public class NoteMessage {
public void setCateOwnerId(int cateOwnerId) {
this.cateOwnerId = cateOwnerId;
}
public int getNoteOwnerId() {
return noteOwnerId;
}
public void setNoteOwnerId(int noteOwnerId) {
this.noteOwnerId = noteOwnerId;
}
}

View File

@ -1,53 +1,33 @@
package com.qiyou.mb.android.ui.fragments;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.RatingBar;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.Toast;
import com.baidu.mapapi.model.LatLng;
import com.google.gson.JsonSyntaxException;
import com.loopj.android.http.RequestParams;
import com.qiyou.mb.android.QiYouConstant;
import com.qiyou.mb.android.R;
import com.qiyou.mb.android.beans.Track;
import com.qiyou.mb.android.beans.basic.Activity_bean;
import com.qiyou.mb.android.beans.basic.GEO_bean;
import com.qiyou.mb.android.beans.basic.Media;
@ -64,6 +44,15 @@ import com.qiyou.mb.android.utils.log.QLog;
import com.qiyou.mb.android.utils.server.RestMethods;
import com.umeng.analytics.MobclickAgent;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ActivityDetail extends WebList_fragment /*TrackingBasic_fragment*/ {
@Override
@ -1120,7 +1109,7 @@ public class ActivityDetail extends WebList_fragment /*TrackingBasic_fragment*/
rest=RestMethods.ACT_P_ADD_MEMBER;
}
doMemberOperation(actId,userId, userName,rest);
doMemberOperation(actId,currentAct.getName(),currentAct.getUserId(),userId, userName,rest);
@ -1128,10 +1117,10 @@ public class ActivityDetail extends WebList_fragment /*TrackingBasic_fragment*/
@Override
void removeUser(int userId){
doMemberOperation(currentAct.getSvrNumber(),userId, "",RestMethods.ACT_P_DEL_MEMBER);
doMemberOperation(currentAct.getSvrNumber(),currentAct.getName(),currentAct.getUserId(),userId, activity.app.user.getUserbean().getUserName(),RestMethods.ACT_P_DEL_MEMBER);
}
void doMemberOperation(int svrId, int userId,String userName,final String restMethod){
void doMemberOperation(int svrId, String svrName,int ownerId,int userId,String userName,final String restMethod){
if(userId<=0||svrId<=0){
return;
@ -1141,7 +1130,9 @@ public class ActivityDetail extends WebList_fragment /*TrackingBasic_fragment*/
try {
json.put("svrId", String.valueOf(svrId));
json.put("userId", String.valueOf( userId));
json.put("ownerId", String.valueOf( ownerId));
json.put("userName", userName);
json.put("svrName", svrName);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@ -1261,8 +1252,8 @@ public class ActivityDetail extends WebList_fragment /*TrackingBasic_fragment*/
currentAct.setSvrNumber(svrNo);
doMemberOperation(svrNo,activity.app.user.getUserbean().getId(),activity.app.user.getUserbean().getUserName(), RestMethods.ACT_P_ADD_MEMBER);
doMemberOperation(svrNo,currentAct.getName(),currentAct.getUserId(),activity.app.user.getUserbean().getId(),activity.app.user.getUserbean().getUserName(), RestMethods.ACT_P_ADD_MEMBER);
writeActivitiesCache(currentAct);
if(!TextUtils.isEmpty(currentAct.getAlbum())){
setMD(currentAct.getAlbum(),0,null,null);

View File

@ -1,11 +1,5 @@
package com.qiyou.mb.android.ui.fragments;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
@ -14,16 +8,11 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import com.baidu.mapapi.model.LatLng;
import com.google.gson.JsonSyntaxException;
import com.loopj.android.http.RequestParams;
import com.qiyou.mb.android.QiYouConstant;
import com.qiyou.mb.android.R;
import com.qiyou.mb.android.beans.Track;
import com.qiyou.mb.android.beans.basic.Activity_bean;
import com.qiyou.mb.android.beans.basic.GEO_bean;
import com.qiyou.mb.android.beans.basic.Group_bean;
import com.qiyou.mb.android.beans.basic.Media;
@ -33,6 +22,12 @@ import com.qiyou.mb.android.utils.enums.BBSCate;
import com.qiyou.mb.android.utils.enums.mediaType;
import com.qiyou.mb.android.utils.server.RestMethods;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.FileNotFoundException;
import java.io.IOException;
public class GroupDetail extends ActivityDetail {
/*@Override
@ -374,13 +369,13 @@ public class GroupDetail extends ActivityDetail {
rest=RestMethods.GRP_P_ADD_MEMBER;
}
doMemberOperation(groupId,userId, userName,rest);
doMemberOperation(groupId,currentGroup.getName(),currentGroup.getUserId(),userId, userName,rest);
}
@Override
void removeUser(int userId){
doMemberOperation(currentGroup.getId(),userId, "",RestMethods.GRP_P_DEL_MEMBER);
doMemberOperation(currentGroup.getId(),currentGroup.getName(),currentGroup.getUserId(),userId, "",RestMethods.GRP_P_DEL_MEMBER);
}
@Override
@ -499,7 +494,7 @@ public class GroupDetail extends ActivityDetail {
currentGroup.setId(svrNo);
doMemberOperation(svrNo,activity.app.user.getUserbean().getId(),activity.app.user.getUserbean().getUserName(),
doMemberOperation(svrNo,currentGroup.getName(),currentGroup.getUserId(),activity.app.user.getUserbean().getId(),activity.app.user.getUserbean().getUserName(),
RestMethods.GRP_P_ADD_MEMBER);
if(!TextUtils.isEmpty(currentGroup.getAlbum())){

View File

@ -1,30 +1,16 @@
package com.qiyou.mb.android.ui.fragments;
import java.io.IOException;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.baidu.mapapi.model.LatLng;
import com.google.gson.JsonSyntaxException;
import com.loopj.android.http.RequestParams;
import com.qiyou.mb.android.QiYouConstant;
import com.qiyou.mb.android.R;
import com.qiyou.mb.android.beans.Track;
import com.qiyou.mb.android.beans.basic.Activity_bean;
import com.qiyou.mb.android.beans.basic.GEO_bean;
import com.qiyou.mb.android.beans.basic.Group_bean;
import com.qiyou.mb.android.utils.Utils;
import com.qiyou.mb.android.utils.enums.BBSCate;
@ -260,7 +246,7 @@ public class GroupHome extends ActivityHome {
@Override
void removeUser(int userId){
doMemberOperation(currentGroup.getId(),userId, "",RestMethods.GRP_P_DEL_MEMBER);
doMemberOperation(currentGroup.getId(),currentGroup.getName(),currentGroup.getUserId(),userId, activity.app.user.getUserbean().getUserName(),RestMethods.GRP_P_DEL_MEMBER);
}
// private int currentActTab;

View File

@ -29,6 +29,8 @@ import com.qiyou.mb.android.utils.log.QLog;
import com.qiyou.mb.android.utils.server.RestMethods;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import com.umeng.message.PushAgent;
import com.umeng.message.UTrack;
public class LoginFragment extends QiyouFragment {
@ -276,13 +278,14 @@ public class LoginFragment extends QiyouFragment {
activity.app.user.setUserbean(ub);
activity.app.updateUserPref(ub);
activity.app.setAuth();
updatePushAlias();
// initPrgDialog();
// activity.app.mStatistics=null;//new Statistics();
activity.app.isNewLogin=true;
activity.app.syncStatistics();
QLog.getLogger().d(dTAG, TAG+" response user:" +response.toString());
/* activity.app.updateUserPref(response.getInt("id"),
response.getString("mail"),
@ -310,7 +313,23 @@ public class LoginFragment extends QiyouFragment {
}
protected void updatePushAlias(){
if ( activity.app.user.getUserbean().getId() > 0) {
PushAgent mPushAgent = PushAgent.getInstance(activity);
String id = activity.app.user.getUserbean().getId()+"";
// id = 951+"";
mPushAgent.addAlias(id ,"i7lvid", new UTrack.ICallBack() {
@Override
public void onMessage(boolean isSuccess, String message) {
QLog.getLogger().d(dTAG, " alia is success ?" + isSuccess +"," + message);
}
});
}
}
String SCOPE = "get_simple_userinfo,add_topic";//所有权限用all
public void doQQLogin() {
IUiListener listener = new BaseUiListener() {

View File

@ -249,7 +249,7 @@ public class NoteNew extends NoteList {
NoteMessage msg;
if (isEdit) {
msg = currentMsg;
msg.setLastEditBy(getAuditInfo());
} else {
msg = new NoteMessage();
@ -258,7 +258,11 @@ public class NoteNew extends NoteList {
msg.setParentId(0);
msg.setCateOwnerId(currentNote.getCateOwnerId());
msg.setNoteId(currentNote.getId());
msg.setTitle(currentNote.getTitle());
}
msg.setNoteOwnerId(currentNote.getUserId());
msg.setLastEditBy(getAuditInfo());
String s = editBody.getText().toString();
if (!TextUtils.isEmpty(msg.getBody())
&& msg.getBody().equalsIgnoreCase(s)) {

View File

@ -240,6 +240,7 @@ public class RegistFragment extends LoginFragment/*QiyouFragment*/ {
// getFragmentManager().popBackStack();
// onBack();
// onBack();
updatePushAlias();
activity.isTabHome();
// activity.app.updateUserPref(response.getInt("id"),
// response.getString("mail"),

View File

@ -1 +0,0 @@
this is test.<2E><>9T><12>`yƩ<79><C6A9><08>1

View File

@ -1400,6 +1400,7 @@ protected void initialLiveViews(){
PolylineOptions ooPolyline =null;
int tsize =activity.app.playBack?6:8;
tsize = tsize *2;
if(linePoints.size()>1) {
ooPolyline = new PolylineOptions().width(tsize)
.points(linePoints).color(Color.argb(255, red, green, 255)) ;
@ -1486,6 +1487,7 @@ protected void initialLiveViews(){
}
int tsize =activity.app.playBack?4:8;
tsize = tsize *2;
PolylineOptions ooPolyline = new PolylineOptions().width(tsize)
.points(linePoints).color(isDrawAsistTrack?Color.GREEN:Color.RED) ;