service获取activity call activity 42 s16 com.android.systemui

博客分类:
public class PermissionActivity extends Activity{
private static final String PERVIOUS_INTENT = &pervious_intent&;
private static final String REQUEST_PERMISSIONS = &request_permissions&;
private static final String PACKAGE_URL_SCHEME = &package:&;
博客分类:
在最近项目中,因为特殊需要,底层相机往外输出了i420 也就是yuv420p,输出的bytes 需要转成换h264,同时某个时间还需要保存一张图片,如何将i420 转jpeg ?可以ffmpeg 也可以libjpeg 但是我不需要这些库,仅仅为了一个图片 加载一个库 没有必要,同时对图片处理眉头特殊需求,所以 目前的方式是: i420 -argb-jpeg
public static void generateWarnPic(final byte[] picData,final int width,final int height){
new Thread(new ...
博客分类:
targetSdkVersion 23 开始 使用运行时权限,就像iphone谈框,不能简单的和以前一样 在配置文件写明权限,需要用代码判断。所以为了防止此问题发生 请不要设置targetSdkVersion 23,应该比他小,不然需要代码判断。
目前不属于运行时权限的有
android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_NOTIFICATION_POLICY
android.permission. ...
博客分类:
static void ChangeEdgeEffect(Context cxt, View list, int color){
if (android.os.Build.VERSION.SDK_INT &= Build.VERSION_CODES.LOLLIPOP) {
EdgeEffect edgeEffectTop = new EdgeEffect(cxt);
edgeEffectTop.setColor(color);
EdgeEffect edgeEffectBottom = new EdgeEffect ...
博客分类:
WifiManager wifiManager = (WifiManager) getBaseContext()
.getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(false);
wifiManager.getClass()
.getMethod(&setWifiApEnabled&,
WifiConfiguration.clas ...
博客分类:
http://www.grokkingandroid.com/first-glance-androids-recyclerview/
博客分类:
public void getHitRect(Rect outRect) {
super.getHitRect(outRect);
outRect.top+=getPaddingBottom()/2;
outRect.bottom-=getPaddingBottom()/2;
博客分类:
http://www.speex.org/downloads/
http://xiph.org/downloads/
建立 jni 文件夹,然后从下载的文件夹中提取相关文件 放到jni下
/libspeex/*
? /jni/libspeex/
/include/speex/*
? /jni/include/speex/
/src/wav_io.h
? /jni/include/speex
? /jni/libogg/
/include/ogg/*
? /jni/include/ogg
编辑jni/include/speex/ ...
博客分类:
两台android 设备 进行rsync 同步
1。编译 rsync 源码
sudo apt-get install gcc-arm-linux-gnueabi
wget http://rsync.samba.org/ftp/rsync/rsync-3.1.0.tar.gz
tar -zxv -f rsync-3.1.0.tar.gz
cd rsync-3.1.0
./configure --host=arm-linux-gnueabi CFLAGS=&-static&
博客分类:
public static String convertStreamToString(InputStream is) throws Exception
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line =
while ((line = reader.readLine()) != null) {
sb.append(line ...
博客分类:
&?xml version=&1.0& encoding=&UTF-8&?&
&ver&协议版本&/ver&
&dev_type&设备类型&/dev_type&
&dev_sub_type&设备子类型&/dev_sub_type&
&dev_sn&设备编号&/dev_sn&
&cmd &命令字&/cmd &
&id&消息i ...
博客分类:
PackageManager manager = getPackageManager();
Resources resources = manager.getResourcesForApplication(&com.example.packagename&);
int resId = resources.getIdentifier(&drawable_id&, &drawable&, &com.example.packagename&);
博客分类:
public class IncomingCallInterceptor extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
String callingSIM = &&;
Bundle bundle = intent.getExtras();
callingSIM =String.valueOf(bundle.getInt(&simId&, -1));
if(call ...
博客分类:
1. 环境 ubuntu 我的是13.10
ndk r9 64位
2. 下载ffmpeg http://www.ffmpeg.org/download.html
FFmpeg 2.1.3 &Fourier&
2.1.3 was released on . It is the latest stable FFmpeg release from the 2.1 release branch, which was cut from master on . Amongst lots of other changes, it
浏览 14696
博客分类:
http://download.csdn.net/download/wang_peng1/6842365
博客分类:
&string name=&name_hint&&&Given Name&&/string&
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
博客分类:
当使用android:lineSpacingExtra=&5dp& 后面背景就会变大
public class BetterHighlightSpan extends ReplacementSpan {
private int backgroundC
public BetterHighlightSpan(int backgroundColor) {
this.backgroundColor = backgroundC
博客分类:
最近需要做一个屏保,开始以为很简单,因为系统本身就带了屏保功能,拿出来改改就好,只是后来发现,系统自带的不是和windows 一样的屏保,系统自带的,要么设置完了马上启动,要不就是插电启动,这样容易捕获事件,直接发起一个activity 播放幻灯片好了。但是我现在需要做的是和windows 一样,一段时间内,用户如果没有响应事件,就会发起activity。
这个问题的关键就是 怎么捕获 没有响应的事件:有人说 监听屏幕变暗,是个办法,但是我还有一个需求就是用户可以设置一个时间段 比如 10 30分钟没想应 就屏保,那么监听屏幕变暗就不好使了。
监听touch事件,写一个ba ...
博客分类:
今天在修改系统代码的时候,系统代码用了PreferenceActivity,出于某种需求,我想把布局PreferenceScreen整个的嵌套在我的一个正常的layout xml中,就好像把PreferenceScreen 作为一个普通的view使用如button一样随便放,开始以为不可行 后来终于找到了替换办法 那就是 把要PreferenceScreen嵌入的地方用一个
android:id=&@android:id/list&
android:layout_width=&match_ ...
博客分类:
et2.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD)
et2.setTransformationMethod(new MyPasswordTransformationMethod());
then create MyPasswordTransformationMethod class in same activity like this
public class MyPasswordTransformationMethod extends Passw ...
博客分类:
public class TextDrawable extends Drawable {
private final S
private final P
public TextDrawable(String text) {
this.text =
this.paint = new Paint();
paint.setColor(Color.BLACK);
paint.setTextSize(16f);
paint.setAntiAlias(true);
博客分类:
有时候两个webview点击一个会影响另一个
ublic class MyWebView extends WebView{
private MyActivity mA
//Call this on each webview in activity's onCreate after
public setActivity(MyActivity activity){
mActivity =
public boolean onTou ...
博客分类:
http://draw9patch.com/
博客分类:
转载:http://docs.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html
http://www.cs.uic.edu/~troy/spring05/cs450/sockets/socket.html
http://systembash.com/content/a-simple-java-udp-server-and-udp-client/
博客分类:
转贴http://www.androidhub4you.com/2012/12/listview-into-scrollview-in-android.html
Step1- Create an Activity name-MainActivity.java and create a listview.
package com.example.sc
import android.os.B
import android.app.A
import android.widget.ArrayA
博客分类:
dateTextView.setText(year+&年& +month+&月&+dom+&日&+&(&+week+&)&);
设置系统时间
String m,d,h,f;
if(month&10){
m=&0&+String.valueOf(month);
m=String.valueOf(month);
博客分类:
需要root,不同的版本可能需要一定的修改
public static void showSystemBar(){
Process proc = Runtime.getRuntime().exec(&am startservice --user 0 -n com.android.systemui/.SystemUIService&);
proc.waitFor();
} catch (IOException e) {
// TODO Auto-generated catch block
博客分类:
不解释 https://code.google.com/p/9patch-resizer/
博客分类:
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = context.registerReceiver(null, ifilter);
int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
博客分类:
Intent i = new Intent(&com.xxx.yyy.MESSAGE&);
Bundle b = new Bundle();
b.putString(&AAA&, getAAA());
i.putExtra(&MyData&, b);
startActivityForResult(i, &myProcess&);
App2... onResume()...
Intent i = getIntent();
if (i != null &&
& 上一页 1
wang_peng1
浏览: 2944892 次
来自: 北京
最后的 -createDialog() 私有方法是怎么回事,没 ...
呵呵,呵呵
感觉你所的不清楚
lstView.setOnTouchLi ...
果然是大神啊!!!
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'Android使用procrank和dumpsys meminfo分析内存占用情况
时间: 09:16:30
&&&& 阅读:263
&&&& 评论:
&&&& 收藏:0
标签:&&&&&&&&&&&&&&&&&&& & 如果你想查看所有进程的内存使用情况,可以使用命令procrank、dumpsys meminfo查看,当然也只可以过滤出某个进程如:dumpsys meminfo | grep -i phone
先来看下procrank
sh-4.2# procrank
com.csr.BTApp
com.android.launcher
android.process.acore
system_server
/system/bin/surfaceflinger
com.android.systemui
com.baidu.input
com.android.phone
com.apical.dreamthemetime
com.csr.csrservices
/system/bin/mediaserver
/system/bin/synergy_service
/usr/bin/gpsexe
/system/bin/drmserver
/system/bin/audiotransfer
/system/bin/netd
/system/bin/vold
/system/bin/rild
/system/bin/dbus-daemon
/system/bin/keystore
/sbin/adbd
/system/bin/dvdd
/system/bin/installd
/system/bin/servicemanager
/sbin/ueventd
/system/bin/debuggerd
RAM: 480380K total, 3624K free, 732K buffers, 299788K cached, 264844K shmem, 7632K slab从以上打印可以看出,一般来说内存占用大小有如下规律:VSS &= RSS &= PSS &= USS
VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)是单个进程全部可访问的地址空间
RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存)是单个进程实际占用的内存大小,对于单个共享库, 尽管无论多少个进程使用,实际该共享库只会被装入内存一次。
PSS - Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
USS - Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)USS 是一个非常非常有用的数字, 因为它揭示了运行一个特定进程的真实的内存增量大小。如果进程被终止, USS 就是实际被返还给系统的内存大小。
USS 是针对某个进程开始有可疑内存泄露的情况,进行检测的最佳数字。怀疑某个程序有内存泄露可以查看这个值是否一直有增加
使用dumpsys meminfo查看内存信息
sh-4.2# dumpsys meminfo
Applications Memory Usage (kB):
Uptime: 3353863 Realtime: 3353850
Total PSS by process:
41743 kB: com.csr.BTApp (pid 1078)
36924 kB: com.android.launcher (pid 2683)
35452 kB: android.process.acore (pid 1042)
16094 kB: system (pid 782)
11609 kB: com.android.systemui (pid 851)
8564 kB: com.baidu.input (pid 2999)
5298 kB: com.android.phone (pid 959)
4443 kB: com.apical.dreamthemetime (pid 4448)
4203 kB: com.csr.csrservices (pid 982)
4130 kB: com.apical.apicalradio (pid 4518)
Total PSS by OOM adjustment:
16094 kB: System
16094 kB: system (pid 782)
21110 kB: Persistent
11609 kB: com.android.systemui (pid 851)
5298 kB: com.android.phone (pid 959)
4203 kB: com.csr.csrservices (pid 982)
36924 kB: Foreground
36924 kB: com.android.launcher (pid 2683)
85759 kB: Perceptible
41743 kB: com.csr.BTApp (pid 1078)
35452 kB: android.process.acore (pid 1042)
8564 kB: com.baidu.input (pid 2999)
4443 kB: A Services
4443 kB: com.apical.dreamthemetime (pid 4448)
4130 kB: Background
4130 kB: com.apical.apicalradio (pid 4518)
Total PSS by category:
56020 kB: Dalvik
30214 kB: Other dev
27716 kB: Native
24504 kB: Cursor
13198 kB: Unknown
7723 kB: Other mmap
6895 kB: .so mmap
1232 kB: .apk mmap
888 kB: .dex mmap
36 kB: .ttf mmap
34 kB: Ashmem
0 kB: .jar mmap
Total PSS: 168460 kB打印某个程序内存信息,把包名写上,如:com.android.launcher
sh-4.2# dumpsys meminfo com.android.launcher
Applications Memory Usage (kB):
Uptime: 4497753 Realtime: 4497741
** MEMINFO in pid 2683 [com.android.launcher] **
Other mmap
ViewRootImpl:
AppContexts:
Activities:
AssetManagers:
Local Binders:
Proxy Binders:
Death Recipients:
OpenSSL Sockets:
MEMORY_USED:
PAGECACHE_OVERFLOW:
MALLOC_SIZE:
Lookaside(b)
launcher.db
Asset Allocations
zip:/system/app/Launcher2.apk:/resources.arsc: 340K
zip:/system/app/MediaCenter.apk:/resources.arsc: 604KAndroid程序内存被分为2部分:native和dalvik,dalvik就是我们平常说的java堆,我们创建的对象是在这里面分配的,而bitmap是直接在native上分配的,对于内存的限制是 native+dalvik 不能超过最大限制。Android程序内存一般限制在16M,当然也有24M的。
从上信息对于分析内存泄露,内存溢出都有极大的作用,从以上信息可以看到该应用程序占用的native和dalvik,当TOTAL
超过内存最大限制时会出现OOM错误。
dumpsys能做的事还有很多
dumpsys [options]
meminfo 显示内存信息
cpuinfo 显示CPU信息
account 显示accounts信息
activity 显示所有的activities的信息
window 显示键盘,窗口和它们的关系
wifi 显示wifi信息参考文档:
标签:&&&&&&&&&&&&&&&&&&原文地址:http://blog.csdn.net/deng0zhaotai/article/details/
&&国之画&&&& &&&&chrome插件
版权所有 京ICP备号-2
迷上了代码!Hide Tablet system bar
由 administrator
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):问题:
I want to hide system bar for tablet device. I searched a lot but not succeed. I added image for it.
I found some solution like
View v = findViewById(R.id.view_id);
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
but I dont know how to use it
And I know that is possible as
Can any one know how to do this ?
Code snippet to show/hide status bar on rooted android tablets
Process proc =
String ProcID = "79"; //HONEYCOMB AND OLDER
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
ProcID = "42"; //ICS AND NEWER
proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "service call activity "+ProcID+" s16 com.android.systemui" });
} catch (Exception e) {
Log.w("Main","Failed to kill task bar (1).");
e.printStackTrace();
proc.waitFor();
} catch (Exception e) {
Log.w("Main","Failed to kill task bar (2).");
e.printStackTrace();
Process proc =
proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "am startservice -n com.android.systemui/.SystemUIService" });
} catch (Exception e) {
Log.w("Main","Failed to kill task bar (1).");
e.printStackTrace();
proc.waitFor();
} catch (Exception e) {
Log.w("Main","Failed to kill task bar (2).");
e.printStackTrace();
Finally after searching lots of time I got some alternativ for my requirement.
I know this is not a good idea for a programmer to back off from this situation but for my time limit I used this way...
I found this link and application which fullfil my requirement
please visit this once if you want this type of requirement in your application ....
Thanks to all for helping me in my problem...
It is not possible to hide the system bar. There is nothing in the API that allows for it. This is because the user always needs access to the home and back keys in case the app freezes or does something goofy where the user just needs to get out of the app. You can only hide the action bar.
There is a workaround to disable menu bar in all most all tablets without rooting. But this is bit tricky, but it works clean. Several well known apps in the market at the moment using this strategy to achieve this disable menu bar feature for their apps.
Grant admin privilege.
Set password & lock the device using device admin profile api
Then load what ever the UIs on top of the native lock screen. (Of course this will show background lock screen whenever a transition happens between activities. But if logic is organized well, then it will be smooth & less noticed by the user)
When need to enable back, reset password to "" using resetPassword("", 0) of device policy manager object.
var width = innerW
var height = innerH
think this code will help for you.its not hide the tablet bar
but your application fit on any device you can use this
(I used this code in javascript for
cord ova mobile application)
You just need combination of SYSTEM_UI_FLAG_IMMERSIVE_STICKY | SYSTEM_UI_FLAG_HIDE_NAVIGATION | SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN. For example, if you use opengl and glSurfaceView is you surface:
glSurfaceView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
Swipe at bottom to see the bottom bar, it will hide again after
few seconds.
I believe its the same for all android devices.
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
I also found another solution but this of course is just a separate app called surelock.
The above code doesn't hide the Tablet Bar. I'll leave my answer up for those looking to hide the System Bar in another Android Device.
You can't hide it but you can simply disable it, except home. Try
. Using SYSTEM_UI_FLAG_LOW_PROFILE you can dim your system bar and using onWindowFocusChanged() can take the focus and collapse it.
I found a trick on a galaxy tab for use it as a kiosk
according to the
You can ask your app to be over the lock system and ask the return button to go back to a start activity/view of your app.
I done this for a web View app
public void onBackPressed() {
//here asking to go back to home page
mWebView.loadUrl(mHomepageUrl);
for asking to stay up from the lock system, on the onCreate method :
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
and then when you click on the power button twice , you found back your application , and only the back button is active on the status bar
So the only way is to reboot the tablet (and so you can use the classic lock system with a code to open tablet)
Can be useful if the power button is not accible by visitor , or if your are the only one who have the unlock code
// Put code on onCreate method of your activity / fragment
@SuppressLint("NewApi")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().hide();
setContentView(R.layout.activity_main);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
In order to create a Kiosk app in android you need the following:
- Override the onkeydown
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_BACK || keyCode==KeyEvent.KEYCODE_HOME){
startActivity(new Intent(this,MainActivity.class));
return super.onKeyDown(keyCode, event);
Then make your activity a launcher activity in order to override the home button. (in the manifest)
No need for weird locker apps that asks a million permissions. You don't have to root your phone.
添加新评论

我要回帖

更多关于 activity绑定service 的文章

 

随机推荐