xml - In Android manifest, how to require at least one of two pieces of hardware? -
for example, if writing app involving wireless data transfer between 2 devices, can done through either bluetooth or nfc. so, in manifest, how denote app requires @ least 1 of these two? have little experience xml, not sure how approach this.
one solution use build variants in android studio. feature allows share code provide custom code , configuration different variations of same app. need create 2 "product flavors", 1 nfc , other bluetooth. common code , androidmanifest in main folder of android studio project. customizations in separate folders each variant. includes androidmanifest files different <uses-permission> tags. have different code implement hardware-dependent features.
when ready publish google play, need build 2 different apk files, 1 nfc support , 1 bluetooth. can upload both apks same google play app. (see multiple apk support.) user's point of view, there 1 app.
Comments
Post a Comment