Skip to content

Instantly share code, notes, and snippets.

@luxiaoyu
luxiaoyu / gist:66102d5fa4b3489c529534772ca21e43
Created October 24, 2018 06:32
跳转到系统设置界面相关的API
android.provider.Settings。
1. ACTION_ACCESSIBILITY_SETTINGS : // 跳转系统的辅助功能界面
Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivity(intent);
2. ACTION_ADD_ACCOUNT : // 显示添加帐户创建一个新的帐户屏幕。【测试跳转到微信登录界面】
Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
startActivity(intent);
@luxiaoyu
luxiaoyu / gist:35de5d03404a0ffeca61ad8524d7c4db
Created August 22, 2018 08:01
国内一线互联网公司内部面试题库
国内一线互联网公司内部面试题库,从一个老码农转载的
以下面试题来自于百度、小米、乐视、美团、58、猎豹、360、新浪、搜狐内部题库
熟悉本文中列出的知识点会大大增加通过前两轮技术面试的几率。
欢迎一线公司员工提交内部面试题库,欢迎star。
一、java基础
@luxiaoyu
luxiaoyu / GeometryUtils.java
Created April 30, 2016 09:05
几何计算类
package solid.util;
import android.graphics.PointF;
import android.support.v4.util.Pair;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
/**
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@luxiaoyu
luxiaoyu / DownloadTask.java
Created December 31, 2015 08:28
文件下载,支持任务暂停、恢复、断点续传;任务状态查询;任务并发控制
package solid.download;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.text.TextUtils;
import android.util.Log;
import com.squareup.okhttp.Call;
@luxiaoyu
luxiaoyu / DiaporamaAdapter.java
Last active September 7, 2015 12:53 — forked from FrancoisBlavoet/DiaporamaAdapter.java
Helper Class allowing to load multiple images consecutively in the same view with Glide and animate between them.
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.animation.AlphaAnimation;
@luxiaoyu
luxiaoyu / monitorProcess.java
Created January 12, 2015 04:21
监听进程
public interface Recall {
void call();
}
public void start(final Recall recall) {
MyService.printDebugLog("Guarder for " + mPid);
final ActivityManager activityManager = (ActivityManager) mContext
.getSystemService(Context.ACTIVITY_SERVICE);
new Thread(new Runnable() {
@luxiaoyu
luxiaoyu / IntReader.java
Created May 7, 2014 08:44
解析点9图(请从Demo.java看起)
package com.baidu.luxiaoyu;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
/**
*
* Simple helper class that allows reading of integers.
*
/**
* 把二进制byte数组生成 md5 32位 十六进制字符串,单个字节小于0xf,高位补0。
*
* @param bytes
* 输入
* @param upperCase
* true:大写, false 小写字符串
* @return 把二进制byte数组生成 md5 32位 十六进制字符串,单个字节小于0xf,高位补0。
*/
public static String toMd5(byte[] bytes, boolean upperCase) {
@luxiaoyu
luxiaoyu / tag
Last active August 29, 2015 14:00
int a = 16;
// “>>> 无符号右移,高位补0”
System.out.println(a >>> 1);
// “>> 右移,高位补符号位”
System.out.println(a >> 1);