# AndroidSamples
**Repository Path**: RecSmile/AndroidSamples
## Basic Information
- **Project Name**: AndroidSamples
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2016-05-09
- **Last Updated**: 2020-12-20
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 第一次初始化,主要是平时学的知识点总结在一块
## 1.volley网络框架的学习
1.加入网络权限
``
2.add app/build.gradle `compile 'com.mcxiaoke.volley:library:1.0.19'`
`dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.mcxiaoke.volley:1.0.19'}`
rebuild project;
3.创建Application
`public class MyApplication extends Application { private static RequestQueue queue; @Override public void onCreate() { super.onCreate(); queue = Volley.newRequestQueue(this); } public static void add2Queue(Object tag, Request request){ request.setTag(tag); queue.add(request); }}`
并在AndroidManifest.xml注册Application
`() { @Override public void onResponse(JSONObject response) { textView.setText(response.toString()); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { textView.setText(error.getMessage()); } }));}`