- 浏览: 130493 次
- 性别:
- 来自: 武汉
最新评论
-
酱油党:
你这个方法只能截当前activity,想要截取任意地方,怎么办 ...
全屏截图 -
月下独酌:
sxchao2008 写道/sdcard/cacerts.bk ...
android https之二 -
sxchao2008:
/sdcard/cacerts.bks 这个证书可以到网上随便 ...
android https之二 -
月下独酌:
Rhamiss 写道请问这是从sdcard安装ca证书的源代码 ...
android https之三 -
月下独酌:
Rhamiss 写道请问这是从sdcard安装ca证书的源代码 ...
android https之三
文章列表
#Python.
#!/usr/bin/env python
#coding=UTF-8
#计算索引
for index,value in enumerate(list):
print index, value
#列表解析(0到5基数的平方),xrange()构造操大集合
[x*2 for x in range(5) if not x % 2]
#属性
#函数,方法,数据值,统称为属性
#异常捕获
try:
pass
raise IOError,'raise a error'
except(IOError),e:
pass
finally:
...
http://blog.csdn.net/luoshengyang/article/details/6768304
简要整理:
linux-->init
|
native服务zygote(init.rc中定义的service,代码:app_main.cpp //步骤1)
|
{AppRuntime.start(),AndroidRuntime.start()}
|
{通过jni调用Java函数ZygoteInit.java.main(),startVM(),Reg ...
public void onCreate(Bundle savedInstanceState) {
//
//setContentView(R.layout.main2);
getWindow().getDecorView().setDrawingCacheEnabled(true);
getWindow().getDecorView().measure(
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
Meas ...
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
public class LrcTextView extends TextView {
private final String TAG = LrcTextView.class.getSimpleName();
...
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
通过activity.getWindow().addContectView()可以在activityz中添加控件
import java.util.Random;
import android.app.Activi ...
if(!pm.isScreenOn()) {//在点亮屏幕的前提下,activity的onNewIntent才会被执行
PowerManager.WakeLock locker = pm.newWakeLock(
PowerManager.ACQUIRE_CAUSES_WAKEUP
| PowerManager.FULL_WAKE_LOCK, "phone_keyguard");
...
各种常用编译开关位置
- 博客分类:
- android
vendor\third-party\products\
build\target\product\
device\
系统服务列表
system/core/rootdir/
mkdir workcopy
cd workcopy
git init
git remote add origin /work/git/firstGit.git/
{
git pull origin master
git push origin master
}
vi .git/config
+++[branch "master"]
+++ remote = origin
+++ merge = master
+++ pushurl = /work/git/firstGit.git/
+++ p ...
app native socket
- 博客分类:
- android
编写一个简单系统服务,功能很简单,接受命令,返回字符串。
需要在init.rc中定义服务的镜像名称和socket资源
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/poll.h>
#include <sys/ ...
app socket native
- 博客分类:
- android
在应用程序中可以通过此工具类与android系统native服务通信
这些native服务是指在init.rc中定义的随机启动的服务,如zygote
但是如需要通过此工具类来启动和停止系统服务,需要具有system权限
即需要设置sharedUId=system
import android.net.LocalSocket;
import android.net.LocalSocketAddress;
import android.net.vpn.VpnManager;
import android.os.SystemProperties;
import android.util.L ...
/*
* Copyright (C) 2008 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/LI ...
android/dalvik/libcore/dalvik/src/main/java/dalvik/system/PathClassLoader.java
line157 pathList += pathSep + libPath; --->>> pathList = libPath + pathSep + pathList;
public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
if (source != this) {
} else {
if (mDragInfo != null) {
mDragInfo = null;
}
}
}
public void snapToGroup(int index) {
...