Google官方网络框架Volley实战——QQ吉凶测试,南无阿弥陀佛
这次我们用第三方的接口来做一个QQ吉凶的测试项目,代码依然是比较的简单
无图无真相
直接撸代码了,详细解释都已经写在注释里了
activity_main.xml
LinearLayout xmlns:android=\"http://schemas.android/apk/res/android\"
xmlns:tools=\"http://schemas.android/tools\"
android:layout_width=\"match_parent\"
android:layout_height=\"match_parent\"
android:orientation=\"vertical\"
EditText
android:id=\"@+id/et_qq\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_marginTop=\"10dp\"
android:background=\"@drawable/whitebg\"
android:gravity=\"center\"
android:hint=\"请输入QQ号\"
android:lines=\"3\"
android:numeric=\"integer\" /
Button
android:id=\"@+id/btn_go\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_margin=\"15dp\"
android:layout_marginTop=\"5dp\"
android:background=\"@drawable/graybg\"
android:text=\"求佛\" /
TextView
android:id=\"@+id/tv_conclusion\"
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:layout_margin=\"15dp\"
android:layout_marginBottom=\"5dp\"
android:layout_marginTop=\"5dp\"
android:text=\"结果\"
android:textSize=\"18sp\" /
View
android:layout_width=\"match_parent\"
android:layout_height=\"1dp\"
android:background=\"#fff\" /
TextView
android:id=\"@+id/tv_analysis\"
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:layout_margin=\"15dp\"
android:layout_marginTop=\"5dp\"
android:text=\"分析\"
android:textSize=\"18sp\" /
com.lgl.qq.WaterRippleView
android:layout_width=\"match_parent\"
android:layout_height=\"0dp\"
android:layout_weight=\"1\"
/com.lgl.qq.WaterRippleView
/LinearLayout
MainActivity
package com.lgl.qq;
import org.json.JSONException;
import org.json.JSONObject;
import android.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Request.Method;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.Response.Listener;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
public class MainActivity extends Activity implements OnClickListener {
private EditText et_qq;
private Button btn_go;
private TextView tv_conclusion, tv_analysis;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(Ryout.activity_main);
initView();
}
private void initView() {
// 初始化控件
et_qq = (EditText) findViewById(R.id.et_qq);
btn_go = (Button) findViewById(R.id.btn_go);
btn_go.setOnClickListener(this);
tv_conclusion = (TextView) findViewById(R.id_conclusion);
tv_analysis = (TextView) findViewById(R.id_analysis);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_go:
if (et_qq == null) {
Toast.makeText(MainActivity.this, \"都不留个QQ号佛主怎么算尼?\",
Toast.LENGTH_LONG)();
} else {
Volley_Get();
}
break;
}
}
private void Volley_Get() {
//获取到输入的QQ号
String qq = et_qq.getText().toString();
//第三方接口
String url = \"/d/file/gt/2023-05/55ajmz3lvug qq;
RequestQueue queue = Volley.newRequestQueue(this);
StringRequest request = new StringRequest(Method.GET, url,
new ListenerString() {
// 成功
@Override
public void onResponse(String json) {
//Volley解析得到json
Volley_Json(json);
}
}, new Response.ErrorListener() {
// 失败
@Override
public void onErrorResponse(VolleyError errorLog) {
Toast.makeText(MainActivity.this,
\"失败:\" + errorLog.toString(), Toast.LENGTH_LONG)
();
}
});
queue.add(request);
}
//解析json
private void Volley_Json(String json) {
try {
//获得JSONObject对象
JSONObject jsonObject = new JSONObject(json);
//解析result
JSONObject object = jsonObject.getJSONObject(\"result\");
//解析data
JSONObject object1 = object.getJSONObject(\"data\");
tv_conclusion.setText(\"结果:\" + object1.getString(\"conclusion\"));
tv_analysis.setText(\"分析:\" + object1.getString(\"analysis\"));
} catch (JSONException e) {
Toast.makeText(MainActivity.this, \"施主都不留个QQ号佛主怎么算尼?\",
Toast.LENGTH_LONG)();
e.printStackTrace();
}
}
}
这里有几点需要说明
1.项目中的水波纹特效请看:[Android特效专辑(一)——水波纹过渡特效(首页)](http://blog.csdn/qq_26787115/article/details/50439020)
2.项目中的Button样式:
?xml version=\"1.0\" encoding=\"utf-8\"?
shape xmlns:android=\"http://schemas.android/apk/res/android\"
solid android:color=\"#ffDEDEDE\" /
corners android:radius=\"2.0dp\" /
/shape
3.项目中的EditText样式
?xml version=\"1.0\" encoding=\"utf-8\"?
shape
xmlns:android=\"http://schemas.android/apk/res/android\"
solid android:color=\"#ffffffff\"/
corners android:radius=\"2.0dp\"/
/shape
Demo下载:http://download.csdn/detail/qq_26787115/9397673
Google官方网络框架Volley实战——QQ吉凶测试,南无阿弥陀佛
这次我们用第三方的接口来做一个QQ吉凶的测试项目,代码依然是比较的简单
无图无真相
直接撸代码了,详细解释都已经写在注释里了
activity_main.xml
LinearLayout xmlns:android=\"http://schemas.android/apk/res/android\"
xmlns:tools=\"http://schemas.android/tools\"
android:layout_width=\"match_parent\"
android:layout_height=\"match_parent\"
android:orientation=\"vertical\"
EditText
android:id=\"@+id/et_qq\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_marginTop=\"10dp\"
android:background=\"@drawable/whitebg\"
android:gravity=\"center\"
android:hint=\"请输入QQ号\"
android:lines=\"3\"
android:numeric=\"integer\" /
Button
android:id=\"@+id/btn_go\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_margin=\"15dp\"
android:layout_marginTop=\"5dp\"
android:background=\"@drawable/graybg\"
android:text=\"求佛\" /
TextView
android:id=\"@+id/tv_conclusion\"
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:layout_margin=\"15dp\"
android:layout_marginBottom=\"5dp\"
android:layout_marginTop=\"5dp\"
android:text=\"结果\"
android:textSize=\"18sp\" /
View
android:layout_width=\"match_parent\"
android:layout_height=\"1dp\"
android:background=\"#fff\" /
TextView
android:id=\"@+id/tv_analysis\"
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:layout_margin=\"15dp\"
android:layout_marginTop=\"5dp\"
android:text=\"分析\"
android:textSize=\"18sp\" /
com.lgl.qq.WaterRippleView
android:layout_width=\"match_parent\"
android:layout_height=\"0dp\"
android:layout_weight=\"1\"
/com.lgl.qq.WaterRippleView
/LinearLayout
MainActivity
package com.lgl.qq;
import org.json.JSONException;
import org.json.JSONObject;
import android.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Request.Method;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.Response.Listener;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
public class MainActivity extends Activity implements OnClickListener {
private EditText et_qq;
private Button btn_go;
private TextView tv_conclusion, tv_analysis;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(Ryout.activity_main);
initView();
}
private void initView() {
// 初始化控件
et_qq = (EditText) findViewById(R.id.et_qq);
btn_go = (Button) findViewById(R.id.btn_go);
btn_go.setOnClickListener(this);
tv_conclusion = (TextView) findViewById(R.id_conclusion);
tv_analysis = (TextView) findViewById(R.id_analysis);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_go:
if (et_qq == null) {
Toast.makeText(MainActivity.this, \"都不留个QQ号佛主怎么算尼?\",
Toast.LENGTH_LONG)();
} else {
Volley_Get();
}
break;
}
}
private void Volley_Get() {
//获取到输入的QQ号
String qq = et_qq.getText().toString();
//第三方接口
String url = \"/d/file/gt/2023-05/55ajmz3lvug qq;
RequestQueue queue = Volley.newRequestQueue(this);
StringRequest request = new StringRequest(Method.GET, url,
new ListenerString() {
// 成功
@Override
public void onResponse(String json) {
//Volley解析得到json
Volley_Json(json);
}
}, new Response.ErrorListener() {
// 失败
@Override
public void onErrorResponse(VolleyError errorLog) {
Toast.makeText(MainActivity.this,
\"失败:\" + errorLog.toString(), Toast.LENGTH_LONG)
();
}
});
queue.add(request);
}
//解析json
private void Volley_Json(String json) {
try {
//获得JSONObject对象
JSONObject jsonObject = new JSONObject(json);
//解析result
JSONObject object = jsonObject.getJSONObject(\"result\");
//解析data
JSONObject object1 = object.getJSONObject(\"data\");
tv_conclusion.setText(\"结果:\" + object1.getString(\"conclusion\"));
tv_analysis.setText(\"分析:\" + object1.getString(\"analysis\"));
} catch (JSONException e) {
Toast.makeText(MainActivity.this, \"施主都不留个QQ号佛主怎么算尼?\",
Toast.LENGTH_LONG)();
e.printStackTrace();
}
}
}
这里有几点需要说明
1.项目中的水波纹特效请看:[Android特效专辑(一)——水波纹过渡特效(首页)](http://blog.csdn/qq_26787115/article/details/50439020)
2.项目中的Button样式:
?xml version=\"1.0\" encoding=\"utf-8\"?
shape xmlns:android=\"http://schemas.android/apk/res/android\"
solid android:color=\"#ffDEDEDE\" /
corners android:radius=\"2.0dp\" /
/shape
3.项目中的EditText样式
?xml version=\"1.0\" encoding=\"utf-8\"?
shape
xmlns:android=\"http://schemas.android/apk/res/android\"
solid android:color=\"#ffffffff\"/
corners android:radius=\"2.0dp\"/
/shape
Demo下载:http://download.csdn/detail/qq_26787115/9397673
#2019净网#双鸭山市网警提示 请注意这些不靠谱朋友圈测试大坑
不久前,一条“2016年有多少人拉黑你,快去试试看”的微信帖子被许多用户转发。不少网友表示,看了自己被拉黑的数据“好心塞”。
后来
网友亲测
两次测试不同结果
网友“panda”忍不住试了试。扫描这个帖子中的二维码后就进入到一个平台,点击查询按钮得到拉黑、删除、屏蔽自己的好友数量。
不过他先后两次进入页面查询,却发现两次的数据并不相同。“随后我用自己的小号尝试,结果只有5个微信好友的小号,最后竟然显示被16人拉黑、被21人删除、被9人屏蔽,我确认这是假的。”
随后“panda”把测试结果发到了朋友圈里,提醒其他好友不要上当。
微信官方
测试平台已被清理
目前点击“查询”按钮时,页面显示“已停止访问该网页”。有媒体报道称,这个“2016年有多少人拉黑你”的测试其实早在2017年年初就被曝光过,当时的游戏页面遭到微信官方清理拉黑后,不法分子利用其他第三方页面“另起炉灶”。
实质目的
为增加网页流量
腾讯技术人员称,此类数据测试跟此前用户常玩的算命测试类似,数据并不可靠。由于微信添加好友的数量不断增加,“熟人社交”的信用链接越来越弱,制作者更多的是利用用户好奇心以及信任感减弱的心理促其点击网页,增加网页的流量。
用户需要扫二维码跳转到别的平台才能查看微信数据,光是这个行为就已经可以认定这些被拉黑的数据是假的了,因为第三方机构是无法测试到个人微信具体数据的。
“看到这里,你是否想起曾经跳过的另一个大坑:微信群发测好友是否已经删除自己”
不靠谱测试回放一
“群发清粉”并没有起到作用
“你也清清吧,不要让拉黑你的人占用你的内存了,不用回复,复制这条消息找到微信里的设置,通用,群发助手,全选,粘贴发送就行,谁的消息失败了,就是把你删除了……”
“群发消息后,谁的名字变色了,删掉就行。”
不少网友都在微信上收到过类似这样“群发清粉”的信息。
群发消息真的可以测试出自己是否被好友“删除”了吗?
并不是!
腾讯方面表示,群发属于系统消息,只要对方在用户的微信好友列表里,用户都能给他群发消息,但系统不会回复对方是否已接收到信息。只有当对方主动回复本条群发微信时,用户才能确定。
“这还不是最坑的,有些测试不但没用,还窃取你的个人资料,让你频繁接到骚扰电话。”
不靠谱测试回放二
看到你的过去和未来?
有一阵子很流行网络算命,打开一个网站,输入自己的姓名和生日,通过系统“神秘”的运算,你就会看到你的过去和未来。这种神神叨叨的算命方法也曾出现在微信朋友圈里,而且还有不少新的测试方法....
“想知道你的节操还剩多少吗?”“测测你未来会有多少钱”“测测你的智商”……这种“预测”游戏吸引了很多微信网友填上自己的真实姓名后再转发出去。
看似好玩暗藏凶机
据了解,此类微信测试游戏是有后台服务器的,是微信用来给一些公众号或服务号做浏览记录的。
其后台服务器本来只能得到用户的微信号,但只要你在测试游戏中填写了自己的真实姓名,你的姓名就会与微信号在数据库中关联起来。
此时,某些不良游戏设计方再辅以另外一些游戏,比如输入生日测生辰八字,输入手机、QQ号码测吉凶,吸引你点击。
这样,你的微信号、姓名、生日、手机号、QQ号等私密信息,就被对方一网打尽了。
这些测试结果实际上毫无根据,而且,在对方掌握了网民的个人信息后,有可能向不法分子出售或转让,从而被不法分子所利用。
警方称,网民经常收到的垃圾短信、短信和电话,有可能就是网民在玩类似测试游戏、浏览网页或其它地方泄露了个人信息所致。
黑暗动机
业内人士分析,除了窃取个人资料以外,这些小测试最大的目的很简单,就是吸粉。现在各类公众号竞争激烈,一个新号没有靠谱的渠道根本推不出去。开发个小测试,把各种测试结果按一定的规律排列组合,完全没有科学性可言,技术含量极低。相比吭哧吭哧做内容,一篇10万+爆款文章,新增粉丝也就几千;而一个小测试,新增粉丝则是几万,效率高太多了。
热门信息
阅读 (337181)
1 宝剑七逆位感情发展阅读 (57052)
2 蛇缠腰咒语口诀阅读 (51409)
3 耳相16种图解 ,耳朵形状看命运?阅读 (35446)
4 最有效诅咒人方法:写小人的姓名放鞋里踩阅读 (35118)
5 陈舒宜出生阅读 (32551)
6 正一派收徒价格一览表阅读 (24780)
7 在仇人家里放啥让倒霉风水阅读 (24011)
8 人财两空解一生肖阅读 (19411)
9 盐城李大林简历出生阅读 (18529)
10 大运流年对照表