Using targetSdkVersion

by Peter Eastman » Sun, 27 Jun 2010 03:13:58 GMT


Sponsored Links
 I'm stuck on a problem that I'm sure has a very simple answer, but I
haven't been able to figure it out.

I have a program that should work on Android 1.5, but when it's run on
newer devices with higher resolution screens, it should support the
full resolution and not emulate a lower resolution screen.  As far as
I can tell from the documentation, this should be simple.  I just
specify

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>

The problem is that if I tell Eclipse to compile for 1.5, it refuses
to accept this.  It reports an error (targetSdkVersion is an unknown
tag) and refuses to compile or run.  If I tell it to compile for 1.6
it works fine, of course.  But if I then try to install on a 1.5 AVD,
the program immediately crashes with a java.lang.VerifyError.  I'm
clearly missing something simple.  How do I get it to compile an apk
that works under 1.5, but still includes the targetSdkVersion tag?

Peter

--



Using targetSdkVersion

by YuviDroid » Sun, 27 Jun 2010 04:02:27 GMT


 The VerifyError occurs when you are using (or only 'importing') stuff that
is only in the newer API.
In this case I think you should use reflection to use the new APIs
methods/classes in Android > 1.6.




>


Sponsored Links


Using targetSdkVersion

by Peter Eastman » Sun, 27 Jun 2010 04:13:04 GMT


 You're right, my fault.  Because I had Eclipse set to 1.6, I missed
the fact that I was calling an API that didn't exist in 1.5.

Thanks!

Peter

--



Other Threads

1. how mdm is possible in android

i cannot find any info on mdm. can anybody give a hint? how does
airwatch do it?
thx

-- 

2. Flash di ptk

Wew,, parah juga yah.. itu stabil segt kah om?

Pake paket yg apa untuk flash nya?

~~~
@leonardusjeff
~~~~~~
sent from froyo-ed dX 2.3.15_deodexed



-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

3. 2.1 vs 2.2 ZipInputStream

4. Running an app within another app

5. Spica Terendam Air

6. ActivityNotFoundException for Media Gallery android.intent.action.PICK on Samsung Fascinate

7. beli handphone android