自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

转载 json

判断某个字符串是否为json数据格式 public static boolean isGoodJson(String json) {               try {            new JsonParser().parse(json);          return true;        } catch (JsonParseException e) {  

2018-02-02 14:30:37 152

转载 GsonFormat插件

GsonFormat插件 File--Setting--plugins--搜索GsonFormat搜不到会有链接,点击自动下载,再把插件安装,实体类下面快捷键要看你是不是默认的,studio默认快捷键是alt+insert,insert不能是0的那个insert,点击GsonFormat,把数据copy进去,自动生成,取数据是xxx.getxxx,获取的是一级数组,数组里面如果还有数组继续获取,

2018-01-30 10:53:55 597

原创 android 获取开发版sha1

右侧工具栏 Gradle - 项目名 - app -tasks-android 双击signingReport

2018-01-23 21:44:56 182

转载 checkBox

今天在工作中遇到一个需求:点击按钮后改变页面中相关显示并改变点击按钮的背景图片显示,最后决定用checkbox来实现,这个时候就需要写一个选择器放两张图片,分别设置为选中时的状态和未选中的状态, selector xmlns:android="http://schemas.android.com/apk/res/android" > item android:drawable="@dr

2018-01-22 16:05:30 197

转载 android sdk 代理

mirrors.zzu.edu.cn:80

2018-01-07 21:59:40 1452

原创 Socket简易聊天

服务器端 public class MyServer { private static int port = 30000; public static Map socketMap = new LinkedHashMap<>(); public static void main(String[] args) throws IOException { Serv

2018-01-07 14:03:09 157

原创 自定义控件

public class CountView extends View implements View.OnClickListener {     private Paint mPaint;     private Rect mBounds;     private int mCounter;     public CountView(Context context, Attrib

2018-01-05 23:13:04 125

原创 通知和多媒体

通知的基本用法 通过NotificationManager 来管理通知  NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);                 NotificationCompat.Builder builder = new Not

2018-01-05 23:10:09 159

原创 运行时权限和内容提供器

检查运行时权限 button.setOnClickListener(new View.OnClickListener() {                 @Override                 public void onClick(View view) {                     if(ContextCompat.checkSelfPermissi

2018-01-05 23:09:36 202

原创 广播和数据库

广播接收器 动态注册广播接收器 创建一个类继承BroadcastReceiver         intentFilter = new IntentFilter();         intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");         receiver = new NetworkC

2018-01-05 23:08:43 359

原创 palette提取颜色和更多

Palette提取颜色 Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher);         Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {             @Override

2018-01-05 23:08:08 311

原创 服务和多线程

简单的服务启动与停止 public class MyService extends Service {     public MyService() {     }     @Override     public IBinder onBind(Intent intent) {         // TODO: Return the communication channel

2018-01-05 23:07:15 286

原创 WebView设置

自定义view http://blog.csdn.net/guolin_blog/article/details/17357967 这里给大家一个关于差值器网站: http://inloop.github.io/interpolator/ WebView 载入本地的html 1、可以是用loadData,这种方法需要先将html文件读取出来,以字符

2018-01-05 23:06:41 1599

原创 Okhttp xml和json数据解析

OkHttp发送请求 需要添加依赖 public class HttpUtil {     public static void sendRequestWithHttp(String address,okhttp3.Callback callback){         OkHttpClient client = new OkHttpClient();         Request r

2018-01-05 23:05:53 2927

原创 MaterialDesign

Toolbar styles.xml文件         android:id="@+id/toolbar"         android:layout_width="match_parent"         android:layout_height="?attr/actionBarSize"         android:background="?attr/co

2018-01-05 23:05:00 162

原创 fragment

public class LeftFragment extends Fragment {     @Nullable     @Override     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

2018-01-05 23:03:30 106

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除