文章
1.广播概览
2.blog.csdn.net/owenchan198…
3.blog.csdn.net/yin13753884…
4.zhuanlan.zhihu.com/p/97521051
5.blog.csdn.net/cassy0401/a…
6.www.jianshu.com/p/fb776ef04…
7.www.pianshen.com/article/417…
技术点
1. Background execution not allowed 在Android8及以上,静态注册的广播无法使用问题
var intent = Intent("action")
intent.setPackage(*** )
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
intent.addFlags(0x01000000)
2. 在APP A中如何启动APP B中的Activity,Service,BroadcastReceiver?
Android APP调起另外一个APP并传值 Android在一个app中启动其他app中的service或者Activity Android通过App启动另一个APP Android APP打开另一个APP完整逻辑实现
3. 多进程通信
4. int和byte数组互转
//int 转化为字节数组
public byte[] intTobyte2(int num) {
/*byte[] result = null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
try {
dos.writeInt(num);
result = bos.toByteArray();
} catch (IOException e) {
e.printStackTrace();
}
return result;*/
return new byte[] {(byte)((num>>24)&0xff),(byte)((num>>16)&0xff),(byte)((num>>8)&0xff),(byte)(num&0xff)};
}
//字节数组转化为int
public int byteArrayToInt2(byte[] arr) {
/*int result = 0;
ByteArrayInputStream bis = new ByteArrayInputStream(arr);
DataInputStream dis = new DataInputStream(bis);
try {
result = dis.readInt();
} catch (IOException e) {
e.printStackTrace();
}
return result;*/
return (arr[0]&0xff)<<24|(arr[1]&0xff)<<16|(arr[2]&0xff)<<8|(arr[3]&0xff);
}