SDK2.1, WVGA800 return wrong getWidth(), getHeight()

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Postby sblantipodi » Fri Apr 09, 2010 12:24 pm

pskink wrote:do you compile your project against level == 3 or level >= 4 ?


final build will be against level 4, in the code Level4 API is used only in the abstract way,
and this does the tricks.
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Top

Postby pskink » Fri Apr 09, 2010 12:36 pm

sblantipodi wrote:
pskink wrote:do you compile your project against level == 3 or level >= 4 ?


final build will be against level 4, in the code Level4 API is used only in the abstract way,
and this does the tricks.


so, if you build against lvl4 so how is it suppose to work on lvl3 ?

how do you make sure you are not using anything introduced in lvl4 (xml files, api etc)

even if it can work for some vendor builds, are you sure it will run on every vedor builds (they can check android version to be used for building your apk with device level to make sure that no "future" api is used)?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby sblantipodi » Fri Apr 09, 2010 2:10 pm

pskink wrote:so, if you build against lvl4 so how is it suppose to work on lvl3 ?

how do you make sure you are not using anything introduced in lvl4 (xml files, api etc)

even if it can work for some vendor builds, are you sure it will run on every vedor builds (they can check android version to be used for building your apk with device level to make sure that no "future" api is used)?


It will work because if I use Level4 API, I use them in an abstract class.
no problem with vendor check, if it will check using Level3, APK will be Level 3 compliant...
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby pskink » Fri Apr 09, 2010 2:30 pm

sblantipodi wrote:
It will work because if I use Level4 API, I use them in an abstract class.
no problem with vendor check, if it will check using Level3, APK will be Level 3 compliant...


no, it's not lvl3 compliant since it uses supports-screens tag

in google emulator during apk installation or apk launch time it says: ignoring unknown tag <supports-screens> but in real device which is often vendor custom build it can just say: "FATAL ERROR: unknown tag <supports-screens>, ABORTING"

the official documentation doesn't say anything about this so it can be up to vendor how to deal with such unknown tag

so i'd not depend on how emulator works...

also compiled classes can have reference about build version - dx tool which converts .class files to .apk differs from apl level to api level, see SDK/platforms/*/tools/dx

its like compiling java sources with javac v1.5 and running wirh java v1.2 - it will not work

i now that right now there is no such check but it can change in the future
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby sblantipodi » Fri Apr 09, 2010 2:47 pm

you are right, but for now it works good, so for now I'll use this way...
really really thanks for your help and support.
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby pskink » Fri Apr 09, 2010 2:50 pm

no problem, you are welcome

but you are warned as well....
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Top

Postby sblantipodi » Fri Apr 09, 2010 2:59 pm

pskink wrote:no problem, you are welcome

but you are warned as well....


thanks. :)
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Top
Previous

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 7 guests