error getting motdapp info什么意思

Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.
I'm having some trouble retrieving icons for installed Android App. The following code returns icons for all apps, however, some apps are returned with small icons (perhaps from drawable - ldpi folder) while some with large icons.
List&PackageInfo& package = getPackageManager().getInstalledPackages(0);
for(PackageInfo p : package){
iApp.icon = p.applicationInfo.loadIcon(getPackageManager());
How Can I get icons which are all of the same size, just like in Manage Application section of Android?
3,52472244
Apps might just have different sized icons.
The Android Settings app loads icons just like you.
It scales the icons when displaying them.
Here's a snippet from packages/apps/Settings/res/layout/manage_applications_item.xml:
&ImageView android:id="@+id/app_icon"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"
android:layout_marginRight="11dip"
android:layout_gravity="center_vertical"
android:scaleType="fitCenter"/&
I want to add something to previous answer what applies to Android 3.0 and greater.
You can notice that icons retrieved in this standard way (i mean applicationInfo.loadIcon and other typical methods) are smaller than icons you see in launcher app. Scale up just makes icons blurrier. If you want big icons you can use next code (i took it from launcher source code you can find
and changed a bit). Pay your attention to activityManager.getLauncherLargeIconDensity method.
public Drawable getFullResDefaultActivityIcon() {
return getFullResIcon(Resources.getSystem(), android.R.mipmap.sym_def_app_icon);
public Drawable getFullResIcon(Resources resources, int iconId) {
ActivityManager activityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
int iconDpi = activityManager.getLauncherLargeIconDensity();
d = resources.getDrawableForDensity(iconId, iconDpi);
} catch (Resources.NotFoundException e) {
return (d != null) ? d : getFullResDefaultActivityIcon();
public Drawable getFullResIcon(String packageName, int iconId) {
resources = mContext.getPackageManager().getResourcesForApplication(packageName);
} catch (PackageManager.NameNotFoundException e) {
resources =
if (resources != null) {
if (iconId != 0) {
return getFullResIcon(resources, iconId);
return getFullResDefaultActivityIcon();
public Drawable getFullResIcon(ResolveInfo info) {
return getFullResIcon(info.activityInfo);
public Drawable getFullResIcon(ActivityInfo info) {
resources = mContext.getPackageManager().getResourcesForApplication(info.applicationInfo);
} catch (PackageManager.NameNotFoundException e) {
resources =
if (resources != null) {
int iconId = info.getIconResource();
if (iconId != 0) {
return getFullResIcon(resources, iconId);
return getFullResDefaultActivityIcon();
private Drawable getAppIcon(ResolveInfo info) {
return getFullResIcon(info.activityInfo);
Hope it helps someone.
3,82212128
Although, this has been answered a long time back, here is the complete function. Hope it will help others.
To get the icon, you should query for icon for different dpi.
public static Drawable getIconFromPackageName(String packageName, Context context)
PackageManager pm = context.getPackageManager();
if (Build.VERSION.SDK_INT &= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
PackageInfo pi = pm.getPackageInfo(packageName, 0);
Context otherAppCtx = context.createPackageContext(packageName, Context.CONTEXT_IGNORE_SECURITY);
int displayMetrics[] = {DisplayMetrics.DENSITY_XHIGH, DisplayMetrics.DENSITY_HIGH, DisplayMetrics.DENSITY_TV};
for (int displayMetric : displayMetrics)
Drawable d = otherAppCtx.getResources().getDrawableForDensity(pi.applicationInfo.icon, displayMetric);
if (d != null)
catch (Resources.NotFoundException e)
Log.d(TAG, "NameNotFound for" + packageName + " @ density: " + displayMetric);
catch (Exception e)
// Handle Error here
ApplicationInfo appInfo =
appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
catch (PackageManager.NameNotFoundException e)
return appInfo.loadIcon(pm);
2,98921635
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Top questions and answers
Important announcements
Unanswered questions
By subscribing, you agree to the
Stack Overflow works best with JavaScript enabled(词条-相关词数量)
(推荐度-词条-相关词数)Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.
I recently moved a ipad project I was working on to a new folder and thought I changed everything so it would run.
Apparently not.
I searched all over the forum but none of the answers seemed to be the problem.
When I clean the app it is successful but fails to run.
My .app file in Products folder is now red.
this is the error I am getting and can't figure out what has changed.
the only other new thing is that i renewed my DEV account with apple.
But none of my other xcode projects are having this problem.
**** I noticed that my project name and the Build name seem to be different.
i would post the image here but seems i'm not allowed.
error code:
Ld /Users/mo-ry/Library/Developer/Xcode/DerivedData/Prop_Tablet-czmhxyzuhrifndgzesduqempenjo/Build/Products/Debug-iphonesimulator/Prop\ Tablet.app/Prop\ Tablet normal i386
cd "/Developer/Xcode 5.2 Projects/1 SUBMIT to App Store/Prop Tablet Blue_Green"
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/mo-ry/Library/Developer/Xcode/DerivedData/Prop_Tablet-czmhxyzuhrifndgzesduqempenjo/Build/Products/Debug-iphonesimulator -F/Users/mo-ry/Library/Developer/Xcode/DerivedData/Prop_Tablet-czmhxyzuhrifndgzesduqempenjo/Build/Products/Debug-iphonesimulator -filelist /Users/mo-ry/Library/Developer/Xcode/DerivedData/Prop_Tablet-czmhxyzuhrifndgzesduqempenjo/Build/Intermediates/Prop\ Tablet.build/Debug-iphonesimulator/Prop\ Tablet.build/Objects-normal/i386/Prop\ Tablet.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.0 -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/mo-ry/Library/Developer/Xcode/DerivedData/Prop_Tablet-czmhxyzuhrifndgzesduqempenjo/Build/Intermediates/Prop\ Tablet.build/Debug-iphonesimulator/Prop\ Tablet.build/Objects-normal/i386/Prop\ Tablet_dependency_info.dat -o /Users/mo-ry/Library/Developer/Xcode/DerivedData/Prop_Tablet-czmhxyzuhrifndgzesduqempenjo/Build/Products/Debug-iphonesimulator/Prop\ Tablet.app/Prop\ Tablet
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Anyone got any ideas?
An Xcode project simply holds references to file paths and does not represent the actual underlying directory structure of your project directory. Understand this and you will be able to solve a great many problems that people have with Xcode.
Before you moved your iPad project, its references to the files within the project were correct - after moving it, the references are no longer correct. This is a complaint so many devs have with Xcode and it causes so many problems.
What you will need to do is go through each file in your project in Xcode navigation pane and check that it's file reference location matches where it is physically on disk.
I suspect that your project held relative file path references, and when you moved it they're not in the same relative location.
This is the area of Xcode where you can change the file path references:
(referenced from this SO answer: )
In answer to your specific error message - the linker is telling you that it can't find the symbol for the main function. What probably happened is that during the move the mian.m file was somehow removed from the target for your app (did you create a new target in trying to solve the issue and forget to add the main.m file to it?
39.7k23120166
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled用心创造滤镜
扫码下载App
汇聚2000万达人的兴趣社区下载即送20张免费照片冲印
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
成长中....
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
刚刚尝试使用read读取“北京欢迎你MV.avi”时,出现如下错误: && mov = aviread('北京欢迎你MV.avi');??? Unable to locate decompressor to decompress video streamError in ==& aviread at 63& & X = readavi(info.Filename,-1);复制很奇怪,使用aviinfo读取信息时明明没有出错,结果如下: && aviinfo('北京欢迎你MV.avi')ans = & && && && &&&Filename: '北京欢迎你MV.avi'& && && && &&&FileSize: & && && &&&FileModDate: '28-Sep-:54'& && && && & NumFrames: 12300& && & FramesPerSecond: 30& && && && && &&&Width: 720& && && && && & Height: 480& && && && & ImageType: 'grayscale'& && &VideoCompression: 'XVID'& && && && && &Quality: 0& & NumColormapEntries: 0& && && &&&AudioFormat: 'Format #85'& && && && & AudioRate: 48000& && &NumAudioChannels: 2复制代码不知何因,于是,搜索得到如下近似的经验之谈。不过,我的问题不太相同。首先,我的WMP播放avi的时,只有声音,没有。就像作错误提示说的:找不到解码器。于是,我了响应的解码器,地址为:the Intel ITU H.264 (H264) codec, see . 安装之后,WMP可以正常播放,然后重启,再次尝试读取,ok!只是提示,超出内存错误。另一中错误方案,援引如下:------------------------------------------------------------------------------selected from: 1.出现问题在使用matlab做实验的时候出现问题,具体信息如下:&& m2=aviread('C:\test.avi');??? Error getting frame data.Error in ==& aviread at 63& & X = readavi(info.Filename,-1);由错误提示信息,可知是读取帧时出错了。猜测一下:文件损坏? 不支持该文件格式?对于第一个猜测,我用播放器看一下该AVI文件,可播放,所以不会是文件损坏了。对于第二个猜测,要看些文档。用help aviread命令该能找到点信息。&& AVIREAD Read AVI file. & & MOV = AVIREAD(FILENAME) reads the AVI movie FILENAME into the& & MATLAB movie structure MOV. If FILENAME does not include an& & extension, then '.avi' will be used. MOV has two fields, "cdata"& & and "colormap". If the frames are truecolor images, MOV.cdata will& & be Height-by-Width-by-3 and MOV.colormap will be empty. If the& & frames are indexed images, then MOV.cdata field will be& & Height-by-Width and MOV.colormap will be M-by-3. On UNIX, FILENAME& & must be an uncompressed AVI file.& && & MOV = AVIREAD(...,INDEX) reads only the frame(s) specified by& & INDEX.&&INDEX can be a single index or an array of indices into the& & video stream, where the first frame is number one.& & & & The supported frame types are 8-bit (indexed or grayscale), & & 16-bit grayscale or 24-bit (TrueColor) frames.
& & See also aviinfo, avifile, movie.& & Reference page in Help browser& && & doc aviread细读该帮助信息,可发现,在文档的最后有提到“frame types”,即帧的类型。这个跟错误信息有极大的类似。文档中提到,matlab支持灰度级是8位(索引式或灰度)、16位或是24位(即真彩色)的帧。打开test.avi的信息,C:\test.avi& &General& && &Complete name : C:\test.avi& && &Format : AVI& && &Format/Info : Audio Video Interleave& && &Format/Family : RIFF& && &File size : 1.88 MiB& && &PlayTime : 12s& && &Bit rate : 1304 Kbps& && &StreamSize : 15.9 KiB& &Video #0& && &Codec : DivX 4& && &Codec/Family : MPEG-4& && &Codec/Info : Project Mayo DivX 4& && &Codec settings/PacketBitStream : No& && &Codec settings/BVOP : No& && &Codec settings/QPel : No& && &Codec settings/GMC : 0& && &Codec settings/Matrix : Default& && &PlayTime : 12s& && &Bit rate : 1300 Kbps& && &Width : 352 pixels& && &Height : 240 pixels& && &Aspect ratio : 1.467& && &Frame rate : 30.000 fps& && &Resolution : 8 bits& && &Chroma : 4:2:0& && &Interlacement : Progressive& && &Bits/(Pixel*Frame) : 0.513& && &StreamSize : 1.86 MiB& && &Writing library : avc2.0.11.1110看到这个文件的编码格式是Divx4,分辨率是8位。这个文件我是用格式转换器进行过转换的,由mpg文件转化为avi文件。看来是这个原因了。3.解决问题& & 本来想先找个其它的avi文件来试试,可以的话,就看看它是什么格式的。但一时间找不到,就直接找了一个强大的格式转换:WinAVI Video Converter。& & 用它来转换了一下,却出现以下的错误:&& m2=aviread('C:\test3.avi');??? Unable to locate decompressor to decompress video streamError in ==& aviread at 63& & X = readavi(info.Filename,-1);& & 错误提示信息是:没有找到正确的解码器来解码视频流。& & 然后我试了几个编码的形式,都出现了同样的错误。看来matlab支持的格式很有限。接着,我找了找AVI的格式,网上有人说matlab支持的是AVI早期的格式。& & 我在WinAVI里再找了找,有一个没有压缩的编码器,叫ZJMedia Uncompress RGB24和ZJMedia Uncompress RGB32,就是有24位和32位的选择,就选用了24位的格式转换了一下,结果,通过了。& & 看看转换后文件的信息:C:\test4.avi& &General& && &Complete name : C:\test4.avi& && &Format : AVI& && &Format/Info : Audio Video Interleave& && &Format/Family : RIFF& && &File size : 72.3 MiB& && &PlayTime : 9s 966ms& && &Bit rate : 61 Mbps& &Video #0& && &Codec : RGB& && &PlayTime : 9s 966ms& && &Bit rate : 61 Mbps& && &Width : 352 pixels& && &Height : 240 pixels& && &Aspect ratio : 1.467& && &Frame rate : 30.000 fps& && &Resolution : 24 bits& && &Bits/(Pixel*Frame) : 24.011可以看到,这里的编码信息直接是RGB,也就是没有经过压缩的,分辨率是24位的。符合要求!
阅读(1762)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_081064',
blogTitle:'matlab读取avi文件出错:Unable to locate decompressor to decompress……Error getting frame data.',
blogAbstract:'matlab读取avi文件出错:Unable to locate decompressor to decompress……
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}

我要回帖

更多关于 session app error 的文章

 

随机推荐