积跬步

Just do IT Now.


  • Home

  • Tags

  • Categories

  • Archives

  • Search

工具-尺寸、大小

Posted on 2019-12-19 | In Android代码片段
将设计在苹果的宽高转换成Android的宽高1234567891011121314151617181920212223242526272829303132333435public class IOSDisplayTransfer { /** * 将设计在苹果的高度转换成android的高度 */ public static int caculateHeightFromApple(Context context, int appleHeight) { int rw = DimensUtil.getDisplayWidth(con ...
Read more »

字符串相关

Posted on 2019-12-19 | In Java代码片段

java_判断是否中文字符

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
public class IsChineseOrEnglish{
//GENERAL_PUNCTUATION 判断中文的“号
//CJK_SYMBOLS_and_punctuation 判断中文的。号
//HALFWIDTH_AND_FULLWIDTH_FORMS 判断中中文的,号

public static boolean isChinese(Char c){
Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);
if(ub == Character.UnicodeBlock.CJK_SYMBOLS_and_punctuation
|| ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS
|| ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A
|| ub == Character.UnicodeBlock.GENERAL_PUNCTUATION
|| ub == Character.UnicodeBlock.CJK_SYMBOLS_and_punctuation
|| ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS){
return true;
}
return false;
}

public static void isChiese(String strName){
char[] ch = strName.toCharArray();
for(int i = 0; i < ch.length; i++){
char c = ch[i];
if(isChinese(c) == true){
System.out.println(isChiese(c));
return;
} else {
System.out.println(isChiese(c));
return;
}
}
}

public static void main(String[] args){
Random r = new Random();
for(int i = 0; i < 20; i++){
System.out.println(r.nextInt(10) + 1);
isChinese("き");
isChinese("中国");
}
}
}
Read more »

方法反射实例

Posted on 2019-12-19 | In Java代码片段

方法反射实例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class ReflectCase {

public static void main(String[] args) throws Exception {
Proxy target = new Proxy();
Method method = Proxy.class.getDeclaredMethod("run");
method.invoke(target);
}

static class Proxy {
public void run() {
System.out.println("run");
}
}
}
Read more »

获取本地IP

Posted on 2019-12-19 | In Java代码片段

获取本地IP

1
2
3
4
5
6
7
8
9
10
InetAddress ia = null;
try{
ia = ia.getLocalHost();
String localName = ia.getHostName();
String localIP = ia.getHostAddress();
Systemt.out.println("本机名称是:" + localName);
Systemt.out.println("本机的IP是:" + localIP);
} catch(Exception e){
e.printStackTrace();
}
Read more »

知识-Markdown新手指南

Posted on 2019-12-18 | In 其他IT

MarkDown 新手指南

Markdown 扩展语法入门 | Markdown 官方教程
MarkDown语法 超详细教程 - 经验分享 - Obsidian 中文论坛

标题

Read more »

Map相关

Posted on 2019-07-04 | In Java代码片段

循环输出HashMap内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
private static void loogerHashMapContent() {
HashMap<String, Object> hashMap = new HashMap<String, Object>();
hashMap.put("carrier", "carrier1");
hashMap.put("province", "province1");
hashMap.put("ismodem", "ismodem1");
hashMap.put("state", "state1");


Iterator<Entry<String, Object>> iterator = hashMap.entrySet().iterator();
while (iterator.hasNext()) {
Entry<String, Object> entry = iterator.next();
System.out.print(entry.getKey()+":"+entry.getValue()+",");
}
System.out.println();
}
Read more »

集合相关

Posted on 2019-07-04 | In Java代码片段

多线程列表删除的解决方案

第一种:Collections.synchronizedList
最常用的方法是通过 Collections 的 synchronizedList 方法将 ArrayList 转换成线程安全的容器后再使用。

1
List<Object> list =Collections.synchronizedList(new ArrayList<Object>);
Read more »

《Android进阶之路》

Posted on 2018-11-20 | In Android

Android进阶之路、进阶学习方向

Read more »

安卓-进阶

Posted on 2018-11-20 | In Android

Android进阶大纲

大纲-Android进阶

Hook

Read more »

拓展-框架选型

Posted on 2018-11-20 | In Android

框架选型

链接:

UI集:

Read more »

拓展-组件化、插件化

Posted on 2018-11-20 | In Android

组件化

AucFrameTemplate

ARouter

Read more »

拓展-自学安卓

Posted on 2018-11-20 | In Android

自学Android

一、基础篇

1.1 Java篇

Read more »
<1…2223

276 posts
23 categories
47 tags
E-Mail CSDN
0%
© 2018 — 2025 阿炳
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4