简体   繁体   English

如何找出在Android中运行apk使用的布局?

[英]How to find out which layout is using in running apk in android?

I have my apk in eclipse and run it on device. 我的apk中有我的apk,并在设备上运行它。 In my apk is a lot of layouts (sw240, sw300, sw340 sw360, etc) and on layout which is loaded is a bug. 在我的apk中有很多布局(sw240,sw300,sw340 sw360等),并且在加载的布局上是一个错误。 But I known nothing about device so I want to know from eclipse (or some another way) which layout is using now on device (when I start my apk from eclipse on device). 但是我对设备一无所知,所以我想从eclipse(或其他方式)知道设备上正在使用哪种布局(当我从设备上的eclipse启动apk时)。

Is a way? 不在?

i ussually use this code below to know which layout i run if i have many layout design size: 如果我有很多布局设计尺寸,我通常使用下面的代码来知道运行哪个布局:

Display display = ((WindowManager) getSystemService(WINDOW_SERVICE))
                .getDefaultDisplay();

int orientation = display.getOrientation();

// use this to see on your console
System.out.println("Screen Size: " + orientation);

// use this to see on logcat
Log.v(TAG, "Screen Size:" + orientation);

from that i think you can know which layout size that load when you execute the application. 由此我认为您可以知道执行应用程序时加载的布局大小。

I found something like that: 我发现了这样的东西:

DisplayMetrics m = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(m);
Log.d(TAG, "@@@@@@ " + m);

but it is not exactly what I wanted. 但这不是我想要的。 But I'm closer. 但是我离我更近了。

So how recalculate result like this 那么如何重新计算这样的结果

DisplayMetrics{density=0.75, width=320, height=240, scaledDensity=0.75, xdpi=132.52174, ydpi=133.2459}

on swXXXX? 在swXXXX上?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android:找出运行该线程的核心 - Android: Find out which core the thread is running on 如何找出APK文件具有哪个签名版本? - How to find out which signature verison an APK file has? 我可以检查任何应用程序的布局以找出它们在 Android 设备上使用的组件吗? - Can I inspect any app's layout to find out which components they are using on Android device? Android:如何找到 APK 的目标平台版本? - Android: How to find which platform version an APK targets? 有没有办法找出在PC android模拟器上运行apk文件时写入的文件? - Is there a way to find out what files are written when running apk file on a PC android emulator? 如何找出特定屏幕适合的布局? - How to find out which layout a particular screen fits in? Android中的activity和fragment之外的函数如何使用布局组件? - How to use layout components in functions which are out of activities and fragments in Android? 如何在Android上找到APK路径? - How to find the apk path on android? 如何找出给定应用程序安装中使用了给定 .apk 的哪个架构版本? - How to find out which architecture version from a given .apk was used on a given app installation? 如何找出未安装APK的名称包? - How to find out name package not installed apk?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM