Commit 5750ce3862b0873cc0ef55ece46e48a6c530ef7d
1 parent
9c450bb01a
Exists in
master
获取版本信息接口,和AIDL生成JAR处理
Showing
29 changed files
with
620 additions
and
46 deletions
Show diff stats
PersonalCenter/.idea/gradle.xml
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | <option value="$PROJECT_DIR$" /> |
12 | 12 | <option value="$PROJECT_DIR$/app" /> |
13 | 13 | <option value="$PROJECT_DIR$/circledialog" /> |
14 | + <option value="$PROJECT_DIR$/mypresonallibrary" /> | |
14 | 15 | <option value="$PROJECT_DIR$/pickerview" /> |
15 | 16 | </set> |
16 | 17 | </option> | ... | ... |
PersonalCenter/.idea/misc.xml
... | ... | @@ -37,7 +37,7 @@ |
37 | 37 | <ConfirmationsSetting value="0" id="Add" /> |
38 | 38 | <ConfirmationsSetting value="0" id="Remove" /> |
39 | 39 | </component> |
40 | - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
40 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | |
41 | 41 | <output url="file://$PROJECT_DIR$/build/classes" /> |
42 | 42 | </component> |
43 | 43 | <component name="ProjectType"> | ... | ... |
PersonalCenter/.idea/modules.xml
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | <module fileurl="file://$PROJECT_DIR$/PersonalCenter.iml" filepath="$PROJECT_DIR$/PersonalCenter.iml" /> |
6 | 6 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> |
7 | 7 | <module fileurl="file://$PROJECT_DIR$/circledialog/circledialog.iml" filepath="$PROJECT_DIR$/circledialog/circledialog.iml" /> |
8 | + <module fileurl="file://$PROJECT_DIR$/mypresonallibrary/mypresonallibrary.iml" filepath="$PROJECT_DIR$/mypresonallibrary/mypresonallibrary.iml" /> | |
8 | 9 | <module fileurl="file://$PROJECT_DIR$/pickerview/pickerview.iml" filepath="$PROJECT_DIR$/pickerview/pickerview.iml" /> |
9 | 10 | </modules> |
10 | 11 | </component> | ... | ... |
PersonalCenter/app/build.gradle
PersonalCenter/app/src/main/AndroidManifest.xml
... | ... | @@ -122,14 +122,11 @@ |
122 | 122 | android:screenOrientation="landscape"> |
123 | 123 | |
124 | 124 | </activity> |
125 | - <service | |
126 | - android:name="com.hjx.personalcenter.service.TestService" | |
127 | - android:process=":remote" | |
128 | - > | |
125 | + <service android:name="com.hjx.personalcenter.service.CenterService" | |
126 | + android:enabled="true" | |
127 | + android:exported="true"> | |
129 | 128 | <intent-filter> |
130 | - <action android:name="com.hjx.personalcenter.service.GetLoginInfoService"> | |
131 | - | |
132 | - </action> | |
129 | + <action android:name="com.hjx.mypresonallibrary.ICenterService"/> | |
133 | 130 | </intent-filter> |
134 | 131 | </service> |
135 | 132 | ... | ... |
PersonalCenter/app/src/main/aidl/com/hjx/personalcenter/service/IPresonalInterface.aidl
PersonalCenter/app/src/main/java/com/hjx/personalcenter/activity/MyApplication.java
... | ... | @@ -35,6 +35,7 @@ public class MyApplication extends Application { |
35 | 35 | instance = this; |
36 | 36 | CrashReport.initCrashReport(getApplicationContext(), "c2170557a0", false); |
37 | 37 | CrashHandler crashHandler = CrashHandler.getInstance(); |
38 | + //生成错误日志,测试的时候得放开 | |
38 | 39 | crashHandler.init(getApplicationContext()); |
39 | 40 | crashHandler.registerHandler(new CrashHandler.ExceptionHandler() { |
40 | 41 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/adapter/VersionAdapter.java
... | ... | @@ -0,0 +1,65 @@ |
1 | +package com.hjx.personalcenter.adapter; | |
2 | + | |
3 | +import android.content.Context; | |
4 | +import android.view.View; | |
5 | +import android.view.ViewGroup; | |
6 | +import android.widget.BaseAdapter; | |
7 | +import android.widget.TextView; | |
8 | + | |
9 | +import com.hjx.personalcenter.R; | |
10 | +import com.hjx.personalcenter.model.VersionInfo; | |
11 | + | |
12 | +import java.util.ArrayList; | |
13 | + | |
14 | +/** | |
15 | + * Created by l on 2017/7/18. | |
16 | + */ | |
17 | + | |
18 | +public class VersionAdapter extends BaseAdapter { | |
19 | + ArrayList<VersionInfo.DataBean> objects; | |
20 | + private Context context; | |
21 | + | |
22 | + public VersionAdapter(ArrayList<VersionInfo.DataBean> objects, Context context) { | |
23 | + this.objects = objects; | |
24 | + this.context = context; | |
25 | + } | |
26 | + | |
27 | + @Override | |
28 | + public int getCount() { | |
29 | + return objects.size(); | |
30 | + } | |
31 | + | |
32 | + @Override | |
33 | + public Object getItem(int position) { | |
34 | + return position; | |
35 | + } | |
36 | + | |
37 | + @Override | |
38 | + public long getItemId(int position) { | |
39 | + return position; | |
40 | + } | |
41 | + | |
42 | + @Override | |
43 | + public View getView(final int position, View convertView, ViewGroup parent) { | |
44 | + | |
45 | + ViewHolder holder = null; | |
46 | + | |
47 | + if (convertView == null) { | |
48 | + convertView = View.inflate(context, R.layout.custom_adilog_list_item, null); | |
49 | + holder = new ViewHolder(); | |
50 | + holder.nameText = (TextView) convertView.findViewById(R.id.list_items); | |
51 | + convertView.setTag(holder); | |
52 | + } else { | |
53 | + holder = (VersionAdapter.ViewHolder) convertView.getTag(); | |
54 | + } | |
55 | + | |
56 | + holder.nameText.setText(objects.get(position).getPressName()); | |
57 | + | |
58 | + return convertView; | |
59 | + } | |
60 | + | |
61 | + | |
62 | + static class ViewHolder { | |
63 | + TextView nameText; | |
64 | + } | |
65 | +} | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/customdialog/VerSionDialog.java
... | ... | @@ -0,0 +1,105 @@ |
1 | +package com.hjx.personalcenter.customdialog; | |
2 | + | |
3 | +import android.content.Context; | |
4 | +import android.graphics.Color; | |
5 | +import android.os.Bundle; | |
6 | +import android.os.Handler; | |
7 | +import android.os.Message; | |
8 | +import android.util.Log; | |
9 | +import android.view.Gravity; | |
10 | +import android.view.LayoutInflater; | |
11 | +import android.view.View; | |
12 | +import android.view.ViewGroup; | |
13 | +import android.widget.AdapterView; | |
14 | +import android.widget.ImageView; | |
15 | +import android.widget.ListView; | |
16 | + | |
17 | +import com.hjx.personalcenter.R; | |
18 | +import com.hjx.personalcenter.adapter.VersionAdapter; | |
19 | +import com.hjx.personalcenter.db.SaveParam; | |
20 | +import com.hjx.personalcenter.http.HttpCode; | |
21 | +import com.hjx.personalcenter.http.HttpManager; | |
22 | +import com.hjx.personalcenter.interfaces.DialogCallBack; | |
23 | +import com.hjx.personalcenter.model.VersionInfo; | |
24 | +import com.mylhyl.circledialog.BaseCircleDialog; | |
25 | +import com.mylhyl.circledialog.res.values.CircleDimen; | |
26 | + | |
27 | +import java.util.ArrayList; | |
28 | +import java.util.List; | |
29 | + | |
30 | +/** | |
31 | + * 自定义版本信息列表对话框 | |
32 | + * Created by h on 2017/8/10. | |
33 | + */ | |
34 | + | |
35 | +public class VerSionDialog extends BaseCircleDialog implements AdapterView.OnItemClickListener { | |
36 | + private VersionAdapter listadapter; | |
37 | + private ImageView cance; | |
38 | + private ListView listView; | |
39 | + private ArrayList<VersionInfo.DataBean> data = new ArrayList<>(); | |
40 | + | |
41 | + private DialogCallBack.VersionCallBack mCallBack; | |
42 | + | |
43 | + Handler handler = new Handler(){ | |
44 | + @Override | |
45 | + public void handleMessage(Message msg) { | |
46 | + super.handleMessage(msg); | |
47 | + switch (msg.what){ | |
48 | + case HttpCode.VERSION_SUCESS: | |
49 | + data.clear(); | |
50 | + data.addAll( (List<VersionInfo.DataBean>)msg.obj); | |
51 | + listadapter.notifyDataSetChanged(); | |
52 | + | |
53 | + break; | |
54 | + } | |
55 | + } | |
56 | + }; | |
57 | + public VerSionDialog(DialogCallBack.VersionCallBack callBack) { | |
58 | + this.mCallBack = callBack; | |
59 | + } | |
60 | + | |
61 | + public static VerSionDialog getInstance(DialogCallBack.VersionCallBack callBack) { | |
62 | + VerSionDialog dialogFragment = new VerSionDialog(callBack); | |
63 | + dialogFragment.setCanceledBack(true); | |
64 | + dialogFragment.setCanceledOnTouchOutside(true); | |
65 | + dialogFragment.setRadius(CircleDimen.RADIUS); | |
66 | + dialogFragment.setWidth(0.5f); | |
67 | + dialogFragment.setGravity(Gravity.CENTER); | |
68 | + dialogFragment.setBackgroundColor(Color.WHITE); | |
69 | + return dialogFragment; | |
70 | + } | |
71 | + | |
72 | + @Override | |
73 | + public View createView(Context context, LayoutInflater inflater, ViewGroup container) { | |
74 | + return inflater.inflate(R.layout.custom_adilog_provicelist, container, false); | |
75 | + } | |
76 | + | |
77 | + @Override | |
78 | + public void onActivityCreated(Bundle savedInstanceState) { | |
79 | + super.onActivityCreated(savedInstanceState); | |
80 | + listView = (ListView) getView().findViewById(R.id.listadapter); | |
81 | + cance = (ImageView) getView().findViewById(R.id.cancel); | |
82 | + listadapter = new VersionAdapter(data,getActivity()); | |
83 | + listView.setAdapter(listadapter); | |
84 | + listView.setOnItemClickListener(this); | |
85 | + cance.setOnClickListener(new View.OnClickListener() { | |
86 | + @Override | |
87 | + public void onClick(View v) { | |
88 | + dismiss(); | |
89 | + } | |
90 | + }); | |
91 | + String subjectName = SaveParam.getInstance().getLoginParam(getActivity(),SaveParam.VERSION); | |
92 | + Log.e("test","选择的科目"+subjectName); | |
93 | + HttpManager.getInstance().versioninfo(getActivity(),subjectName,handler); | |
94 | + | |
95 | + } | |
96 | + | |
97 | + @Override | |
98 | + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | |
99 | + //Toast.makeText(getActivity(), "你点击了第" + position + "个", Toast.LENGTH_LONG).show(); | |
100 | + //SaveParam.getInstance().saveLoginParam(getActivity(), SaveParam.PROVINCES, ""+data.get(position).getRegionId()); | |
101 | + mCallBack.versionOnItemClick(data,position,1); | |
102 | + dismiss(); | |
103 | + | |
104 | + } | |
105 | +} | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/db/SaveParam.java
PersonalCenter/app/src/main/java/com/hjx/personalcenter/fragment/VersionsInfoFragment.java
... | ... | @@ -6,10 +6,16 @@ import android.support.v4.app.Fragment; |
6 | 6 | import android.view.LayoutInflater; |
7 | 7 | import android.view.View; |
8 | 8 | import android.view.ViewGroup; |
9 | +import android.widget.AdapterView; | |
9 | 10 | import android.widget.GridView; |
10 | 11 | import android.widget.SimpleAdapter; |
11 | 12 | |
12 | 13 | import com.hjx.personalcenter.R; |
14 | +import com.hjx.personalcenter.customdialog.VerSionDialog; | |
15 | +import com.hjx.personalcenter.db.SaveParam; | |
16 | +import com.hjx.personalcenter.interfaces.DialogCallBack; | |
17 | +import com.hjx.personalcenter.model.VersionInfo; | |
18 | +import com.hjx.personalcenter.util.AlertUtils; | |
13 | 19 | |
14 | 20 | import java.util.ArrayList; |
15 | 21 | import java.util.HashMap; |
... | ... | @@ -20,7 +26,7 @@ import java.util.Map; |
20 | 26 | * Created by h on 2017/8/12. |
21 | 27 | */ |
22 | 28 | |
23 | -public class VersionsInfoFragment extends Fragment { | |
29 | +public class VersionsInfoFragment extends Fragment implements AdapterView.OnItemClickListener,DialogCallBack.VersionCallBack { | |
24 | 30 | private GridView gridView; |
25 | 31 | private List<Map<String, Object>> data_list; |
26 | 32 | private SimpleAdapter sim_adapter; |
... | ... | @@ -85,5 +91,52 @@ public class VersionsInfoFragment extends Fragment { |
85 | 91 | return data_list; |
86 | 92 | } |
87 | 93 | private void setLister() { |
94 | + gridView.setOnItemClickListener(this); | |
95 | + } | |
96 | + | |
97 | + @Override | |
98 | + public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | |
99 | + switch (position){ | |
100 | + | |
101 | + case 0: | |
102 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"语文"); | |
103 | + break; | |
104 | + case 1: | |
105 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"数学"); | |
106 | + break; | |
107 | + case 2: | |
108 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"英语"); | |
109 | + break; | |
110 | + case 3: | |
111 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"物理"); | |
112 | + break; | |
113 | + case 4: | |
114 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"化学"); | |
115 | + break; | |
116 | + case 5: | |
117 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"生物"); | |
118 | + break; | |
119 | + case 6: | |
120 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"政治"); | |
121 | + break; | |
122 | + case 7: | |
123 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"历史"); | |
124 | + break; | |
125 | + case 8: | |
126 | + SaveParam.getInstance().saveLoginParam(getActivity(),SaveParam.VERSION,"地理"); | |
127 | + break; | |
128 | + } | |
129 | + | |
130 | + VerSionDialog.getInstance((DialogCallBack.VersionCallBack) this).show(getChildFragmentManager(), "VerSionDialog"); | |
131 | + | |
132 | + } | |
133 | + | |
134 | + @Override | |
135 | + public void versionOnItemClick(ArrayList<VersionInfo.DataBean> data, int position, int type) { | |
136 | + String regionName = data.get(position).getPressName(); | |
137 | + //SaveParam.getInstance().saveLoginParam(this, "sheng", regionName); | |
138 | + AlertUtils.showToast(getActivity(),regionName); | |
139 | + | |
140 | + | |
88 | 141 | } |
89 | 142 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpCode.java
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpManager.java
... | ... | @@ -30,6 +30,7 @@ import com.hjx.personalcenter.model.PesonalInfo; |
30 | 30 | import com.hjx.personalcenter.model.ProvinceInfo; |
31 | 31 | import com.hjx.personalcenter.model.SchoolInfo; |
32 | 32 | import com.hjx.personalcenter.model.SignInfo; |
33 | +import com.hjx.personalcenter.model.VersionInfo; | |
33 | 34 | import com.hjx.personalcenter.util.AlertUtils; |
34 | 35 | import com.hjx.personalcenter.util.DialogPermission; |
35 | 36 | import com.loopj.android.http.AsyncHttpResponseHandler; |
... | ... | @@ -1659,6 +1660,63 @@ public class HttpManager { |
1659 | 1660 | }); |
1660 | 1661 | |
1661 | 1662 | } |
1663 | + //版本信息 | |
1664 | + public void versioninfo(final Context mContext,String subjectName, final Handler handler) { | |
1665 | + HttpClient.getInstance().addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); | |
1666 | + HttpClient.getInstance().get(HttpUrl.getversionURL+"?subjectName="+subjectName, new AsyncHttpResponseHandler() { | |
1667 | + @Override | |
1668 | + public void onSuccess(int arg0, Header[] arg1, byte[] arg2) { | |
1669 | + Log.e("test", "版本信息" + new String(arg2)); | |
1670 | + try { | |
1671 | + JSONObject jsonObject = new JSONObject(new String(arg2)); | |
1672 | + int status = jsonObject.optInt("status"); | |
1673 | + if (status == 1) { | |
1674 | + VersionInfo versionInfo = GsonTool.getPerson(new String(arg2), VersionInfo.class);//解析json数据 | |
1675 | + List<VersionInfo.DataBean> versionInfoList = versionInfo.getData(); | |
1676 | + Message message = Message.obtain(); | |
1677 | + message.what = HttpCode.VERSION_SUCESS; | |
1678 | + message.obj = versionInfoList; | |
1679 | + handler.sendMessage(message); | |
1680 | + | |
1681 | + } else if(status == 1000){ | |
1682 | + AlertUtils.showToast(mContext, "你好,该科目没有版本信息"); | |
1683 | + | |
1684 | + }else { | |
1685 | + AlertUtils.showToast(mContext, "你好,服务器异常,请稍后重试!"); | |
1686 | + } | |
1687 | + } catch (JSONException e) { | |
1688 | + e.printStackTrace(); | |
1689 | + } | |
1690 | + | |
1691 | + | |
1692 | + } | |
1693 | + | |
1694 | + @Override | |
1695 | + public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) { | |
1696 | + new CircleDialog.Builder((FragmentActivity) mContext) | |
1697 | + .setCanceledOnTouchOutside(false) | |
1698 | + .setCancelable(false) | |
1699 | + .setWidth(0.5f) | |
1700 | + .configText(new ConfigText() { | |
1701 | + @Override | |
1702 | + public void onConfig(TextParams params) { | |
1703 | + params.gravity = Gravity.CENTER; | |
1704 | + params.padding = new int[]{50, 50, 50, 50}; | |
1705 | + } | |
1706 | + }) | |
1707 | + .setText("当前无网络,请检查网络设置") | |
1708 | + .setNegative("继续使用", null) | |
1709 | + .setPositive("设置网络", new View.OnClickListener() { | |
1710 | + @Override | |
1711 | + public void onClick(View v) { | |
1712 | + Intent intent = new Intent(Settings.ACTION_SETTINGS);//系统设置界面 | |
1713 | + mContext.startActivity(intent); | |
1714 | + } | |
1715 | + }) | |
1716 | + .show(); | |
1717 | + } | |
1718 | + }); | |
1719 | + } | |
1662 | 1720 | |
1663 | 1721 | |
1664 | 1722 | ///省级接口 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/http/HttpUrl.java
... | ... | @@ -38,6 +38,7 @@ public class HttpUrl { |
38 | 38 | public static String updateappURL=GetDomain()+"/general/release/version";//系统升级 |
39 | 39 | public static String headerURL=GetDomain()+"/profile/picture/update";//头像上传 |
40 | 40 | public static String headerdefaultURL=GetDomain()+"/profile/picture/default";//默认头像上传 |
41 | + public static String getversionURL=GetDomain()+"/press/list";//获取版本信息 | |
41 | 42 | |
42 | 43 | |
43 | 44 | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/interfaces/DialogCallBack.java
... | ... | @@ -8,6 +8,7 @@ import com.hjx.personalcenter.model.CountyInfo; |
8 | 8 | import com.hjx.personalcenter.model.GradeInfo; |
9 | 9 | import com.hjx.personalcenter.model.ProvinceInfo; |
10 | 10 | import com.hjx.personalcenter.model.SchoolInfo; |
11 | +import com.hjx.personalcenter.model.VersionInfo; | |
11 | 12 | |
12 | 13 | import java.util.ArrayList; |
13 | 14 | |
... | ... | @@ -36,4 +37,8 @@ public class DialogCallBack { |
36 | 37 | public interface CallBackView{ |
37 | 38 | void heard(Context context,View v,int headpitiaon); |
38 | 39 | } |
40 | + //出版社回调 | |
41 | + public interface VersionCallBack{ | |
42 | + void versionOnItemClick(ArrayList<VersionInfo.DataBean> data, int position, int type); | |
43 | + } | |
39 | 44 | } | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/model/VersionInfo.java
... | ... | @@ -0,0 +1,92 @@ |
1 | +package com.hjx.personalcenter.model; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | +import java.util.List; | |
5 | + | |
6 | +/** | |
7 | + * Created by h on 2017/9/9. | |
8 | + */ | |
9 | + | |
10 | +public class VersionInfo implements Serializable{ | |
11 | + | |
12 | + | |
13 | + /** | |
14 | + * status : 1 | |
15 | + * pageSize : 0 | |
16 | + * data : [{"pressName":"外语教学与研究出版社","pressCover":""},{"pressName":"文汇出版社","pressCover":""},{"pressName":"北京出版社","pressCover":""},{"pressName":"北京出版社_北京教育出版社","pressCover":""},{"pressName":"北京师范大学出版社","pressCover":""},{"pressName":"上海译文出版社","pressCover":""},{"pressName":"接力出版社","pressCover":""},{"pressName":"重庆大学出版社","pressCover":""},{"pressName":"教育科学出版社","pressCover":""},{"pressName":"黑龙江少年儿童出版社","pressCover":""},{"pressName":"人民教育出版社","pressCover":""},{"pressName":"福建教育出版社","pressCover":""},{"pressName":"广东人民出版社","pressCover":""},{"pressName":"中国大百科全书出版社","pressCover":""},{"pressName":"河北教育出版社","pressCover":""},{"pressName":"湖北教育出版社","pressCover":""},{"pressName":"湖南少年儿童出版社","pressCover":""},{"pressName":"湖南教育出版社_山东教育出版社","pressCover":""},{"pressName":"湖南教育出版社","pressCover":""},{"pressName":"西安交通大学出版社","pressCover":""},{"pressName":"高等教育出版社","pressCover":""},{"pressName":"辽宁师范大学出版社","pressCover":""},{"pressName":"科学普及出版社","pressCover":""},{"pressName":"西藏人民出版社","pressCover":""},{"pressName":"培生朗文出版社","pressCover":""},{"pressName":"清华大学出版社","pressCover":""},{"pressName":"上海外语教育出版社","pressCover":""},{"pressName":"上海教育出版社","pressCover":""},{"pressName":"四川人民出版社","pressCover":""},{"pressName":"四川教育出版社","pressCover":""},{"pressName":"山东教育出版社","pressCover":""},{"pressName":"山东科学技术出版社","pressCover":""},{"pressName":"外语教学与研究出版社_广东教育出版社","pressCover":""},{"pressName":"陕西旅游出版社","pressCover":""},{"pressName":"湖南潇影音像出版社","pressCover":""},{"pressName":"金盾出版社","pressCover":""},{"pressName":"外研教学与研究出版社_湖南教育出版社_培生朗文出版社","pressCover":""},{"pressName":"新蕾出版社","pressCover":""},{"pressName":"译林出版社","pressCover":""}] | |
17 | + * msg : success | |
18 | + * pageNum : 0 | |
19 | + */ | |
20 | + | |
21 | + private int status; | |
22 | + private int pageSize; | |
23 | + private String msg; | |
24 | + private int pageNum; | |
25 | + private List<DataBean> data; | |
26 | + | |
27 | + public int getStatus() { | |
28 | + return status; | |
29 | + } | |
30 | + | |
31 | + public void setStatus(int status) { | |
32 | + this.status = status; | |
33 | + } | |
34 | + | |
35 | + public int getPageSize() { | |
36 | + return pageSize; | |
37 | + } | |
38 | + | |
39 | + public void setPageSize(int pageSize) { | |
40 | + this.pageSize = pageSize; | |
41 | + } | |
42 | + | |
43 | + public String getMsg() { | |
44 | + return msg; | |
45 | + } | |
46 | + | |
47 | + public void setMsg(String msg) { | |
48 | + this.msg = msg; | |
49 | + } | |
50 | + | |
51 | + public int getPageNum() { | |
52 | + return pageNum; | |
53 | + } | |
54 | + | |
55 | + public void setPageNum(int pageNum) { | |
56 | + this.pageNum = pageNum; | |
57 | + } | |
58 | + | |
59 | + public List<DataBean> getData() { | |
60 | + return data; | |
61 | + } | |
62 | + | |
63 | + public void setData(List<DataBean> data) { | |
64 | + this.data = data; | |
65 | + } | |
66 | + | |
67 | + public static class DataBean { | |
68 | + /** | |
69 | + * pressName : 外语教学与研究出版社 | |
70 | + * pressCover : | |
71 | + */ | |
72 | + | |
73 | + private String pressName; | |
74 | + private String pressCover; | |
75 | + | |
76 | + public String getPressName() { | |
77 | + return pressName; | |
78 | + } | |
79 | + | |
80 | + public void setPressName(String pressName) { | |
81 | + this.pressName = pressName; | |
82 | + } | |
83 | + | |
84 | + public String getPressCover() { | |
85 | + return pressCover; | |
86 | + } | |
87 | + | |
88 | + public void setPressCover(String pressCover) { | |
89 | + this.pressCover = pressCover; | |
90 | + } | |
91 | + } | |
92 | +} | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/service/BaseService.java
... | ... | @@ -0,0 +1,66 @@ |
1 | +/** | |
2 | + * HaoJiXing Teacher Q&A | |
3 | + * copyright(C)2013- Acorn International | |
4 | + * | |
5 | + * packeage:com.ozing.center.service.BaseService.java | |
6 | + * create:2013年11月5日下午6:05:40 | |
7 | + */ | |
8 | +package com.hjx.personalcenter.service; | |
9 | + | |
10 | +import android.app.Service; | |
11 | +import android.content.Intent; | |
12 | +import android.content.res.Configuration; | |
13 | +import android.os.IBinder; | |
14 | + | |
15 | +/** | |
16 | + * @author jixiaolong<jixiaolong@chinadrtv.com> | |
17 | + * @code: 015261 | |
18 | + */ | |
19 | +public class BaseService extends Service { | |
20 | + | |
21 | + @Override | |
22 | + public IBinder onBind(Intent intent) { | |
23 | + return null; | |
24 | + } | |
25 | + | |
26 | + @Override | |
27 | + public void onCreate() { | |
28 | + // TODO Auto-generated method stub | |
29 | + super.onCreate(); | |
30 | + } | |
31 | + | |
32 | + @Override | |
33 | + public int onStartCommand(Intent intent, int flags, int startId) { | |
34 | + return super.onStartCommand(intent, flags, startId); | |
35 | + }; | |
36 | + | |
37 | + @Override | |
38 | + public void onDestroy() { | |
39 | + super.onDestroy(); | |
40 | + } | |
41 | + | |
42 | + @Override | |
43 | + public boolean onUnbind(Intent intent) { | |
44 | + // TODO Auto-generated method stub | |
45 | + return super.onUnbind(intent); | |
46 | + } | |
47 | + | |
48 | + @Override | |
49 | + public void onLowMemory() { | |
50 | + // TODO Auto-generated method stub | |
51 | + super.onLowMemory(); | |
52 | + } | |
53 | + | |
54 | + @Override | |
55 | + public void onRebind(Intent intent) { | |
56 | + // TODO Auto-generated method stub | |
57 | + super.onRebind(intent); | |
58 | + } | |
59 | + | |
60 | + @Override | |
61 | + public void onConfigurationChanged(Configuration newConfig) { | |
62 | + // TODO Auto-generated method stub | |
63 | + super.onConfigurationChanged(newConfig); | |
64 | + } | |
65 | + | |
66 | +} | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/service/CenterService.java
... | ... | @@ -0,0 +1,41 @@ |
1 | +package com.hjx.personalcenter.service; | |
2 | + | |
3 | +import android.content.Intent; | |
4 | +import android.os.IBinder; | |
5 | +import android.os.RemoteException; | |
6 | + | |
7 | +/** | |
8 | + * Created by h on 2017/9/1. | |
9 | + */ | |
10 | + | |
11 | +public class CenterService extends BaseService { | |
12 | + public CenterService(){ | |
13 | + | |
14 | + } | |
15 | + IPresonalInterface.Stub binder = new IPresonalInterface.Stub() { | |
16 | + @Override | |
17 | + public String sayHello() throws RemoteException { | |
18 | + return "这是测试AIDL的方法"; | |
19 | + } | |
20 | + | |
21 | + @Override | |
22 | + public String viewPage(String action) throws RemoteException { | |
23 | + return null; | |
24 | + } | |
25 | + | |
26 | + @Override | |
27 | + public String getSimpleUser() throws RemoteException { | |
28 | + return null; | |
29 | + } | |
30 | + | |
31 | + @Override | |
32 | + public String getcardUser() throws RemoteException { | |
33 | + return null; | |
34 | + } | |
35 | + }; | |
36 | + | |
37 | + @Override | |
38 | + public IBinder onBind(Intent intent) { | |
39 | + return binder; | |
40 | + } | |
41 | +} | ... | ... |
PersonalCenter/app/src/main/java/com/hjx/personalcenter/service/TestService.java
... | ... | @@ -1,27 +0,0 @@ |
1 | -package com.hjx.personalcenter.service; | |
2 | - | |
3 | -import android.app.Service; | |
4 | -import android.content.Intent; | |
5 | -import android.os.IBinder; | |
6 | -import android.os.RemoteException; | |
7 | - | |
8 | -/** | |
9 | - * Created by h on 2017/9/1. | |
10 | - */ | |
11 | - | |
12 | -public class TestService extends Service { | |
13 | - public TestService(){ | |
14 | - | |
15 | - } | |
16 | - IPresonalInterface.Stub binder = new IPresonalInterface.Stub() { | |
17 | - @Override | |
18 | - public String sayHello() throws RemoteException { | |
19 | - return "这是测试AIDL的方法"; | |
20 | - } | |
21 | - }; | |
22 | - | |
23 | - @Override | |
24 | - public IBinder onBind(Intent intent) { | |
25 | - return binder; | |
26 | - } | |
27 | -} |
PersonalCenter/app/src/main/res/layout/fragment_changge_version_info_itmes.xml
PersonalCenter/mypresonallibrary/.gitignore
... | ... | @@ -0,0 +1 @@ |
1 | +/build | ... | ... |
PersonalCenter/mypresonallibrary/build.gradle
... | ... | @@ -0,0 +1,31 @@ |
1 | +apply plugin: 'com.android.library' | |
2 | + | |
3 | +android { | |
4 | + compileSdkVersion 25 | |
5 | + buildToolsVersion "25.0.3" | |
6 | + | |
7 | + defaultConfig { | |
8 | + minSdkVersion 15 | |
9 | + targetSdkVersion 25 | |
10 | + versionCode 1 | |
11 | + versionName "1.0" | |
12 | + | |
13 | + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
14 | + | |
15 | + } | |
16 | + buildTypes { | |
17 | + release { | |
18 | + minifyEnabled false | |
19 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
20 | + } | |
21 | + } | |
22 | +} | |
23 | + | |
24 | +dependencies { | |
25 | + compile fileTree(dir: 'libs', include: ['*.jar']) | |
26 | + androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | |
27 | + exclude group: 'com.android.support', module: 'support-annotations' | |
28 | + }) | |
29 | + compile 'com.android.support:appcompat-v7:25.3.1' | |
30 | + testCompile 'junit:junit:4.12' | |
31 | +} | ... | ... |
PersonalCenter/mypresonallibrary/proguard-rules.pro
... | ... | @@ -0,0 +1,17 @@ |
1 | +# Add project specific ProGuard rules here. | |
2 | +# By default, the flags in this file are appended to flags specified | |
3 | +# in C:\Users\h\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt | |
4 | +# You can edit the include path and order by changing the proguardFiles | |
5 | +# directive in build.gradle. | |
6 | +# | |
7 | +# For more details, see | |
8 | +# http://developer.android.com/guide/developing/tools/proguard.html | |
9 | + | |
10 | +# Add any project specific keep options here: | |
11 | + | |
12 | +# If your project uses WebView with JS, uncomment the following | |
13 | +# and specify the fully qualified class name to the JavaScript interface | |
14 | +# class: | |
15 | +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | |
16 | +# public *; | |
17 | +#} | ... | ... |
PersonalCenter/mypresonallibrary/src/androidTest/java/com/hjx/mypresonallibrary/ExampleInstrumentedTest.java
... | ... | @@ -0,0 +1,26 @@ |
1 | +package com.hjx.mypresonallibrary; | |
2 | + | |
3 | +import android.content.Context; | |
4 | +import android.support.test.InstrumentationRegistry; | |
5 | +import android.support.test.runner.AndroidJUnit4; | |
6 | + | |
7 | +import org.junit.Test; | |
8 | +import org.junit.runner.RunWith; | |
9 | + | |
10 | +import static org.junit.Assert.*; | |
11 | + | |
12 | +/** | |
13 | + * Instrumentation test, which will execute on an Android device. | |
14 | + * | |
15 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | |
16 | + */ | |
17 | +@RunWith(AndroidJUnit4.class) | |
18 | +public class ExampleInstrumentedTest { | |
19 | + @Test | |
20 | + public void useAppContext() throws Exception { | |
21 | + // Context of the app under test. | |
22 | + Context appContext = InstrumentationRegistry.getTargetContext(); | |
23 | + | |
24 | + assertEquals("com.hjx.mypresonallibrary.test", appContext.getPackageName()); | |
25 | + } | |
26 | +} | ... | ... |
PersonalCenter/mypresonallibrary/src/main/AndroidManifest.xml
PersonalCenter/mypresonallibrary/src/main/aidl/com/hjx/personalcenter/service/IPresonalInterface.aidl
... | ... | @@ -0,0 +1,15 @@ |
1 | +// IPresonalInterface.aidl | |
2 | +package com.hjx.personalcenter.service; | |
3 | + | |
4 | +// Declare any non-default types here with import statements | |
5 | + | |
6 | +interface IPresonalInterface { | |
7 | + //测试AIDL | |
8 | + String sayHello(); | |
9 | + //UI view 所有的页面 | |
10 | + String viewPage(String action); | |
11 | + //得到用户登录信息 | |
12 | + String getSimpleUser(); | |
13 | + //得到用户保卡信息 | |
14 | + String getcardUser(); | |
15 | +} | ... | ... |
PersonalCenter/mypresonallibrary/src/main/res/values/strings.xml
PersonalCenter/mypresonallibrary/src/test/java/com/hjx/mypresonallibrary/ExampleUnitTest.java
... | ... | @@ -0,0 +1,17 @@ |
1 | +package com.hjx.mypresonallibrary; | |
2 | + | |
3 | +import org.junit.Test; | |
4 | + | |
5 | +import static org.junit.Assert.*; | |
6 | + | |
7 | +/** | |
8 | + * Example local unit test, which will execute on the development machine (host). | |
9 | + * | |
10 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | |
11 | + */ | |
12 | +public class ExampleUnitTest { | |
13 | + @Test | |
14 | + public void addition_isCorrect() throws Exception { | |
15 | + assertEquals(4, 2 + 2); | |
16 | + } | |
17 | +} | |
0 | 18 | \ No newline at end of file | ... | ... |
PersonalCenter/settings.gradle