- 博客(35)
- 收藏
- 关注
原创 手机端测试方法
一、安全测试1.软件权限1)扣费风险:包括短信、拨打电话、连接网络等。 2)隐私泄露风险:包括访问手机信息、访问联系人信息等。 3)对App的输入有效性校验、认证、授权、数据加密等方面进行检测 4)限制/允许使用手机功能接入互联网 5)限制/允许使用手机发送接收信息功能 6)限制或使用本地连接 7)限制/允许使用手机拍照或录音 8)限制/允许使用手机读取用户数据 9)限制/...
2018-12-14 14:10:55
622
原创 购物车
加入的依赖compile 'com.hjm:BottomTabBar:1.1.1'implementation 'com.android.support:recyclerview-v7:26.1.0'implementation 'io.reactivex:rxjava:1.1.0'implementation 'io.reactivex:rxandroid:1.1.0'implement...
2018-07-01 19:04:39
284
原创 通过dp和px转化操作进行适配(工具类,固定代码,更常用)
public class DensityUtil { /** * 根据手机的分辨率从 dip 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) { final float scale = context.getRe...
2018-06-22 18:53:03
187
原创 TabLayout 横向滑动+XrecyclerView上拉刷新下拉加载
public class ContentFragment extends Fragment { private XRecyclerView xRecyclerView; private int type; private int page = 1; private int opertype = 1; private API api; pri...
2018-06-19 07:56:30
338
原创 自定义View实现台阶
//之定楼梯布局效果public class MyView extends RelativeLayout{ private Button titleBarLeft; private TextView titleBarTitle; private Button titleBarRight; private int num = 0; private Typ...
2018-05-30 14:38:55
300
原创 OKHTTP的二次封装和调用
一定加入OKHTTP的依赖compile 'com.squareup.okhttp3:okhttp:3.4.2'public class OkHttpmanager {//_________________________定义成员变量____________________________ private static OkHttpmanager okHttpmanager; p...
2018-05-30 08:32:03
309
原创 RecyclerView的三中布局模式
switch (view.getId()){//线性布局 case R.id.xx: rlview.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)); break;//网格布局 case R.id.wg: rlview....
2018-05-23 20:09:10
268
原创 RecyclerView 条目点击事件以及适配器
class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> implements View.OnClickListener { private Context context; private List<String> list; public MyAdapter(Cont...
2018-05-23 14:58:14
303
原创 okhttp加载图片
public class MainActivity extends AppCompatActivity { private String path="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527002323765&di=a5271ae1cba8945183d3a2...
2018-05-22 20:50:13
919
原创 okHttp同步异步本地缓存
package maxinawei.bw.com.xm_okhttp;import android.os.Handler;import android.os.Message;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import a...
2018-05-22 20:26:03
386
原创 购物车历史记录
<?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent&quo
2018-05-13 22:37:26
836
原创 综合练习
ListActivity_____________________________________________________<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.and...
2018-05-03 16:12:34
174
原创 倒计时跳转
public class MainActivity extends AppCompatActivity { private int time=5; @SuppressLint("HandlerLeak") private Handler handler=new Handler() { @Override public void handle...
2018-04-26 16:24:11
196
原创 数据库 SQLite
MainActivity==============================================================public class MainActivity extends AppCompatActivity { //页数 private int pageIndex=1; //操作类型 private int operType=1;...
2018-04-26 09:48:54
216
原创 TabLayout 横向滑动菜单
布局---------------------------------------------------------------------<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-a...
2018-04-26 09:33:33
252
原创 PullToRefreshScrollView 一定要在build.gradlel里引入compile 'com.github.userswlwork:pull-to-refresh:1.0.0'
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layou...
2018-04-25 19:21:38
368
原创 HorizontalScrollView 横向滑动菜单
activitv_main-------------------------------------------------------------------------------<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas....
2018-04-25 13:43:22
363
原创 ImageLode 无限轮播
public class MainActivity extends AppCompatActivity { private List<String> imgUrls=new ArrayList<>(); private ViewPager pager; private List<ImageView> lists=new ArrayLis...
2018-04-23 19:58:12
206
原创 TabLayout侧滑
public class MainActivity extends AppCompatActivity { private ViewPager pager; private TabLayout mytab; private List<String> meuns=new ArrayList<>(); @Override protecte...
2018-04-20 14:42:40
200
原创 横向滑动菜单
public class MainActivity extends AppCompatActivity { //所有的菜单内容 private List<String> menus=new ArrayList<>(); private HorizontalScrollView hsv; private LinearLayout linMenu; ...
2018-04-19 20:29:37
301
原创 XListView
public class MainActivity extends AppCompatActivity { private XListView xlistview; private int pageIndex=1; private int operType=1; private List<ResultData.DataBean> datas;...
2018-04-18 18:44:30
153
原创 Itme不同加载 3个条目
public class MyAdapter extends BaseAdapter { private List<ResultData.ResultBean.DataBean> data; private Context context; private DisplayImageOptions options; //定义三个常量值 private fin...
2018-04-17 20:50:07
212
原创 不同Item的加载
public class Myadapter extends BaseAdapter { private List<ReuslDate.NewslistBean> list; private Context context; private final DisplayImageOptions options; private final ...
2018-04-17 20:45:02
167
原创 异步加载图片
public class MyAdapter extends BaseAdapter { //数据源 private List<ResultData.NewslistBean> data; private Context context; private DisplayImageOptions imageOptions; //alt+insert 生成构...
2018-04-17 13:43:36
308
原创 ImageLoader的使用 和扩展
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act...
2018-04-16 18:46:29
188
原创 解析素组JSON
protected void onPostExecute(String s) { super.onPostExecute(s); List<ResultData> datas=new ArrayList<>(); //得到集合的type类型 Type tt=new TypeToke...
2018-04-15 19:31:04
227
原创 登录
public class MainActivity extends AppCompatActivity { private String names; private String psd; private EditText name; private EditText pass; private Button btn; private Logi...
2018-04-15 19:26:27
221
原创 HttpClient 方法 一定要加useLibrary 'org.apache.http.legacy'
@Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); MyTask task=new MyTask(); task.execute("http...
2018-04-15 19:03:54
7708
1
原创 AsyncTask异步请求
public class MainActivity extends AppCompatActivity { private ListView listview; private String myurl="http://api.tianapi.com/huabian/?key=48a7d7193e11bd2dd4a683b6e2f90a4f&num=10"; ...
2018-04-12 14:22:47
176
原创 post 请求
private void requestNetDate() { HttpClient httpClient=new DefaultHttpClient(); HttpGet get=new HttpGet(param); try { HttpResponse execute = httpClient.execute(get); int ...
2018-04-12 08:07:02
184
原创 Android studio post 请求数据
URL url= null;try { url = new URL("http://api.juheapi.com/japi/toh"); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setRequestMethod("POST");/...
2018-04-11 20:46:44
6341
1
原创 请求Url 图片
try { //1.创建URL URL url=new URL(picUrl); //2.打开连接 HttpURLConnection 是 URLConnection 的子类 HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); //3.进行设置 ur...
2018-04-11 20:44:50
408
原创 判断是否联网的工具类
public class NetTypeUtils { public boolean isConn(Context context){ //1.得到网络管理类 ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVI...
2018-04-11 15:15:53
269
原创 HBuild 综合练习题
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title></title> <script src="libs/angular.min.js"></script> &l
2018-04-03 15:53:05
336
原创 HBuilder 二级联动
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title></title> <script src="libs/angular.min.js"></script> &
2018-04-03 14:32:22
1355
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人