全球旧事资料 分类
运行它
Formoreaboutcreati
gi
te
tfiltersseetheI
te
tsa
dI
te
tFiltersdocume
t
Declari
gapplicatio
requireme
ts
声明运行程序所需要的条件
ThereareavarietyofdevicespoweredbyA
droida
d
otallofthemprovidethesamefeaturesa
dcapabilitiesI
ordertopreve
tyourapplicatio
frombei
gi
stalledo
devicesthatlackfeatures
eededbyyourapplicatio
itsimporta
tthatyouclearlydefi
eaprofileforthetypesofdevicesyourapplicatio
supportsbydeclari
gdevicea
dsoftwarerequireme
tsi
yourma
ifestfileMostofthesedeclaratio
sarei
formatio
alo
lya
dthesystemdoes
otreadthembutexter
alservicessuchasGooglePlaydoreadthemi
ordertoprovidefilteri
gforuserswhe
theysearchforapplicatio
sfromtheirdevice
有多种多样的设备上运行着a
droid系统并且不是所有的设别都提供相同的特征和能力,为了防止你的程序安装在缺乏相应功能的设备上,在你的ma
ifest未见中声明硬件和软件的要求(为了让你的应用被不同的设备支持)变得尤为的重要。大多数这些信息和声明并不会被系统读取。但是其他的服务比如A
droidMarket却会阅读这些声明来帮助通过通过自己的设备搜索软件的用户过滤软件。
Forexampleifyourapplicatio
requiresacameraa
dusesAPIsi
troducedi
A
droid21APILevel7youshoulddeclaretheseasrequireme
tsi
yourma
ifestfileThatwaydevicesthatdo
othaveacameraa
dhavea
A
droidversio
lowertha
21ca
oti
stallyourapplicatio
fromGooglePlay
比如:你的应用需要照相和a
droid21的api,你应该在你的ma
ifest文件中声明这些要求。通过这种方法,这些没有相机功能或者是a
droid版本低于21的不能冲Googleplay中安装该应用
共21页第10页
fHoweveryouca
alsodeclarethatyourapplicatio
usesthecamerabutdoes
otrequireitI
thatcaseyourapplicatio
mustperformacheckatru
timetodetermi
eifthedevicehasacameraa
ddisablea
yfeaturesthatusethecameraifo
eis
otavailable然而,你也可以在你的应用中使用相机,但是并不是需要它。在这个情况下,你的应用在运行时必须执行一次检查来确定这个设备是否有相机。如果你的设备没有相机,那么系统会使使用照相机的相关程序不可用
Herearesomeoftheimporta
tdevicecharacteristicsthatyoushouldco
siderasyoudesig
a
ddevelopyourapplicatio
在你设计和开发你的应用程序的时候,这里是一些你应该考虑的重要的设备特征
Scree
sizea
dde
sity屏幕尺寸和分辨率
I
ordertocategorizedevicesbytheirscree
typeA
droiddefi
estwocharacteristicsforeachdevicescree
sizethephysicaldime
sio
softhescree
a
dscree
de
sitythephysicalde
sityofthepixelso
thescree
ordpidotsperi
chTosimplifyallthediffere
ttyper
好听全球资料 返回顶部