[android-developers] Re: Resource not found
Tnx for your answer. I have checked this and i am using 'drawable' and 'values' folder for resources. I am not building with latest sdk, i built it agains android 1.6. I would also like to mention i am using uses-sdk android:minSdkVersion=3 android:targetSdkVersion=4/ for my app to work on 1.5 but to scale correctly on 1.6+ devices. Could this be a problem? On Oct 27, 4:25 pm, Lance Nanek lna...@gmail.com wrote: One thing to watch out for is that recent Android SDK versions will append -v4 toresourcefolders that use a specifier that Android 1.5 doesn't understand. Before this Android 1.5 would sometimes read the folder anyway. So, for example, if you had a drawable-mdpi directory and switched to the latest build tools, it is actually now drawable- mdpi-v4, which Android 1.5 won't read. For that particular case you can just make the folder named drawable instead anyway, since it is considered medium density class by default. On Oct 27, 6:11 am, Surfer kalik...@yahoo.com wrote: Hi Hi, i have an app that runs on some 1.5 devices and is preloaded. I have now created an update for my app. I have just tested upgrade and it has an issue. I'd like to mention that my upgraded version has more string/drawable resources than the old one. What happens is when i get to the package installer and get the message This will replace another application logcat warns me: 10-26 09:58:23.986: WARN/PackageManager(860): Failure retrieving icon 0x7f02004b in package com.example 10-26 09:58:23.986: WARN/PackageManager(860): android.content.res.Resources$NotFoundException:ResourceID #0x7f02004b 10-26 09:58:23.986: WARN/PackageManager(860): at android.content.res.Resources.getValue(Resources.java:846) 10-26 09:58:23.986: WARN/PackageManager(860): at android.content.res.Resources.getDrawable(Resources.java:534) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ApplicationContext $ApplicationPackageManager.getDrawable(ApplicationContext.java:1923) 10-26 09:58:23.986: WARN/PackageManager(860): at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:112) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.packageinstaller.PackageUtil.getApplicationIcon(PackageUtil.java: 92) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.packageinstaller.PackageUtil.initAppSnippet(PackageUtil.java: 101) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.packageinstaller.PackageInstallerActivity.onCreate(PackageInstallerActivity.java: 349) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1123) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2231) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2284) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.access$1800(ActivityThread.java:112) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 10-26 09:58:23.986: WARN/PackageManager(860): at android.os.Handler.dispatchMessage(Handler.java:99) 10-26 09:58:23.986: WARN/PackageManager(860): at android.os.Looper.loop(Looper.java:123) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.main(ActivityThread.java:3948) 10-26 09:58:23.986: WARN/PackageManager(860): at java.lang.reflect.Method.invokeNative(Native Method) 10-26 09:58:23.986: WARN/PackageManager(860): at java.lang.reflect.Method.invoke(Method.java:521) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 10-26 09:58:23.986: WARN/PackageManager(860): at dalvik.system.NativeStart.main(Native Method) 10-26 09:58:24.006: WARN/ResourceType(860): getEntry failing because entryIndex 180 is beyond type entryCount 152 10-26 09:58:24.006: WARN/ResourceType(860): Failure getting entry for 0x7f0800b4 (t=7 e=180) in package 0: 0x8001 10-26 09:58:24.026: WARN/PackageManager(860): Failure retrieving text 0x7f0800b4 in package com.example 10-26 09:58:24.026: WARN/PackageManager(860): android.content.res.Resources$NotFoundException: StringresourceID #0x7f0800b4 10-26 09:58:24.026: WARN/PackageManager(860): at android.content.res.Resources.getText(Resources.java:155) 10-26 09:58:24.026: WARN/PackageManager(860): at android.app.ApplicationContext $ApplicationPackageManager.getText(ApplicationContext.java:2240) 10-26 09:58:24.026: WARN/PackageManager(860): at android.content.pm.PackageItemInfo.loadLabel
[android-developers] Resource not found
Hi Hi, i have an app that runs on some 1.5 devices and is preloaded. I have now created an update for my app. I have just tested upgrade and it has an issue. I'd like to mention that my upgraded version has more string/drawable resources than the old one. What happens is when i get to the package installer and get the message This will replace another application logcat warns me: 10-26 09:58:23.986: WARN/PackageManager(860): Failure retrieving icon 0x7f02004b in package com.example 10-26 09:58:23.986: WARN/PackageManager(860): android.content.res.Resources$NotFoundException: Resource ID #0x7f02004b 10-26 09:58:23.986: WARN/PackageManager(860): at android.content.res.Resources.getValue(Resources.java:846) 10-26 09:58:23.986: WARN/PackageManager(860): at android.content.res.Resources.getDrawable(Resources.java:534) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ApplicationContext $ApplicationPackageManager.getDrawable(ApplicationContext.java:1923) 10-26 09:58:23.986: WARN/PackageManager(860): at android.content.pm.PackageItemInfo.loadIcon(PackageItemInfo.java:112) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.packageinstaller.PackageUtil.getApplicationIcon(PackageUtil.java: 92) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.packageinstaller.PackageUtil.initAppSnippet(PackageUtil.java: 101) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.packageinstaller.PackageInstallerActivity.onCreate(PackageInstallerActivity.java: 349) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1123) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2231) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2284) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.access$1800(ActivityThread.java:112) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 10-26 09:58:23.986: WARN/PackageManager(860): at android.os.Handler.dispatchMessage(Handler.java:99) 10-26 09:58:23.986: WARN/PackageManager(860): at android.os.Looper.loop(Looper.java:123) 10-26 09:58:23.986: WARN/PackageManager(860): at android.app.ActivityThread.main(ActivityThread.java:3948) 10-26 09:58:23.986: WARN/PackageManager(860): at java.lang.reflect.Method.invokeNative(Native Method) 10-26 09:58:23.986: WARN/PackageManager(860): at java.lang.reflect.Method.invoke(Method.java:521) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) 10-26 09:58:23.986: WARN/PackageManager(860): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 10-26 09:58:23.986: WARN/PackageManager(860): at dalvik.system.NativeStart.main(Native Method) 10-26 09:58:24.006: WARN/ResourceType(860): getEntry failing because entryIndex 180 is beyond type entryCount 152 10-26 09:58:24.006: WARN/ResourceType(860): Failure getting entry for 0x7f0800b4 (t=7 e=180) in package 0: 0x8001 10-26 09:58:24.026: WARN/PackageManager(860): Failure retrieving text 0x7f0800b4 in package com.example 10-26 09:58:24.026: WARN/PackageManager(860): android.content.res.Resources$NotFoundException: String resource ID #0x7f0800b4 10-26 09:58:24.026: WARN/PackageManager(860): at android.content.res.Resources.getText(Resources.java:155) 10-26 09:58:24.026: WARN/PackageManager(860): at android.app.ApplicationContext $ApplicationPackageManager.getText(ApplicationContext.java:2240) 10-26 09:58:24.026: WARN/PackageManager(860): at android.content.pm.PackageItemInfo.loadLabel(PackageItemInfo.java:88) 10-26 09:58:24.026: WARN/PackageManager(860): at com.android.packageinstaller.PackageUtil.getApplicationLabel(PackageUtil.java: 81) 10-26 09:58:24.026: WARN/PackageManager(860): at com.android.packageinstaller.PackageUtil.initAppSnippet(PackageUtil.java: 103) 10-26 09:58:24.026: WARN/PackageManager(860): at com.android.packageinstaller.PackageInstallerActivity.onCreate(PackageInstallerActivity.java: 349) 10-26 09:58:24.026: WARN/PackageManager(860): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1123) 10-26 09:58:24.026: WARN/PackageManager(860): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2231) 10-26 09:58:24.026: WARN/PackageManager(860): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2284) 10-26 09:58:24.026: WARN/PackageManager(860): at android.app.ActivityThread.access$1800(ActivityThread.java:112) 10-26 09:58:24.026: WARN/PackageManager(860): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 10-26 09:58:24.026: WARN/PackageManager(860): at
[android-developers] Re: Application installation
Tnx for the response Dianne. As i mentioned above my app is a system app, it is registered under / data/system/packages.xml with system=true. Doesn't this mean it's part of the system and it has corresponding rights. Sry, still don't understand why the intent doesn't launch the installer. On Aug 28, 11:14 pm, Dianne Hackborn hack...@android.com wrote: You can do it if you are pre-installed on the phone as part of the system. Otherwise you can not. On Sat, Aug 28, 2010 at 8:17 AM, Surfer kalik...@yahoo.com wrote: Why not? Android Market does it.. On Aug 26, 2:50 pm, { Devdroid } webnet.andr...@gmail.com wrote: On 26 August 2010 14:34, Surfer kalik...@yahoo.com wrote: works. What i would like to do is perform asilentinstall, You should not be able to do so. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Application installation
But you noticed that every other package is listed in that file too, right? Every other package is listed there - yes, every package is marked with system=true - no No. In general, if you are regular developer (as most here is) you won't be able to make any system app on non rooted devices just because you wish so The app will not be a third party application for the user to install, it will be included in the device OS, and i wish to simulate this, so far i managed simulating system app but not package install... On Aug 30, 4:44 pm, { Devdroid } webnet.andr...@gmail.com wrote: On 30 August 2010 09:58, Surfer kalik...@yahoo.com wrote: As i mentioned above my app is a system app, it is registered under / data/system/packages.xml with system=true. But you noticed that every other package is listed in that file too, right? Doesn't this mean it's part of the system and it has corresponding rights. No. In general, if you are regular developer (as most here is) you won't be able to make any system app on non rooted devices just because you wish so -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Application installation
Why not? Android Market does it.. On Aug 26, 2:50 pm, { Devdroid } webnet.andr...@gmail.com wrote: On 26 August 2010 14:34, Surfer kalik...@yahoo.com wrote: works. What i would like to do is perform asilentinstall, You should not be able to do so. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Application installation
Hi I am trying to install an application from within another application. I know the usual way it to launch an intent with Intent.ACTION_VIEW, present it to the user and let him agree and this works. What i would like to do is perform a silent install, with no user interaction. I'd like to mention that my application is a system application, it has system rights! Still i can't seem to install it using Intent.ACTION_PACKAGE_INSTALL. I've set uses-permission android:name=android.permission.INSTALL_PACKAGES/ in my manifest and used this code: Intent intent = new Intent(Intent.ACTION_PACKAGE_INSTALL); installIntent.setDataAndType(apkUri, application/vnd.android.package- archive); startActivity(intent); I get No Activity found to handle Intent on logCat. What is the correct intent to launch the installer? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Gallery display issue
Hi, i've created a gallery, using the hello gallery tutorial from here: http://developer.android.com/guide/tutorials/views/hello-gallery.html . It's working fine but i noticed running on an android 1.6 WVGA(800) emulator the gallery is not displayed correctly. Setting layout params to 70, 70 my gallery looks like this http://yfrog.com/mg67528352p Setting params to 90, 90 my gallery looks like this http://yfrog.com/jc10531135p None of these is right. Is there a way around this? Maybe define the image layout in the gallery in xml, anyone know how to do that? I'd like to make my gallery look the same way on all resolutions and densities Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Dialog is leaked on orientation change
I added this code @Override protected void onPause() { super.onPause(); try{ System.out.println(dismissing!!!); dismissDialog(TEST_DIALOG); }catch(Exception e){ e.printStackTrace(); } } @Override protected void onResume() { super.onResume(); System.out.println(in onresume!!); if(alert==null){ System.out.println(Recreating dialog!); showDialog(TEST_DIALOG); } } Unfortunately oncreatedialog is still fired twice, so onresume never recreates it cause it's already there, the leak error as well. Any ideas? On Jun 24, 3:21 am, Brad Gies rbg...@gmail.com wrote: You should dismiss it in OnPause and recreate it in OnResume if you still want it. On 23/06/2010 6:02 AM, Surfer wrote: Hi, built a simple app that displays an alertDialog with two buttons. The problem is it's not getting dismissed when i change orientation. After change i get a leak warning on debugger and the dialog appears twice(pressing back hides the first dialog, only a second back dismisses it completely). Any ideas? Here is my code: public class MyActivity extends Activity { private static final int TEST_DIALOG = 0; private AlertDialog alert; /** * Called when the activity is first created. */ �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.showDialog(TEST_DIALOG); } �...@override protected Dialog onCreateDialog(int id) { switch(id){ case TEST_DIALOG: AlertDialog.Builder builder = new AlertDialog.Builder(this); alert = builder.create(); alert.setMessage(Test Message); alert.setButton(Start, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface arg0, int arg1){ alert.dismiss(); } }); alert.setButton2(Exit, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface arg0, int arg1){ MyActivity.this.finish(); } }); return alert; } return alert; } �...@override protected void onDestroy() { super.onDestroy(); if(alert!=null) alert.dismiss(); } } Warning i get: Activity com.example.MyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$Decor v...@43b29210 that was originally added here android.view.WindowLeaked: Activity com.example.MyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$Decor v...@43b29210 that was originally added here at android.view.ViewRoot.init(ViewRoot.java:230) at android.view.WindowManagerImpl.addView(WindowManag erImpl.java:148) at android.view.WindowManagerImpl.addView(WindowManag erImpl.java:91) at android.view.Window$LocalWindowManager.addView(Win dow.java:459) at android.app.Dialog.show(Dialog.java:239) at android.app.Activity.showDialog(Activity.java:2488 ) at com.example.MyActivity.onCreate(MyActivity.java:22 ) at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2459) at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2512) at android.app.ActivityThread.handleRelaunchActivity( ActivityThread.java: 3625) at android.app.ActivityThread.access$2300(ActivityThr ead.java:119) at android.app.ActivityThread$H.handleMessage(Activit yThread.java: 1867) at android.os.Handler.dispatchMessage(Handler.java:99 ) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.jav a:4363) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:618) at dalvik.system.NativeStart.main(Native Method) Unexpected resume of com.example while already resumed in com.example When changing orientation the activity gets destroyed and recreated but after onCreate has finished creating the dialog, onCreateDialog is run again, why is this happening? -- Sincerely, Brad Gies --- Bistro Bot - Bistro Blurbhttp://www.bgies.comhttp://www.bistroblurb.comhttp://www.ihottonight.com --- Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead -- You
[android-developers] Dialog is leaked on orientation change
Hi, built a simple app that displays an alertDialog with two buttons. The problem is it's not getting dismissed when i change orientation. After change i get a leak warning on debugger and the dialog appears twice(pressing back hides the first dialog, only a second back dismisses it completely). Any ideas? Here is my code: public class MyActivity extends Activity { private static final int TEST_DIALOG = 0; private AlertDialog alert; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.showDialog(TEST_DIALOG); } @Override protected Dialog onCreateDialog(int id) { switch(id){ case TEST_DIALOG: AlertDialog.Builder builder = new AlertDialog.Builder(this); alert = builder.create(); alert.setMessage(Test Message); alert.setButton(Start, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface arg0, int arg1){ alert.dismiss(); } }); alert.setButton2(Exit, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface arg0, int arg1){ MyActivity.this.finish(); } }); return alert; } return alert; } @Override protected void onDestroy() { super.onDestroy(); if(alert!=null) alert.dismiss(); } } Warning i get: Activity com.example.MyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$Decor v...@43b29210 that was originally added here android.view.WindowLeaked: Activity com.example.MyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$Decor v...@43b29210 that was originally added here at android.view.ViewRoot.init(ViewRoot.java:230) at android.view.WindowManagerImpl.addView(WindowManag erImpl.java:148) at android.view.WindowManagerImpl.addView(WindowManag erImpl.java:91) at android.view.Window$LocalWindowManager.addView(Win dow.java:459) at android.app.Dialog.show(Dialog.java:239) at android.app.Activity.showDialog(Activity.java:2488 ) at com.example.MyActivity.onCreate(MyActivity.java:22 ) at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2459) at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2512) at android.app.ActivityThread.handleRelaunchActivity( ActivityThread.java: 3625) at android.app.ActivityThread.access$2300(ActivityThr ead.java:119) at android.app.ActivityThread$H.handleMessage(Activit yThread.java: 1867) at android.os.Handler.dispatchMessage(Handler.java:99 ) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.jav a:4363) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:860) at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:618) at dalvik.system.NativeStart.main(Native Method) Unexpected resume of com.example while already resumed in com.example When changing orientation the activity gets destroyed and recreated but after onCreate has finished creating the dialog, onCreateDialog is run again, why is this happening? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Extracting data with aapt
Hi there. I would like to extract some data from android manifest of an apk. Using aapt d badging my-application.apk works but only partially, i can get most of the info i need but i'm still missing these: - if supports-screens has anydensity set to true or false - if the apk includes native libraries and if it's possible to check if these libraries target ARMv5TE platform -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en