3

There seems to be a breaking change in SDK 2.3 that causes applications compiled on it to fail to work on Android 2.0 devices. (Although Android 2.0 is officially gone, I'm unfortunately stuck with a bunch of Motorola Milestones that I got from Expansys which haven't gotten OTR updates yet).

It seems to be an issue with resources, exactly like the one mentioned here, however on a 2.0 device instead of a 1.6 or earlier device. I can put all the resources in /res/drawable/, however I want the hdpi versions to appear instead of the mdpi versions (which I believe is the default for /res/drawable/).

I figured I could just use an older copy of the SDK (the 2.2 SDK was able to make apks that my Milestones were happy with), but I can't seem to find a download link for it anymore.

Are there any suggestions on how I can get my hdpi graphics on a 2.0 device?

(In parallel, I'm attempting to contact Motorola and get the devices upgraded via OTR. Unfortunately, many of them are deployed in the field and can't be updated via USB).

Steps to reproduce

  1. Install Android SDK 2.3
  2. In Eclipse, create a new Android project. Set target to 1.6 or higher.
  3. Modify the default main.xml to add: <ImageView android:src="@drawable/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" /> somewhere.
  4. Build the example, then launch with an Android 2.0 VM.

expected results

5: app will load. Icon may or may not appear depending on main.xml.

actual results

5: app crashes on start, see the aforementioned question for the approximate stacktrace.

Community
  • 1
  • 1
Steve Pomeroy
  • 10,071
  • 6
  • 34
  • 37
  • Have you set your attributes correctly? – Reuben Scratton Dec 07 '10 at 21:55
  • Reuben: Yeah, however this problem occurs even without that element. – Steve Pomeroy Dec 07 '10 at 22:18
  • I've built apps with the 2.3 sdk and drawables in only the /drawable folder and not the drawable-hdip folder and my images are still showing up on hdip devices. I also have my min SDK set to 1.6 Seems I am doing everything the same as you but its still working for me. Perhaps you are leaving something out? – Nathan Schwermann Dec 10 '10 at 21:35
  • schwiz: are the images high-res, though? Because I can only get mdpi-scale icons to show up. – Steve Pomeroy Dec 10 '10 at 21:37
  • schwiz: I should say, I can only get mdpi-scale icons to show up on Android 2.0 devices, not 2.0.1 or higher (those all work fine). – Steve Pomeroy Dec 10 '10 at 21:38

3 Answers3

2

You need to download the SDK's using the AVD/SDK manager. In Eclipse click Window->Android SDK and AVD Manager. Then click Available packages and you can get any SDK you want.

As for breaking on older devices it depends on what API's you're using and whether or not they were available in earlier SDK. As for being able to use HPI drawable folders, that should not cause any problems on Android 2.0. Have you tried right clicking on the project and refreshing it and then go to Project->Clean and see if that helps at all.

CaseyB
  • 24,780
  • 14
  • 77
  • 112
  • Ah, thanks for the pointer about the SDK. The bit that I missed was the "Display updates only" checkbox. I'm a bit unsure about my ability to downgrade with it, but I'll give it a try. – Steve Pomeroy Dec 07 '10 at 22:09
  • As far as the breaking on an older device is concerned, this is a special case where there's a bug in the OS. In this instance, the code works on 2.0.1 but not 2.0. – Steve Pomeroy Dec 07 '10 at 22:10
  • After an hour or so of twiddling, I wasn't able to convince the older version of the SDK stack (eclipse plugin + sdk + tools) to be installed. Just installing older versions of the sdk didn't seem to do the trick. – Steve Pomeroy Dec 15 '10 at 19:24
0

Check this out as well on how you should upgrade to 2.3 using Eclipse:

http://ggomeze.com/2010/12/09/updating-eclipse-to-gingerbread

ggomeze
  • 5,711
  • 6
  • 29
  • 32
  • While that's a very nice introduction to upgrading to 2.3, it unfortunately has nothing to do with the stated problem. Try the "steps to reproduce" and see if you get the same problem as I did. – Steve Pomeroy Dec 09 '10 at 16:23
  • Isaac: upvoting it for a bounty question, when it doesn't actually answer the question, is just going to give the bounty to a wrong answer. – Steve Pomeroy Dec 16 '10 at 19:06
  • @Steve: Don't you as the owner of the bounty choose who gets it? From the FAQs:"Click the bounty award icon next to each answer to permanently award your bounty to the answerer. " – John Dec 17 '10 at 06:07
  • @John: also from the FAQ, “If you do not award your bounty within 7 days, the highest voted answer created after the bounty started with at least 2 upvotes will be awarded half the bounty amount.” – Steve Pomeroy Dec 17 '10 at 14:12
  • @Steve: So just award it! Besides, AFAIK he didn't have 2 upvotes. – John Dec 17 '10 at 18:11
  • @John: but there is no answer to my question. Why would I be awarding a bounty to an unanswered question? – Steve Pomeroy Dec 17 '10 at 19:55
  • @Steve: If you *don't* award it and no one else answers, CaseyB will get it anyway. – John Dec 17 '10 at 19:58
  • @John: he didn't have enough upvotes before. It's somewhat frustrating that someone can get the bounty by providing an answer that doesn't really answer the question (although he made an attempt, unlike this answer). – Steve Pomeroy Dec 20 '10 at 21:12
  • @Steve: Yes I see how that's frustrating, but that's part of the risk you take when you start a bounty. – John Dec 21 '10 at 15:19
0

This question really should be a bug report with Android and it only applies to an Android version that has 0% market share, so I'm marking it answered. Good luck to anyone else who has this issue: I recommend upgrading your devices manually; that's what I ended up doing.

Steve Pomeroy
  • 10,071
  • 6
  • 34
  • 37