[android-developers] Re: SharedUserId: Things that Cannot Change http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html
Sadly that open issue has been marked unreproducible ... I don't understand why but I guess it's not going to be addressed. I checked all the documentation about the UID of the app and I didn't find anything warning of it being impossible to change. I just was trying to simplify some internal stuff and realized there might be some conflict with other things. Because of the way you have to think so far ahead with it, I think it would actually be better to make it a required field. That way it gives the product at least the option of utilizing it further down the road. Ok at least I know I am not crazy. Thanks Nikolay. -Greg On Jul 24, 10:26 pm, Nikolay Elenkov nikolay.elen...@gmail.com wrote: On Mon, Jul 25, 2011 at 12:39 PM, Greg Giacovelli miyamo...@gmail.com wrote: Would SharedUserId be worth calling out. I currently don't have one set on any of my apps, but after playing around with the feature while trying to get a Test Project to run as the same user ... I think it's not really possible to change the user_id with a live app without some big issues. If sharedUserId was not set, and you set it afterwards, the UID of the app changes. I think it's mentioned somewhere in the docs, but can't seem to find the reference. So, basically, if you want to have two (or more) apps with a shared UID, you have to design for this in advance. E.g., release one app with sharedUserId=foo and the next one with the same. There is an open issue though: http://code.google.com/p/android/issues/detail?id=1227 However even with my idea of making a release with world writable files, I don't believe I would ever be able to create new files within /data/data/my_package. I am wondering that if the package name has to be unique anyways for the package manager, why they just didn't make the default user_id the package_name of the app. Then with the correct signing cert and agreed upon name you would be able to migrate to a userid if need be. ... Or am I completely wrong? Interesting proposition. It does seem that the system manages shared UIDs differently from 'regular' ones, so maybe that's the reason this hasn't been (can't?) be done? -- 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: SharedUserId: Things that Cannot Change http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html
Yeah I think I might, I read that code too. I think if you get a littler further it prints out something like can't move file because UID is different so you end up with just a broken app that is sort of stuck since you can't read/delete/write to old data and aren't allowed to create new data. On Jul 25, 2:49 am, Nikolay Elenkov nikolay.elen...@gmail.com wrote: On Mon, Jul 25, 2011 at 4:14 PM, Greg Giacovelli miyamo...@gmail.com wrote: Sadly that open issue has been marked unreproducible ... I don't understand why but I guess it's not going to be addressed. I found another :) http://code.google.com/p/android/issues/detail?id=4381 Comment 2 says that changing to a sharedUserId is unsupported. Digging into this further, PackageManagerService.java creates a new package entry if the sharedUserId has changed, there is even a warning: reportSettingsProblem(Log.WARN, Package + name + shared user changed from + (p.sharedUser != null ? p.sharedUser.name : nothing) + to + (sharedUser != null ? sharedUser.name : nothing) + ; replacing with new); It then iterates over all assigned UID (quote: 'stupidly inefficient for now' :)) and returns a new one. Why it's done this way I have no idea though. BTW, the sharedUserId is saved in packages.xml along with other package info. I checked all the documentation about the UID of the app and I didn't find anything warning of it being impossible to change. Maybe I read it in some bug report, like the one above. You might want to file a documentation bug for this. -- 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] SharedUserId: Things that Cannot Change http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html
Would SharedUserId be worth calling out. I currently don't have one set on any of my apps, but after playing around with the feature while trying to get a Test Project to run as the same user ... I think it's not really possible to change the user_id with a live app without some big issues. The only way I can think to do it is to release an apk which changes all elements in /data/data/* to be opened with Context.MODE_WORLD_WRITEABLE and then later in another apk release, change the sharedUserId to the value desired. This sounds pretty bad. My theory is based on just very primitive tests of upgrading from a debug build with no sharedUserId to a debug build of the same package (cert) and realizing that any attempt to read anything in the /data/data/my_package either throws a SecurityException or FileNotFoundException (even when writing a new file). I think this should really be called out in the documentation, similar to how package name has big bold letters around it all the time that says (DO NOT CHANGE!) :) However even with my idea of making a release with world writable files, I don't believe I would ever be able to create new files within /data/data/my_package. I am wondering that if the package name has to be unique anyways for the package manager, why they just didn't make the default user_id the package_name of the app. Then with the correct signing cert and agreed upon name you would be able to migrate to a userid if need be. ... Or am I completely wrong? -- 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: Android 2.1 Emulator proxy settings
Same here :) On Jul 18, 2:39 pm, Zoon smerr...@gmail.com wrote: I'm not having luck using -http-proxy on tools r12 for some reason. Had to revert to r11. Is anyone else having this problem? On Jul 12, 7:44 am, superprogrammer jkerns...@gmail.com wrote: I need to access the internet on the emulator for an app. How can i change theproxysettings in telKila to allow access to the internet? I have tried Menu - Settings - Wireless Controls Mobile Networks Access Point Names No luck there I tried running this from the command line emulator -avd myavd -http-proxyhttp://address:port still no luck any help? -- 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] Is there a way to include permissions only during Testing?
Hi, I have a test project that mocks out a bunch of locations and sends them through my application project. I don't want my application to include the ACCESS_MOCK_LOCATION permission so I wanted to include it in the Test project. This seems to not give me the expected result as I always get a permission error for ACCESS_MOCK_LOCATION when I set a TestLocationProvider using the instrumentation Context. Has anyone experienced the same or know how to allow such injection? Or do I really just have to keep manually editing the App manifest before it is launched? -- 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] Why does the SharedLibrary for maps sometimes fail?
Hi, I have an application with a manifest that clearly states it requires the android maps. I know this works because if the phone doesn't have the shared lib it fails on install (that's great I am glad). But sometimes I am seeing reports as follows: Exception Ljava/lang/NoClassDefFoundError; thrown during Lcom.foo.bar.RandomClass;.clinit D/AndroidRuntime( 7529): Shutting down VM Later on in the rollup of the stack. Caused by: java.lang.NoClassDefFoundError: Lcom.foo.bar.RandomMapActivity at com.foo.bar.RandomClass.clinit(RandomClass.java:171) And earlier on in the log I have a Verify Error for a Class not found for MapActivity. Basically I just have a static block in a class referenced by my Application Object that some something like this. static { HashMapClass, String map = new HashMapClass,String(); map.put(RandomMapActivity.class, alias1); ... ALIAS_MAP = map; } It's nothing complicated it's nothing fancy either. If the sharedlib fails to load at runtime is there not a more dire issue there? What gives? -Greg -- 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: making white pixels transparent
You could try using AvoidXferMode but I believe it doesn't support transparency. Otherwise the fastest alternative in java land would be to generate a byte buffer the size of the pixels in the image and then read them from the bitmap and then set them again. You will pay the cost of read and write but you will be able to set your alpha channel. On Jan 13, 10:46 am, TreKing treking...@gmail.com wrote: On Thu, Jan 13, 2011 at 4:47 AM, crem bernd.warm...@gmail.com wrote: So... any suggestions? Read the documentation for images and bitmaps. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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] Android Emulator without a Camera, Camera.open() != null ????
Hi, So I made an AVD with hw.camera set to no, the default. I have uses feature for both camera and autofocus set and required=false. I also have the Camera permission set. I just want to make sure I don't expose a confusing UI to people without a camera. So I thought this would make the OS uphold the contract for http://developer.android.com/reference/android/hardware/Camera.html#open(int) which should return null ... but it never does? What's the deal? -- 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: Does getBestLastKnownLocation block?
Yeah sorry I was mixing what I was trying to retrieve mixed with the actual API call. But yea that is correct. It's not a phone I have either :( We can't reproduce it consistently. And a lot of the Galaxy S phones do have defects in their GPS software but I never thought it would just block. I have a few logs from clients but it seems to feel like their locking inside of their libgps code is not releasing it's global lock. We have a few other theories but since the LocationManager class isn't documented too well (it seems to be somewhat of a port of J2ME's but not completely) we are just shooting in the dark. I noticed a pattern in our application which registers the same LocationListener multiple times without deregistering it. The registration does not fail and we don't get updates after we unregister once so we assumed it was fine and made the code more readable because we didn't have to worry about side effects. However now I am not so sure. But even if that was the problem it should be something that is completely reproducible on the same OS/firmware version. To be clear we saw the same phone, Samsung Galaxy S Epic, install the app and each one may or may not get stuck in this really nasty state. Basically the overall GPS system for the OS gets frozen, even maps can't get a fix after it gets in this state. Enabled providers don't seem to be the issue as they have both GPS and network locations providers enabled on each phone. On Dec 7, 10:54 am, Mark Murphy mmur...@commonsware.com wrote: On Tue, Dec 7, 2010 at 1:49 PM, Greg Giacovelli miyamo...@gmail.com wrote: After which we call on the UI thread LocationManager.getBestLastKnownLocation() for the provider we were interested in. There is no getBestLastKnownLocation() in LocationManager in Android. I am assuming you are referring to getLastKnownLocation(). However on certain phones, the Epic in particular sometimes this call never returns. Seriously? That's a Galaxy S phone, which is pretty popular, though it is not one I have in my stable. It certainly feels like a compatibility bug. Do you have any info on criteria for when this will block (e.g., only if no providers are enabled)? -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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: Does getBestLastKnownLocation block?
Thanks Mark :( At least I don't feel crazy :) Kostya, Is it just not able to get a fix or does your phone display become completely black? If it just is not getting a fix then yes we know of that issue. But on phones where the screen goes black reoccurs even when restarting the phone (and consequently the gps). It's sort of bizarre. -Greg On Dec 8, 11:10 am, Kostya Vasilyev kmans...@gmail.com wrote: I have a Samsung Galaxy S (retail European version), and can confirm this. GPS only works immediately after it's been restarted by switching it off/on in phone settings. After a while (can't give exact duration, but somewhere between a few hours and a few days) it stops working. This affects all applications: Google Maps, GPS Test, etc. The device just never gets a GPS fix, and the GPS antenna icon in the status bar never appears when it should. From what I understand, there was supposed to be a hotfix for this, but it got steamrolled by the 2.2 update. Greg: you might want to test your code right after restarting GPS on the phone. -- Kostya 08.12.2010 21:34, Mark Murphy пишет: On Wed, Dec 8, 2010 at 1:22 PM, Greg Giacovellimiyamo...@gmail.com wrote: To be clear we saw the same phone, Samsung Galaxy S Epic, install the app and each one may or may not get stuck in this really nasty state. Basically the overall GPS system for the OS gets frozen, even maps can't get a fix after it gets in this state. Enabled providers don't seem to be the issue as they have both GPS and network locations providers enabled on each phone. I am not sure what to tell you. It feels like a device-specific bug. Unfortunately, with neither of us having one, getting a reproducible test case will be...troublesome. -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- 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] Does getBestLastKnownLocation block?
Hi, I was wondering if this is a bad thing to do or if it is just a buggy ROM. The location strategy my application uses is from the UI Thread register for a location update. We then schedule a cancel request on the handler of the UI thread within a given timeout to cancel the location update if nothing was returned in that time. After which we call on the UI thread LocationManager.getBestLastKnownLocation() for the provider we were interested in. This seemed like a sane idea since the async callback wouldn't block and we could give the user some animation loading indication for our best attempt. And if we timeout we just use the system's last known location as a best effort follow up. However on certain phones, the Epic in particular sometimes this call never returns. This call is documented as being pretty light weight and since all of the other interaction with the LocationManager is to be done on the UI thread (like registering for updates) this just seems to be understood as needing that as well. Is there a better pattern than this? -- 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] Custom Drawable Type refrerenced from XML
Hi I was wondering if something like this is possible { public class Foo extends Drawable { public void draw(Canvas canvas) { ... custom draw routine } } ... some_layout.xml ... View android:id=@+id/view1 android:background=@drawable/Foo / ... I know the second syntax doesn't work. However is such a concept possible? Like can I reference a custom drawable class implementation and ask for it to be used in place of a drawable made through an XML layout? -- 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: What are some good Automated Unit And System Test Tools for Android?
Robotium is a black box test kit though. So while I am sure it's useful, I find that things like selenium and UI blackbox testing becomes rather hard to maintain on a changing live product where the design of the UI is under constant iterations. I think I have something that seems to be meeting my needs. I have Hudson setup to build my test Project whenever any changes happen in my repo. It calls the coverage target on a modified ant build script that I made from basically looking at how the sdk constructed it's build.xml template. It's semi documented how to do this, but basically you end up copy and pasting the entire contents of the appropriate template into your build file and setting the flag import=false on the setup tag included by default. Then since you can make custom changes at this point, I swapped out adb in the build script to use a custom adb wrapper wherever adb is called. This wrapper simply execs adb and interprets the success or failure of the command by reading stdout and returns a non 0 resultcode if it detects an error in the output. Then I found this, https://github.com/jsankey/android-junit-report, which you can use instead of the standard test runner and it will generate ant junit xml reports on the device for you (Really freakin convenient). I stash the resultcode of the test run, download the reports (emma, and junit xml) and then interpret the resultcode. Hudson later treats the emma report as a build artifact and publishes the reports in a nice fashion integrated with the SCM. It seems to be a pretty simple setup for running suites of unit tests through a device. Much thanks to jsankey again for that tiny but awfully useful bridge. I think I might extend this to include parsing out the performance stuff (ddmlib seems to have some stuff for this as well) and submit that back. -Greg On Nov 3, 1:33 pm, MarcoAndroid marco...@gmail.com wrote: This tool could be useful (integrates with Maven so should integrate with Hudson):http://code.google.com/p/robotium/ I still have it on my list as to look into :) On 3 nov, 07:20, Greg Giacovelli miyamo...@gmail.com wrote: So I give in. I approached this problem as an oh hey that's not too bad, I can write a bunch of unit tests, and I have been keeping my suite green. However as things get more involved continuous integration and testing is a great great thing to have. And then I saw oh Android has emma integration as well awesome ... and then that's where it get's iffy. So I setup Hudson and have it call the coverage target of the ant build.xml that the android executable in the sdk can generate. And then it hits me. adb -s emulator shell am instrument -w ... will never return a result code that is not 0 ... because adb technically exited cleanly and usually will regardless of how the shell command that executed did. So again I say, Oh that's not too bad, I can just wrap adb with a parser that parses output for errors and return a non 0 resultcode to fail my build if a test fails. Problem is then I also want to see what tests fail. I know eclipse is doing something smarter so I dig deeper and find the extra switches you can pass am instrument including the - r flag. adb -s emulator shell am instrument -r -w ... Now this is starting to get complicated as the output gets more complex and this originally thought simple task is getting more intense. As this SDK is maturing more I have to think, someone has endured this pain and made a kickass way to automate and report on these sdk tools and output. Like something complete with performance test tracking, code coverage reporting etc. These outputs all exit in the SDK but they just have to be adapted to the tools used outside. I have to think after a year or two this adapter(s) has to have been written. However I have only been able to find blackbox testing frameworks and not anything along the lines of regression test suite automation of the whitebox sort. Any suggestions welcome. -- 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] What are some good Automated Unit And System Test Tools for Android?
So I give in. I approached this problem as an oh hey that's not too bad, I can write a bunch of unit tests, and I have been keeping my suite green. However as things get more involved continuous integration and testing is a great great thing to have. And then I saw oh Android has emma integration as well awesome ... and then that's where it get's iffy. So I setup Hudson and have it call the coverage target of the ant build.xml that the android executable in the sdk can generate. And then it hits me. adb -s emulator shell am instrument -w ... will never return a result code that is not 0 ... because adb technically exited cleanly and usually will regardless of how the shell command that executed did. So again I say, Oh that's not too bad, I can just wrap adb with a parser that parses output for errors and return a non 0 resultcode to fail my build if a test fails. Problem is then I also want to see what tests fail. I know eclipse is doing something smarter so I dig deeper and find the extra switches you can pass am instrument including the - r flag. adb -s emulator shell am instrument -r -w ... Now this is starting to get complicated as the output gets more complex and this originally thought simple task is getting more intense. As this SDK is maturing more I have to think, someone has endured this pain and made a kickass way to automate and report on these sdk tools and output. Like something complete with performance test tracking, code coverage reporting etc. These outputs all exit in the SDK but they just have to be adapted to the tools used outside. I have to think after a year or two this adapter(s) has to have been written. However I have only been able to find blackbox testing frameworks and not anything along the lines of regression test suite automation of the whitebox sort. Any suggestions welcome. -- 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: What are some good Automated Unit And System Test Tools for Android?
Sadly after looking over monkey runner, it's a java program running a python interpretter doing the same thing as what I have been writing but with a GUI. Sorry this is not what I am looking for. I guess I was hoping for at least an object model for the raw output interpreter of a test or suite of tests so that we can write tools to get useful information into dash boards. I would like to Create junit reports, dashboards etc. -Greg On Nov 3, 10:08 am, A. Elk lancaster.dambust...@gmail.com wrote: The open source SDK now has a tool called monkeyrunner, with an API for starting instrumentation from within a Python script. The call (in essence) returns a string containing the test results, as if you had intercepted the output from am instrument. One of the API methods prints out some help, and a little birdie has told me that more docs will be made available. Elk On Nov 2, 11:20 pm, Greg Giacovelli miyamo...@gmail.com wro So I give in. I approached this problem as an oh hey that's not too bad, I can write a bunch of unit tests, and I have been keeping my suite green. However as things get more involved continuous integration and testing is a great great thing to have. And then I saw oh Android has emma integration as well awesome ... and then that's where it get's iffy. So I setup Hudson and have it call the coverage target of the ant build.xml that the android executable in the sdk can generate. And then it hits me. adb -s emulator shell am instrument -w ... will never return a result code that is not 0 ... because adb technically exited cleanly and usually will regardless of how the shell command that executed did. So again I say, Oh that's not too bad, I can just wrap adb with a parser that parses output for errors and return a non 0 resultcode to fail my build if a test fails. Problem is then I also want to see what tests fail. I know eclipse is doing something smarter so I dig deeper and find the extra switches you can pass am instrument including the - r flag. adb -s emulator shell am instrument -r -w ... Now this is starting to get complicated as the output gets more complex and this originally thought simple task is getting more intense. As this SDK is maturing more I have to think, someone has endured this pain and made a kickass way to automate and report on these sdk tools and output. Like something complete with performance test tracking, code coverage reporting etc. These outputs all exit in the SDK but they just have to be adapted to the tools used outside. I have to think after a year or two this adapter(s) has to have been written. However I have only been able to find blackbox testing frameworks and not anything along the lines of regression test suite automation of the whitebox sort. Any suggestions welcome. -- 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: What are some good Automated Unit And System Test Tools for Android?
But thankfully after thinking of it some more I can just use ddmlib to get the data from adb's output. I think this will work much better than what I can find. On Nov 3, 10:38 am, Greg Giacovelli miyamo...@gmail.com wrote: Sadly after looking over monkey runner, it's a java program running a python interpretter doing the same thing as what I have been writing but with a GUI. Sorry this is not what I am looking for. I guess I was hoping for at least an object model for the raw output interpreter of a test or suite of tests so that we can write tools to get useful information into dash boards. I would like to Create junit reports, dashboards etc. -Greg On Nov 3, 10:08 am, A. Elk lancaster.dambust...@gmail.com wrote: The open source SDK now has a tool called monkeyrunner, with an API for starting instrumentation from within a Python script. The call (in essence) returns a string containing the test results, as if you had intercepted the output from am instrument. One of the API methods prints out some help, and a little birdie has told me that more docs will be made available. Elk On Nov 2, 11:20 pm, Greg Giacovelli miyamo...@gmail.com wro So I give in. I approached this problem as an oh hey that's not too bad, I can write a bunch of unit tests, and I have been keeping my suite green. However as things get more involved continuous integration and testing is a great great thing to have. And then I saw oh Android has emma integration as well awesome ... and then that's where it get's iffy. So I setup Hudson and have it call the coverage target of the ant build.xml that the android executable in the sdk can generate. And then it hits me. adb -s emulator shell am instrument -w ... will never return a result code that is not 0 ... because adb technically exited cleanly and usually will regardless of how the shell command that executed did. So again I say, Oh that's not too bad, I can just wrap adb with a parser that parses output for errors and return a non 0 resultcode to fail my build if a test fails. Problem is then I also want to see what tests fail. I know eclipse is doing something smarter so I dig deeper and find the extra switches you can pass am instrument including the - r flag. adb -s emulator shell am instrument -r -w ... Now this is starting to get complicated as the output gets more complex and this originally thought simple task is getting more intense. As this SDK is maturing more I have to think, someone has endured this pain and made a kickass way to automate and report on these sdk tools and output. Like something complete with performance test tracking, code coverage reporting etc. These outputs all exit in the SDK but they just have to be adapted to the tools used outside. I have to think after a year or two this adapter(s) has to have been written. However I have only been able to find blackbox testing frameworks and not anything along the lines of regression test suite automation of the whitebox sort. Any suggestions welcome. -- 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] Caching Via URLConnection vs HttpClient
On Android these seem to be imported directly from their 3rd party sources but I don't see them in the repo so I can't verify that. However I notice the class URLConnection has on it the setUseCaches() method on it. My intention is that for static remote assets this would be a blessing however I am unsure how it actually works or if it does anything at all. Can anyone confirm this? Like is it one of those things that may work on some handsets and not others? -- 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] Should Plurals and Quantity Strings be used?
This feature has been around since cupcake, however it has always been broken. Bugs like, http://code.google.com/p/android/issues/detail?id=8287, have been posted. The things I am finding wrong with this is that it's completely undocumented, and only works for english and czech in undefined ways. The code suggests that the current implementation doesn't meet the standards of what is desired and hasn't been changed since it was added. However going forward is it better to just not use this functionality and use a custom one off localization scheme for each application? Has everyone just been rolling their own plural mechanism? -- 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: Should Plurals and Quantity Strings be used?
I assume cz has a similar requirement although I don't know, all I have seen are these rules. en does one or other cz does just like you described. using few and what not However I find this functionality somewhat arbitrary and at the same time useless, or am I just missing something? I thought it would be something more like what you described you had to do on your own. So you could do something like ordinals or create statements like, I have X string(x) - where I could supply a value and get strings back that make sense. 0 : I have no strings, 1 : I have 1 string, 2-100 : I have 2 strings plural name=whatever item quantity=zeroI have no strings/item item quantity=oneI have 1 stringitem item quantity=otherI have %d strings/item /plural On Sep 20, 3:41 pm, Kostya Vasilyev kmans...@gmail.com wrote: I recently used this mechanism in my app. It's localized for Russian, where plurals conjugate (or is it congregate?) depending on the quantity: 2 through 4 have one ending, 5 and greater have another. Quantities like 22, 32, 123..2 are the same as just 2, except for 12 through 20. Quantities ending with a 1 are same as singular. Perhaps Czech is similarly complex. I ended up changing the way the message is worded, using an abbreviation to sidestep this issue. -- Kostya Vasilyev --http://kmansoft.wordpress.com 21.09.2010 2:24 пользователь Greg Giacovelli miyamo...@gmail.com написал: This feature has been around since cupcake, however it has always been broken. Bugs like,http://code.google.com/p/android/issues/detail?id=8287, have been posted. The things I am finding wrong with this is that it's completely undocumented, and only works for english and czech in undefined ways. The code suggests that the current implementation doesn't meet the standards of what is desired and hasn't been changed since it was added. However going forward is it better to just not use this functionality and use a custom one off localization scheme for each application? Has everyone just been rolling their own plural mechanism? -- 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%2Bunsubs cr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- 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: Is there a way to request permissions from a user as you need them?
Look there is a point where this was taken as an insult and I didn't mean that. I simply meant Apple, a company who is notorious for a good user experience all around, even has dialogs prompting users for extra permissions. Yes I don't agree with their model of the wild west. However if an app makes use of the optional permission so much that a user is constantly bombarded with dialogs then that app will probably not be voted up as highly as others. Isn't that the point of the market is to let users decide via votes and ratings, which apps are good and which aren't? Having only the wall of permissions and a market based solely on user feedback, is not a great long term distribution model. It just becomes spam at that point. I saw this permission and this app must suck : 1 star. A user has every right to publish this, however it's a problem that cannot be addressed since they can't even validate their assumption because of fear to install the app in the first place. It's not a credible review however since reviews come in so fast, is it really the job of the developer to police the downfalls of it's distributor (yes and no). I am not going to split up my application into multiple APKs as I find many end users don't understand that distribution mechanic and frankly sometimes even as a developer it's annoying. I am starting to highly doubt the future of this product if the approach being taken by the dev team is, Well it's not something we would like to address for things that are obviously a point of contention for both developers (threads like this) and end users (read the market reviews of apps in general). You don't have many apps that have all those permissions on their manifest stated because it would never get installed, however you probably won't find that many creative apps either because of it. Is the target of android phones devs or non techie consumers ... the carrier marketing would say consumers, however through the development network it seems like we are back in school debating fundamentals of security instead of addressing a problem and building a product. On Aug 28, 1:13 pm, Dianne Hackborn hack...@android.com wrote: On Sat, Aug 28, 2010 at 11:13 AM, Greg Giacovelli miyamo...@gmail.comwrote: So I am not saying use a dialog everywhere. I am saying on a per application basis. The problem with Windows Vista was that it was everywhere. I am saying in addition to a small wall of permissions representing the what permissions are needed for the core functionality of the application, you also allow a upgrade permissions. A user should not be scared to install an application because of optional features of an application that compliment, a core functionality. Apple, a company that basically gives all developers access to frightenly everything, still prompts users on a per application basis for location, notifications, etc. I can guarantee you that if this facilities exists, apps will use it extensively. We'd have a design that encourages it: showing an app's permissions up-front before installing is a strong barrier where the user is most inclined to decide the scope of what the app is doing is not worth their desire for it and reject it; asking permission later is when the user is just trying to do things and much more inclined to just say yes instead of canceling or uninstalling the app. So if I am an app developer... of course I will declare no permissions at install, and request them all as needed. I have a huge incentive to that. I will say specifically about location -- we should have some additional facilities to control that, showing the user which apps are using it and individually turning it off. But location is a special case (note it is the only thing that there is a global setting to turn off as well). And of course we don't have or need a permission for notifications. A design that doesn't require a permission but is still safe and secure is of course best. That is why I say I'd like us to introduce more ways for apps to interact with contact data without needing a permission. To me that is a much better way to spend time. I am not trying to be difficult I am just basing this on being an iPhone user previously. This platform has more potential I think but the focus on tech more so than user experience is what prevents this platform's growth. I will claim pretty strongly that our security is much better than the iPhone, and is actually a user-centric design without relying on implying to the user things it is not (such as reviewing apps providing much security). There are certainly things about Android UX that can be improved in relation to others, but we aren't trailing here. -- 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
[android-developers] Re: Is there a way to request permissions from a user as you need them?
So I am not saying use a dialog everywhere. I am saying on a per application basis. The problem with Windows Vista was that it was everywhere. I am saying in addition to a small wall of permissions representing the what permissions are needed for the core functionality of the application, you also allow a upgrade permissions. A user should not be scared to install an application because of optional features of an application that compliment, a core functionality. Apple, a company that basically gives all developers access to frightenly everything, still prompts users on a per application basis for location, notifications, etc. I would say I would like to shrink that permission list but in order to have functionality enjoyed by some, I am forced to have permissions granted by all. Also doing a quick look at your list on your phone is not.a really good test, you are a developer, ask someone outside the tech industry the something for some good feedback. I am not trying to be difficult I am just basing this on being an iPhone user previously. This platform has more potential I think but the focus on tech more so than user experience is what prevents this platform's growth. On Aug 28, 8:44 am, Brad Gies rbg...@gmail.com wrote: Yes.. we do... and I normally don't disagree with you :). But, in this instance.. I REALLY do. Let me expand on why I think it is a failing, and maybe you will see where I am coming from. I'll use the Window Firewall as an example as it is the closest example I can think of. It deals with permissions and security. This may be more of a manifestation of how I use my computer, but I think many people share this :). Assume I have a new install of Windows. I'm not very security conscious (I'm truly not.. if you want my email accounts, I have thousands more I can switch to, so I don't care), but I set my firewall to lock down everything because I do want some security, and otherwise I'm wide open. Then I start to install my programs. At this point none of them have internet access. Then one by one I start running them. Some of them will immediately popup the Firewall is Blocking me dialog. No problem I'm still in the installation phase anyway. When that happens, if it's a program I REALLY trust, I just grant the the Allow Always option. If it's a program I don't have complete faith in, I only grant the Allow Once option, and I pull out Wire Shark before I respond and monitor what it's doing. Then when (and if) I trust it, I give it the Allow Always option. Doing it that way makes me feel very secure, even though I don't have big issues with security in the first place. I really don't think I am the only person out there that feels this way I think Android would benefit from this. Now.. do you get my point of view?... I'm not asking you to agree in terms of changing how you do things... you may work differently... but I think it's a valid point of view. The way Android does it now. I just accept whatever the program asks for because until you use it, you don't really know how it wants to use the permission. By waiting until it wants to use the permission, I can make a (slightly) more informed choice on whether to grant the permission or not, especially if I have the option of saying YES, YES, but monitor it, or NO, and that makes Android not only more secure but communicates that security to the user in a very effective manner. Brad. On 27/08/2010 10:46 PM, Dianne Hackborn wrote: Well, we disagree. On Fri, Aug 27, 2010 at 10:27 PM, Brad Gies rbg...@gmail.com mailto:rbg...@gmail.com wrote: I would argue the opposite :) One of the handiest features of Windows Firewall is that you have the option of Displaying a notification when it blocks a program, and when the dialog shows up, you have the option of granting that program access, and then it never bothers you again. I do agree that the way it was done in Vista was absolutely horrible... but a one time Let this program do this works VERY WELL, and I think it gets around all the problems you mentioned. In my opinion, the lack of this is the single most obvious failing in Android. Brad. Sincerely, Brad Gies --- Bistro Bot - Bistro Blurbhttp://bgies.comhttp://bistroblurb.comhttp://ihottonight.comhttp://forcethetruth.com --- Everything in moderation, including abstinence 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 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] Is there a way to request permissions from a user as you need them?
I suspect there has to be. I mean I saw for bluetooth there is. I was wondering why it is not as easy for the other permissions. I mean heck we can intercept urls without even asking a user for the most part, so I would have to suspect that permissions have to have this ability. -Greg -- 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: Is there a way to request permissions from a user as you need them?
I think I see where you are coming from to a point however honestly I dislike the global statement. I mean a wall of permissions is going to turn into white noise to users (in which case the permission could be for Brick for all they care leading to spam) or paranoid users (in which case your platform dies from no use, but is perceived as lack of creativity from developers). I am just saying it would be nice, from a user perspective and from a developer perspective if I could optionally request a permission and/or upgrade to a permission via user interaction (through a system UI that could persist a No or a Yes). I mean if it's at install time, how do you explain to a user why the permission is needed (They aren't engineers remember, and it's only like 256 characters in the market description field). Just my two cents. On Aug 27, 9:45 am, Dianne Hackborn hack...@android.com wrote: No it must be done at install time. Honestly, this is better than prompting the user all over the place when they are actually trying to do some other task -- they are more likely to look at permissions (and as a whole) when the task at hand is installing an app. You can't intercept URIs without going through a system UI where the user decides what to do. Also at that point the task they are doing is look at this thing I selected, so the decision they are making (pick which will show the thing they are wanting to look at) is relevant to their task at hand. On Fri, Aug 27, 2010 at 9:34 AM, Greg Giacovelli miyamo...@gmail.comwrote: I suspect there has to be. I mean I saw for bluetooth there is. I was wondering why it is not as easy for the other permissions. I mean heck we can intercept urls without even asking a user for the most part, so I would have to suspect that permissions have to have this ability. -Greg -- 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%2Bunsubs cr...@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: MenuItem with Spanned elements in their titles
Just to close this off, apparently in MenuItems for context menus you need to use a string for the condensedTitle because the internal EventLog is dumb. On Aug 19, 7:28 pm, Greg Giacovelli miyamo...@gmail.com wrote: Hi I was just trying something and realized this doesn't seem possible due to the debugging code in the android OS. I register a context menu on an AdapterView, via registerContextMenu(mAdapterView), and then implement the onCreateContextMenu, like this: CharSequence title = context.getString(R.string.txt, userName); title = Html.fromHtml((String) title); MenuItem item = menu.add(ContextMenu.NONE, ContextMenu.NONE, ContextMenu.NONE, title); The context menu displays correctly, however when it is clicked I get an illegalArgumentException from the EventLog class when it tries to print out the condensedTitle. So I have found without setting the condensedTitle explicitly to something that is a String this occurs. Why is this marked as a CharSequence if it cannot handle it? -- 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] MenuItem with Spanned elements in their titles
Hi I was just trying something and realized this doesn't seem possible due to the debugging code in the android OS. I register a context menu on an AdapterView, via registerContextMenu(mAdapterView), and then implement the onCreateContextMenu, like this: CharSequence title = context.getString(R.string.txt, userName); title = Html.fromHtml((String) title); MenuItem item = menu.add(ContextMenu.NONE, ContextMenu.NONE, ContextMenu.NONE, title); The context menu displays correctly, however when it is clicked I get an illegalArgumentException from the EventLog class when it tries to print out the condensedTitle. So I have found without setting the condensedTitle explicitly to something that is a String this occurs. Why is this marked as a CharSequence if it cannot handle it? -- 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] SimpleAdapter is not updatable after a Filter request has been made
So I was playing around with a ListView backed by a SimpleAdapter who's data is loaded via an async task. Now I can refill this adapter and use the notifyDataSetChanged methods to update the listView to display the correct contents. Ok that's cool. But then when I try to filter the results based on keyboard input is where it gets a little messy. Basically looking at the source, the internal SimpleFilter seems that when making a copy will replace the mData value with the copied list, making it impossible to update that Adapter's contents. Is this intentional? Are filters only meant to work across static lists or is this a bug? -- 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: SimpleAdapter is not updatable after a Filter request has been made
The only way I have gotten around this, is by taking my list of maps and creating a new simple adapter. Then I have to set the ListView's adapter to this new SimpleAdapter instance. This seems really wasteful, but it works. Why is this like this? On Aug 16, 3:53 pm, Greg Giacovelli miyamo...@gmail.com wrote: So I was playing around with a ListView backed by a SimpleAdapter who's data is loaded via an async task. Now I can refill this adapter and use the notifyDataSetChanged methods to update the listView to display the correct contents. Ok that's cool. But then when I try to filter the results based on keyboard input is where it gets a little messy. Basically looking at the source, the internal SimpleFilter seems that when making a copy will replace the mData value with the copied list, making it impossible to update that Adapter's contents. Is this intentional? Are filters only meant to work across static lists or is this a bug? -- 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] Any Harm in Tying GPS listening to onWindowFocusChanged()
Hi, So I have received complaints from users that they think our app was using GPS why they were not using the app because the lock screen was displaying the GPS icon. I previously within a common root activity, registered for GPS events in the onResume and deregistered in the OnPause(). Turns out that the lock screens will resume the underlying app that will be in the foreground after unlock (perfectly reasonable). I wanted to do something about the customers feedback though because I know not all users are really techies so I since I couldn't provide an answer that wasn't of just the nature trust me it's not I wanted to see if I could at least calm their nerves. I put the register and deregister hooks into the onWindowFocusChanged of the activities and while it fixes the lock screen problems, I am starting to notice some lags. Is this to be expected? Like I am seeing my app take much more time in GPS than previously. It seems like the event is not always guaranteed to be called immediately for when the app loses focus. Is this correct? I noticed the google maps application seems to register and deregister on resume and pause since they have the same lock screen issue. Has anyone dealt with this before? I am going to switch it back to onResume and onPause for the time being. -- 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] Sqlite segfault anyone ever see this??
Hi all, So I have been getting actual segfaults reported on start up of my app. However the segfault is within sqlite while opening a db which hasn't been touched in a while. Is there something I am missing? Here is a sample one that was sent to me recently. E/Database(26240): sqlite3_open_v2(/data/data/com.app.test/files/ data_en_us.sqlite, handle, 1, NULL) failed E/Database(26240): dbopen() error: unable to open database file I/DEBUG (26137): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG (26137): Build fingerprint: 'Samsung/GT-I7500/GT-I7500/GT- I7500:1.5/CUPCAKE/BMIK6:user/ota-rel-keys,release-keys' I/DEBUG (26137): pid: 26240, tid: 26240 I/DEBUG (26137): signal 11 (SIGSEGV), fault addr 004c I/DEBUG (26137): r0 r1 ad356b9c r2 aac0def5 r3 I/DEBUG (26137): r4 aac499e4 r5 bea8e554 r6 r7 ad356b9c I/DEBUG (26137): r8 bea8e578 r9 41049c58 10 41049c44 fp I/DEBUG (26137): ip aac49acc sp bea8e498 lr aac31d91 pc aac319c8 cpsr 6030 I/DEBUG (26137): #00 pc 000319c8 /system/lib/libsqlite.so I/DEBUG (26137): #01 pc 00031d8c /system/lib/libsqlite.so I/DEBUG (26137): #02 pc 0002e20a /system/lib/ libandroid_runtime.so I/DEBUG (26137): #03 pc e3f4 /system/lib/libdvm.so I/DEBUG (26137): #04 pc 00040aca /system/lib/libdvm.so I/DEBUG (26137): #05 pc 00013158 /system/lib/libdvm.so I/DEBUG (26137): #06 pc 00017b5c /system/lib/libdvm.so I/DEBUG (26137): #07 pc 000175a0 /system/lib/libdvm.so I/DEBUG (26137): #08 pc 000522a8 /system/lib/libdvm.so I/DEBUG (26137): #09 pc 0005972e /system/lib/libdvm.so I/DEBUG (26137): #10 pc 00013158 /system/lib/libdvm.so I/DEBUG (26137): #11 pc 00017b5c /system/lib/libdvm.so I/DEBUG (26137): #12 pc 000175a0 /system/lib/libdvm.so I/DEBUG (26137): #13 pc 0005212c /system/lib/libdvm.so I/DEBUG (26137): #14 pc 0003f138 /system/lib/libdvm.so I/DEBUG (26137): #15 pc 0002a818 /system/lib/ libandroid_runtime.so I/DEBUG (26137): #16 pc 0002b316 /system/lib/ libandroid_runtime.so I/DEBUG (26137): #17 pc 8bf2 /system/bin/app_process I/DEBUG (26137): #18 pc 0001fd7a /system/lib/libc.so I/DEBUG (26137): #19 pc bcd2 /system/lib/libc.so I/DEBUG (26137): #20 pc b000157e /system/bin/linker I/DEBUG (26137): stack: I/DEBUG (26137): bea8e458 bea8e578 [stack] I/DEBUG (26137): bea8e45c ad03e3d5 /system/lib/libdvm.so I/DEBUG (26137): bea8e460 bc48 [heap] I/DEBUG (26137): bea8e464 0001 I/DEBUG (26137): bea8e468 ad55fee1 /system/lib/libicuuc.so I/DEBUG (26137): bea8e46c 0001 I/DEBUG (26137): bea8e470 I/DEBUG (26137): bea8e474 I/DEBUG (26137): bea8e478 I/DEBUG (26137): bea8e47c I/DEBUG (26137): bea8e480 I/DEBUG (26137): bea8e484 I/DEBUG (26137): bea8e488 0058 I/DEBUG (26137): bea8e48c afe0e984 /system/lib/libc.so I/DEBUG (26137): bea8e490 df002777 I/DEBUG (26137): bea8e494 e3a070ad I/DEBUG (26137): #00 bea8e498 001bcbd8 [heap] I/DEBUG (26137): bea8e49c 01b4 I/DEBUG (26137): bea8e4a0 aac499e4 I/DEBUG (26137): bea8e4a4 bea8e4f8 [stack] I/DEBUG (26137): bea8e4a8 aac0def5 /system/lib/libsqlite.so I/DEBUG (26137): bea8e4ac afe0ed18 /system/lib/libc.so I/DEBUG (26137): bea8e4b0 I/DEBUG (26137): bea8e4b4 0050 I/DEBUG (26137): bea8e4b8 001bcbe0 [heap] I/DEBUG (26137): bea8e4bc aac499e4 I/DEBUG (26137): bea8e4c0 bea8e578 [stack] I/DEBUG (26137): bea8e4c4 aac081cf /system/lib/libsqlite.so I/DEBUG (26137): bea8e4c8 I/DEBUG (26137): bea8e4cc aac0912b /system/lib/libsqlite.so I/DEBUG (26137): bea8e4d0 001b2fa8 [heap] I/DEBUG (26137): bea8e4d4 I/DEBUG (26137): bea8e4d8 bea8e554 [stack] I/DEBUG (26137): bea8e4dc I/DEBUG (26137): bea8e4e0 aac499e4 I/DEBUG (26137): bea8e4e4 aac31d91 /system/lib/libsqlite.so I/DEBUG (26137): #01 bea8e4e8 I/DEBUG (26137): bea8e4ec 60cc I/DEBUG (26137): bea8e4f0 bea8e558 [stack] I/DEBUG (26137): bea8e4f4 ad356b9c /system/lib/ libandroid_runtime.so I/DEBUG (26137): bea8e4f8 001bcbe0 [heap] I/DEBUG (26137): bea8e4fc I/DEBUG (26137): bea8e500 I/DEBUG (26137): bea8e504 0014 I/DEBUG (26137): bea8e508 I/DEBUG (26137): bea8e50c I/DEBUG (26137): bea8e510 0001 I/DEBUG (26137): bea8e514 I/DEBUG (26137): bea8e518 431d9430 I/DEBUG (26137): bea8e51c bea8e550 [stack] I/DEBUG (26137): bea8e520
[android-developers] Re: Sqlite segfault anyone ever see this??
Thanks now I know I am not crazy, I was like segfaults shouldn't ever appear to a user too (Although I think there are a few cases around image capture that do). I was also thinking this could be a user messing with my app because I saw an adb connection attempted just prior to this in the log, however yeah I agree it sounds like a firmware issue. I will see if I have more info to send back but so far this is the most complete that I know of. Thanks:) -Greg On Aug 3, 12:53 pm, Mark Murphy mmur...@commonsware.com wrote: On Tue, Aug 3, 2010 at 3:48 PM, Greg Giacovelli miyamo...@gmail.com wrote: So I have been getting actual segfaults reported on start up of my app. However the segfault is within sqlite while opening a db which hasn't been touched in a while. Is there something I am missing? Here is a sample one that was sent to me recently. Segfaults are invariably a firmware/OS failure. There's nothing a developer can do from SDK code that should result in a segfault, at least that I am aware of. If fadden does not respond to this post (and he has a remarkable gift for finding these core dump posts), post it and any other info you can supply to an issue on b.android.com. In particular: -- if you have a project that reproduces the problem, that'd be huge -- if you are getting these reports from the field, include all distinct Build fingerprint values, so we can better determine if the problem is unique to a handset, manufacturer, OS release, or is pervasive -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Development Wiki:http://wiki.andmob.org -- 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: Any Harm in Tying GPS listening to onWindowFocusChanged()
sorry for the premature bump, I just can't find this thread on the site other than the thread id which I know. bump On Aug 3, 10:05 am, Greg Giacovelli miyamo...@gmail.com wrote: Hi, So I have received complaints from users that they think our app was using GPS why they were not using the app because the lock screen was displaying the GPS icon. I previously within a common root activity, registered for GPS events in the onResume and deregistered in the OnPause(). Turns out that the lock screens will resume the underlying app that will be in the foreground after unlock (perfectly reasonable). I wanted to do something about the customers feedback though because I know not all users are really techies so I since I couldn't provide an answer that wasn't of just the nature trust me it's not I wanted to see if I could at least calm their nerves. I put the register and deregister hooks into the onWindowFocusChanged of the activities and while it fixes the lock screen problems, I am starting to notice some lags. Is this to be expected? Like I am seeing my app take much more time in GPS than previously. It seems like the event is not always guaranteed to be called immediately for when the app loses focus. Is this correct? I noticed the google maps application seems to register and deregister on resume and pause since they have the same lock screen issue. Has anyone dealt with this before? I am going to switch it back to onResume and onPause for the time being. -- 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] am i using these correctly? AbsListView.layoutparams
Hi, So listview is on of those.components used all over the OS and has all those tricks to speed it up and in a lot of cases, work correctly. So let's say I have an adapter that supports N views. GetViewTypeCount() returns N. GetItemViewType() return [0, (N - 1)] Now the interesting part getView All the examples I see have something like this. ... layoutInflater.inflate(R.layout.awesome); As the base view to return if the convert view is empty. This seems to convert to the correct layout parameter. but the generate layout parameter in listview only copies width and height it seems. If the adapter returns multiple views, should we then reset the view's layout parameters to use laayoutparams( width, height, viewType) before returning it in getView ( where viewType is the same as the value returned by getItemViewType for the position being rendered )? -- 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: Repackaging Android System Classes in an application
I understand don't do this... trust me I don't want to, but it doesn't answer the question if it will work in a market app. The rationale behind it, is that the rendering implementations between 1.5 and newer versions forward have a minor change with a large impact with regards to Z ordering. Since bug fixes aren't back ported there needs to be some way to intercept the call and correct it. I understand it's fragile however it's only meant to support 1.5, which as much as it gets neglected, still has a decent amount of people using it. We use a wrapper around WindowSession to correct the Z ordering on calls to relayout(). Again, trust me, the fragility is known. However a better rationale is, that when this app, that as you said will likely break, ... breaks, it would be assumed that support for the broken version of the OS would also be dropped ;) -Greg On Jun 16, 6:57 pm, Dianne Hackborn hack...@android.com wrote: Don't do this. This is not a security issue at all; it just makes an app that will likely break itself. On Wed, Jun 16, 2010 at 12:47 PM, Greg Giacovelli miyamo...@gmail.comwrote: Hi, So I came across this today and was wondering does this work in production app or does it merely work because my phone allows non market apks. Here is an example, Take a class like, android.view.IWindow, and copy it's source into your project and recompile it after changing a few things. (Don't rename or repackage it). Now when your APK loads in the VM, something odd happens. 06-15 23:30:32.148: DEBUG/installd(555): DexInv: --- BEGIN '/data/app/ vmdl22987.tmp' --- 06-15 23:30:32.818: DEBUG/dalvikvm(1062): DexOpt: 'Landroid/view/ IWindow;' has an earlier definition; blocking out 06-15 23:30:32.818: DEBUG/dalvikvm(1062): DexOpt: 'Landroid/view/ IWindowSession;' has an earlier definition; blocking out 06-15 23:30:33.218: DEBUG/dalvikvm(1062): DexOpt: not verifying 'Landroid/view/IWindow;': multiple definitions 06-15 23:30:33.218: DEBUG/dalvikvm(1062): DexOpt: not verifying 'Landroid/view/IWindowSession;': multiple definitions So the logging is a little ambiguous, but is it saying that the classes in this APK are blocking out previous versions and that these new classes aren't being verified. If so I hope this is only succeeding because as developers most targets are in development mode when allowing non market apks (non rooted phones). However does this work in market released apps as well? This seems like a really nasty security exploit if I can override system interfaces just for my application. -Greg -Greg -- 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%2Bunsubs cr...@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] Repackaging Android System Classes in an application
Hi, So I came across this today and was wondering does this work in production app or does it merely work because my phone allows non market apks. Here is an example, Take a class like, android.view.IWindow, and copy it's source into your project and recompile it after changing a few things. (Don't rename or repackage it). Now when your APK loads in the VM, something odd happens. 06-15 23:30:32.148: DEBUG/installd(555): DexInv: --- BEGIN '/data/app/ vmdl22987.tmp' --- 06-15 23:30:32.818: DEBUG/dalvikvm(1062): DexOpt: 'Landroid/view/ IWindow;' has an earlier definition; blocking out 06-15 23:30:32.818: DEBUG/dalvikvm(1062): DexOpt: 'Landroid/view/ IWindowSession;' has an earlier definition; blocking out 06-15 23:30:33.218: DEBUG/dalvikvm(1062): DexOpt: not verifying 'Landroid/view/IWindow;': multiple definitions 06-15 23:30:33.218: DEBUG/dalvikvm(1062): DexOpt: not verifying 'Landroid/view/IWindowSession;': multiple definitions So the logging is a little ambiguous, but is it saying that the classes in this APK are blocking out previous versions and that these new classes aren't being verified. If so I hope this is only succeeding because as developers most targets are in development mode when allowing non market apks (non rooted phones). However does this work in market released apps as well? This seems like a really nasty security exploit if I can override system interfaces just for my application. -Greg -Greg -- 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: Even with Min SDK version, building app against 2.2 breaks 1.5?
Steve, Nope sadly I have not. Moto, nope that doesn't work either. The clean does this anyways. I cannot build my app against 2.2 until this gets worked out. I should say again, that the apk and all the resource ids are correct. I traced their values through the apk and the emulator and the G1 just can't extract them for some reason. It can extract other assets just not this particular one. I am completely stumped since this asset hasn't changed for some time. Xav, I appreciate the help but is their anything in the changes from 2.1 to 2.2 that could have broken such functionality or someplace other than just cleaning my workspace that I should be looking at? -Greg On May 24, 5:36 am, Flying Coder av8r.st...@gmail.com wrote: Hi Greg, Did you ever figure out what was going on? I'm having exactly the same problem. Thanks, Steve On May 21, 8:39 pm, Greg Giacovelli miyamo...@gmail.com wrote: Nope it's just in drawable. -Greg On May 21, 5:28 pm, Xavier Ducrohet x...@android.com wrote: Is that resource in a qualified drawable folder? (like drawable-hdpi ?) Xav On Fri, May 21, 2010 at 5:10 PM, Greg Giacovelli miyamo...@gmail.com wrote: public static final int profile_section_background=0x7f020033; is the value inside of R spec resource 0x7f020033 package:drawable/ profile_section_background: flags=0x is the value from the dump using the toolset from android-8 and the android-1.5 platforms However I assume this is correct as the stack specifies that it cannot find the resource specified. Is there a way to extract the xml content? I have been trying to use the dump xmltree command however I think there is a typo in the error message and the format for the reference is not known to me. aapt dump xmltree apk package:drawable/profile_section_background returns ERROR: dump failed because resource package:drawable/ profile_section_background found -Greg On May 21, 4:28 pm, Xavier Ducrohet x...@android.com wrote: This is quite strange. Look inside your apk for the ID of the resources that seemed to be missing (or if it's actually missing) and match it with the R class. To look at the compiled resources: aapt dump resources yourapp.apk aapt is in sdk/platforms/android-8/tools/ Xav On Fri, May 21, 2010 at 4:17 PM, Greg Giacovelli miyamo...@gmail.com wrote: Yeah that was what I tried before posting. I did that like 3 times. The same APK works on 2.1 devices so it cannot be an inlining issue. I am sorry I know it's a vague error. The drawable in question is just a selector with dither equals true with 4 states inside of it. Nothing complicated but maybe it helps somewhere. -Greg On May 21, 2:17 pm, Mark Murphy mmur...@commonsware.com wrote: I just built my app against the new SDK released yesterday and it seems to break when I run the app in my old 1.5 profile in regards to packaging assets. I haven't changed anything about my application and it ran on API 3 - 7. However just increasing that build to 8 seems to change something with the way assets are packed. Here is a stack trace with the app trying to load a resource that it says it cannot fine. If I recompile the same code in the same workspace against API 8, it cannot find some of my drawables. Anything that seems wrong or is this a bug? Do a full rebuild of the project. In Eclipse, I think Project|Force Clean does this. Outside of Eclipse, ant clean does this. Most likely, the resource IDs changed, but Java code that inlined those resource IDs did not. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 -- Xavier Ducrohet Android SDK Tech Lead Google Inc. Please do not send me questions directly. Thanks! -- You received this message because you are subscribed to the Google Groups Android Developers
[android-developers] Re: Even with Min SDK version, building app against 2.2 breaks 1.5?
Thanks Xav, Much appreciated, I thought I was crazy :) I have been following the conventions you speak of and that is why I brought it here when I exhausted all the known things that I was doing. I really look forward to the information in the coming weeks. If there is anything more from me that would aid in this, please let me know. Thanks, Greg On May 24, 12:52 pm, Mark Murphy mmur...@commonsware.com wrote: Xavier Ducrohet wrote: The short of it: 1.5 does not know about -mdpi -hpdi, so it'll take the first one it finds which could be the wrong one (which means it'll get scaled). FWIW, the solution given in that presentation was to have both -mdpi and -mdpi-v3, with duplicate resources. -mdpi-v3 would be picked up by Android 1.5; -mdpi would be picked up by newer versions of Android that are legitimately running mdpi displays. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] Even with Min SDK version, building app against 2.2 breaks 1.5?
Hi, I just built my app against the new SDK released yesterday and it seems to break when I run the app in my old 1.5 profile in regards to packaging assets. I haven't changed anything about my application and it ran on API 3 - 7. However just increasing that build to 8 seems to change something with the way assets are packed. Here is a stack trace with the app trying to load a resource that it says it cannot fine. If I recompile the same code in the same workspace against API 8, it cannot find some of my drawables. Anything that seems wrong or is this a bug? Min Version set to 3 and targeted at 8 is all I have changed. 05-21 13:35:25.550: ERROR/AndroidRuntime(6127): Uncaught handler: thread main exiting due to uncaught exception 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): android.view.InflateException: Binary XML file line #1: Error inflating class java.lang.reflect.Constructor 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.LayoutInflater.createView(LayoutInflater.java:512) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java: 56) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.LayoutInflater.inflate(LayoutInflater.java:385) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at com.yelp.android.ui.panels.businesssearch.BusinessAdapter.getView(BusinessAdapter.java: 126) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java: 191) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.AbsListView.obtainView(AbsListView.java:1269) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.ListView.makeAndAddView(ListView.java:1623) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.ListView.fillDown(ListView.java:607) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.ListView.fillFromTop(ListView.java:664) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.ListView.layoutChildren(ListView.java:1481) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.AbsListView.onLayout(AbsListView.java:1113) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.View.layout(View.java:6133) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.View.layout(View.java:6133) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.View.layout(View.java:6133) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.View.layout(View.java:6133) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.View.layout(View.java:6133) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.ViewRoot.performTraversals(ViewRoot.java:929) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.os.Handler.dispatchMessage(Handler.java:99) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.os.Looper.loop(Looper.java:123) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.app.ActivityThread.main(ActivityThread.java:3948) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at java.lang.reflect.Method.invokeNative(Native Method) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at java.lang.reflect.Method.invoke(Method.java:521) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at dalvik.system.NativeStart.main(Native Method) 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): Caused by: java.lang.reflect.InvocationTargetException 05-21 13:35:25.590: ERROR/AndroidRuntime(6127): at android.widget.RelativeLayout.init(RelativeLayout.java:145) 05-21
[android-developers] Re: Even with Min SDK version, building app against 2.2 breaks 1.5?
Yeah that was what I tried before posting. I did that like 3 times. The same APK works on 2.1 devices so it cannot be an inlining issue. I am sorry I know it's a vague error. The drawable in question is just a selector with dither equals true with 4 states inside of it. Nothing complicated but maybe it helps somewhere. -Greg On May 21, 2:17 pm, Mark Murphy mmur...@commonsware.com wrote: I just built my app against the new SDK released yesterday and it seems to break when I run the app in my old 1.5 profile in regards to packaging assets. I haven't changed anything about my application and it ran on API 3 - 7. However just increasing that build to 8 seems to change something with the way assets are packed. Here is a stack trace with the app trying to load a resource that it says it cannot fine. If I recompile the same code in the same workspace against API 8, it cannot find some of my drawables. Anything that seems wrong or is this a bug? Do a full rebuild of the project. In Eclipse, I think Project|Force Clean does this. Outside of Eclipse, ant clean does this. Most likely, the resource IDs changed, but Java code that inlined those resource IDs did not. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: Even with Min SDK version, building app against 2.2 breaks 1.5?
public static final int profile_section_background=0x7f020033; is the value inside of R spec resource 0x7f020033 package:drawable/ profile_section_background: flags=0x is the value from the dump using the toolset from android-8 and the android-1.5 platforms However I assume this is correct as the stack specifies that it cannot find the resource specified. Is there a way to extract the xml content? I have been trying to use the dump xmltree command however I think there is a typo in the error message and the format for the reference is not known to me. aapt dump xmltree apk package:drawable/profile_section_background returns ERROR: dump failed because resource package:drawable/ profile_section_background found -Greg On May 21, 4:28 pm, Xavier Ducrohet x...@android.com wrote: This is quite strange. Look inside your apk for the ID of the resources that seemed to be missing (or if it's actually missing) and match it with the R class. To look at the compiled resources: aapt dump resources yourapp.apk aapt is in sdk/platforms/android-8/tools/ Xav On Fri, May 21, 2010 at 4:17 PM, Greg Giacovelli miyamo...@gmail.com wrote: Yeah that was what I tried before posting. I did that like 3 times. The same APK works on 2.1 devices so it cannot be an inlining issue. I am sorry I know it's a vague error. The drawable in question is just a selector with dither equals true with 4 states inside of it. Nothing complicated but maybe it helps somewhere. -Greg On May 21, 2:17 pm, Mark Murphy mmur...@commonsware.com wrote: I just built my app against the new SDK released yesterday and it seems to break when I run the app in my old 1.5 profile in regards to packaging assets. I haven't changed anything about my application and it ran on API 3 - 7. However just increasing that build to 8 seems to change something with the way assets are packed. Here is a stack trace with the app trying to load a resource that it says it cannot fine. If I recompile the same code in the same workspace against API 8, it cannot find some of my drawables. Anything that seems wrong or is this a bug? Do a full rebuild of the project. In Eclipse, I think Project|Force Clean does this. Outside of Eclipse, ant clean does this. Most likely, the resource IDs changed, but Java code that inlined those resource IDs did not. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 -- Xavier Ducrohet Android SDK Tech Lead Google Inc. Please do not send me questions directly. 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: Even with Min SDK version, building app against 2.2 breaks 1.5?
Ok oddly enough, aapt dump xmltree APK res/drawable/profile_section_background.xml returns data from both toolsets, however loading the apk on either the G1 or an emulator of API level 5 still dies. -Greg On May 21, 5:10 pm, Greg Giacovelli miyamo...@gmail.com wrote: public static final int profile_section_background=0x7f020033; is the value inside of R spec resource 0x7f020033 package:drawable/ profile_section_background: flags=0x is the value from the dump using the toolset from android-8 and the android-1.5 platforms However I assume this is correct as the stack specifies that it cannot find the resource specified. Is there a way to extract the xml content? I have been trying to use the dump xmltree command however I think there is a typo in the error message and the format for the reference is not known to me. aapt dump xmltree apk package:drawable/profile_section_background returns ERROR: dump failed because resource package:drawable/ profile_section_background found -Greg On May 21, 4:28 pm, Xavier Ducrohet x...@android.com wrote: This is quite strange. Look inside your apk for the ID of the resources that seemed to be missing (or if it's actually missing) and match it with the R class. To look at the compiled resources: aapt dump resources yourapp.apk aapt is in sdk/platforms/android-8/tools/ Xav On Fri, May 21, 2010 at 4:17 PM, Greg Giacovelli miyamo...@gmail.com wrote: Yeah that was what I tried before posting. I did that like 3 times. The same APK works on 2.1 devices so it cannot be an inlining issue. I am sorry I know it's a vague error. The drawable in question is just a selector with dither equals true with 4 states inside of it. Nothing complicated but maybe it helps somewhere. -Greg On May 21, 2:17 pm, Mark Murphy mmur...@commonsware.com wrote: I just built my app against the new SDK released yesterday and it seems to break when I run the app in my old 1.5 profile in regards to packaging assets. I haven't changed anything about my application and it ran on API 3 - 7. However just increasing that build to 8 seems to change something with the way assets are packed. Here is a stack trace with the app trying to load a resource that it says it cannot fine. If I recompile the same code in the same workspace against API 8, it cannot find some of my drawables. Anything that seems wrong or is this a bug? Do a full rebuild of the project. In Eclipse, I think Project|Force Clean does this. Outside of Eclipse, ant clean does this. Most likely, the resource IDs changed, but Java code that inlined those resource IDs did not. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 -- Xavier Ducrohet Android SDK Tech Lead Google Inc. Please do not send me questions directly. 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: Even with Min SDK version, building app against 2.2 breaks 1.5?
Nope it's just in drawable. -Greg On May 21, 5:28 pm, Xavier Ducrohet x...@android.com wrote: Is that resource in a qualified drawable folder? (like drawable-hdpi ?) Xav On Fri, May 21, 2010 at 5:10 PM, Greg Giacovelli miyamo...@gmail.com wrote: public static final int profile_section_background=0x7f020033; is the value inside of R spec resource 0x7f020033 package:drawable/ profile_section_background: flags=0x is the value from the dump using the toolset from android-8 and the android-1.5 platforms However I assume this is correct as the stack specifies that it cannot find the resource specified. Is there a way to extract the xml content? I have been trying to use the dump xmltree command however I think there is a typo in the error message and the format for the reference is not known to me. aapt dump xmltree apk package:drawable/profile_section_background returns ERROR: dump failed because resource package:drawable/ profile_section_background found -Greg On May 21, 4:28 pm, Xavier Ducrohet x...@android.com wrote: This is quite strange. Look inside your apk for the ID of the resources that seemed to be missing (or if it's actually missing) and match it with the R class. To look at the compiled resources: aapt dump resources yourapp.apk aapt is in sdk/platforms/android-8/tools/ Xav On Fri, May 21, 2010 at 4:17 PM, Greg Giacovelli miyamo...@gmail.com wrote: Yeah that was what I tried before posting. I did that like 3 times. The same APK works on 2.1 devices so it cannot be an inlining issue. I am sorry I know it's a vague error. The drawable in question is just a selector with dither equals true with 4 states inside of it. Nothing complicated but maybe it helps somewhere. -Greg On May 21, 2:17 pm, Mark Murphy mmur...@commonsware.com wrote: I just built my app against the new SDK released yesterday and it seems to break when I run the app in my old 1.5 profile in regards to packaging assets. I haven't changed anything about my application and it ran on API 3 - 7. However just increasing that build to 8 seems to change something with the way assets are packed. Here is a stack trace with the app trying to load a resource that it says it cannot fine. If I recompile the same code in the same workspace against API 8, it cannot find some of my drawables. Anything that seems wrong or is this a bug? Do a full rebuild of the project. In Eclipse, I think Project|Force Clean does this. Outside of Eclipse, ant clean does this. Most likely, the resource IDs changed, but Java code that inlined those resource IDs did not. -- Mark Murphy (a Commons Guy)http://commonsware.com Android App Developer Books:http://commonsware.com/books.html -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 -- Xavier Ducrohet Android SDK Tech Lead Google Inc. Please do not send me questions directly. 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 -- Xavier Ducrohet Android SDK Tech Lead Google Inc. Please do not send me questions directly. 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 athttp://groups.google.com/group/android-developers?hl=en -- You received
[android-developers] RelativeLayout vertical center issue in Android OS 1.5
Hi, I found this thread http://groups.google.com/group/android-developers/browse_thread/thread/125dd6c435aa7cad/c19724a514558af7 which seems to be closed. I don't think it's an actual solution, it's more of a we needed this to work now. I am having the same issue where the centerVertical seems to center the entire layout at the center of the screen. Without it, the layout floats at the top of the screen and wraps the content correctly, however all the elements are aligned with the top of the window, I just want them to be centered vertically within the layout. Here is a sample of the layout I am using. Basically it's a button on the left and a button the right with some text in the middle between them. Ideally I would like that text in the middle of them to be center aligned with the buttons. Am I doing something wrong? This works fine on all other versions of Android OS other than 1.5. -Greg RelativeLayout android:layout_width=fill_parent xmlns:android=http://schemas.android.com/apk/res/android; android:layout_height=wrap_content android:id=@+id/title_bar android:minHeight=0px android:background=@drawable/title_bar_bg Button android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentLeft=true android:hint=lt;leftgt; android:id=@+id/left_button android:layout_gravity=left|center_vertical android:gravity=left| center_vertical /Button TextView android:layout_height=wrap_content android:id=@+id/ title android:hint=lt;Titlegt; android:layout_gravity=center android:layout_toRightOf=@+id/left_button android:layout_toLeftOf=@+id/right_button android:gravity=center android:layout_centerVertical=true android:layout_width=fill_parent/TextView Button android:layout_height=wrap_content android:layout_width=wrap_content android:id=@+id/right_button android:hint=lt;rightgt; android:layout_gravity=right| center_vertical android:layout_alignParentRight=true/Button /RelativeLayout -- 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: AsyncTask : java.util.concurrent.RejectedExecutionException
Hi arnouf, I don't mean to butt in but I suspect this is a similar problem to something I saw before. In your ViewAdapter, I am assuming you are creating or using a View which is or contains an ImageView which you are trying to load the image contents for remotely. If you are always creating the view in your adapter, then it simplifies the process a lot but at a performance tradeoff since you won't get the View recycling that the ListView does for you. If you create only when the view passed into your adapter is null, and use the passed in View other times then you gain some performance, however now you have to sync the ImageViews to what is being displayed on the screen or else like you said, you may get images rendered in the incorrect cells of the list. So there are 2 problems, #1 For the AsyncTask, you can still use the AsyncTask, but stagger their execution (try using a handler on the UI thread to spawn the AsyncTask after a delay, via postDelay). #2 The Image Syncing problem, when you get the information back you should make sure the view that the task is loading the image for is not dirty. By dirty I mean that the ListView is still displaying that cell and it is the correct cell. It may have been recycled and passed back to your adapter as the user scrolled and you will end up out of sync. I have been storing the image url in the tag of the image view and on a successful image load comparing the tag with the source of the image bitmap to make sure the view still is fresh. If you cache the image somewhere (in memory or storage) you can then retrieve it faster later and just fill the image view next time that cell needs to be rendered. Not sure if this is the exact problem you describe but I don't see any harm in giving some advice. Hope it helps. -Greg On Apr 7, 8:14 am, arnouf arnaud.far...@gmail.com wrote: I'm not sure that it will resolve my first problem related to the image loaded from remote and display in my listview I can useAsynctaskin my adapter to load each image. But when I do a bog scroll, displayed image are not to the good place (ex. : the image number 4 is displayed at the line 15 ...). It's trying to tesolve this first issue, that I meet the exception. But this issue is maybe due to the Async pooltoo. I come you back later. Thanks On Apr 7, 4:37 pm, Mark Murphy mmur...@commonsware.com wrote: When you have a lot of Image to load this is a big limitation. You can: -- Grab the source code toAsyncTask, clone it into your own package, and modify the LinkedBlockingQueue. I did this with my AsyncTaskEx class. -- SkipAsyncTaskand roll your own thread pool. -- Mark Murphy (a Commons Guy)http://commonsware.com AndroidApp Developer Books:http://commonsware.com/books.html -- 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Incorrect documentation for Xml Attributes (onclick, padding, etc), all API Levels?
Hi, The documentation seems to specify API Level Blank for a lot of the XML attributes in View. I haven't checked others. I have my filters set to only look for API 3 and it seems that this misses the filter. So it shows up and low and behold since it's XML it will parse, compile and then just not be read. So far I have only seen this a problem with the onclick attribute but I noticed a lot of them have the same API Level problem. * Is this known? * Are the values that should be there known? * Are there any plans to update the documentation? -- 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Localization of Plurals using Context and resources strings.xml
Thanks :) Sadly I just read through tons of source code and got this Pretty interesting :) Ok so since you seem to know that, would you know what the quantity=few, quantity=many do? The src code doesn't seem to define them in the PluralRules implemented, or at least nothing that is really concrete. Is there a formal definition somewhere? -Greg On Mar 11, 1:57 pm, Makas Tzavellas makas.tzavel...@gmail.com wrote: Hi Greg, To use plurals. You declare it like this in your strings.xml. plurals name=thing_string item quantity=one%s thing/item item quantity=other@s things/item /plurals Hope this helps. On Mar 11, 10:26 am, Greg miyamo...@gmail.com wrote: Hi, I am used to just using a choice format for doing something deciding between {0} thing and {0} things. However Context and Resources have a lot of utitilities it seems for dealing with String and loading them with native replacement. One method of such is Resources.getQuantityText(int id, int quantity) ... problem is the way to declare the string is not declared anywhere and upon using this method I am greeted with android.content.res.Resources$NotFoundException: Plural resource ID #0x7f080050 quantity=450 item=other Looking at the source it does use a native method to load the pluralized resource so I can't look at the code. Would anyone know how to use this may-be pretty nifty utility? I was thinking it might be something like: string name=thing_string pluralrule=one%1$d thing/string string name=thing_string pluralrule=other%1$d things/string since they don't use the xml id element but I am just guessing and am completely stumped. -- 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