Just to (hopefully!) help others out here (I don't really post, but as
Diannes comments on messages in the past have saved me *lots* of time
- thankyou!), here is what the majority of you are probably looking
for:

<uses-feature android:name="android.hardware.bluetooth"
android:required="false" />

If your app doesn't need Bluetooth to work, but it is a nice feature,
then you'll need the above in your AndroidManifest.xml otherwise the
recent 'upgrade' to the market will cause the app to be hidden for
Android 1.5/1.6 (this is what happened to me with my app 'Torque') -
it's also useful to see what other things this <uses-feature> affects
(cameras & autofocus, causing apps to be hidden, etc) and is well
worth a read in the developer docs!!!

Don't forget Android 1.5/1.6 didn't have an official/complete
Bluetooth API - so this means the (rather handy) gerdavax library will
be useful to you here. If you are using Android 1.5/1.6, and declare
bluetooth as a permisison, your app WILL be hidden until you specify
the <uses-feature> bit in your applications manifest. Your app will be
hidden because Bluetooth really wasn't available on those devices, so
it does make sense, however, that library enables you to use the
(*unofficial!!!*) bluetooth that does exist.

Please make sure you code for Bluetooth actually not being present
though!!

Two words of warning though. Devices that are based on Android build
id "ERD79" *do* *not* *work* because the InputStream lags (basically
it says there's nothing available when there's about 16 bytes in a
buffer waiting somewhere). Don't expect any Android 2.1 device based
on this build to work well with bluetooth. It also affects handsfree
devices!

There is also a spurious reboot caused by using Bluetooth (from 2.1 to
the latest FroYo) - looks like a memory/pointer issue. Expect problems
if you continually try to connect to a device that isn't present. This
has improved through the releases, but is still present.

Other than that it's all good! :-)

Thanks

Ian

On Jul 14, 8:41 pm, Dianne Hackborn <[email protected]> wrote:
> Market does not filtering based on permission.  There is no need to follow
> that line of thought (and it is no argument for wanting the feature that was
> brought up here).
>
> The aapt tool is starting to infer features based on permissions, to prevent
> old applications from being delivered on devices that can now lack features
> they may have depended on.  Some discussion of this can be found 
> here:http://android-developers.blogspot.com/2010/06/future-proofing-your-a...
>
> There may be an issue with Market mistakenly thinking that a bluetooth
> permission implies the need for the bluetooth feature even on pre-2.0
> devices, when it really should start with 2.0 where the feature was
> introduced.  At any rate, the correct thing for an app developer to do is
> explicitly state which features they care about, and you can there use
> android:required="false" to tell Market not to filter your app based on it.
>
> On Wed, Jul 14, 2010 at 2:26 AM, Jonas Petersson 
> <[email protected]>wrote:
>
>
>
>
>
> > On 07/14/2010 10:54 AM, Joe wrote:
>
> >> I can see why Google wouldn't want to complicate the permissions for a
> >> user. I am not suggesting they let the user choose which permissions
> >> to allow. An obvious issue with doing that is that users could "break"
> >> your app by crippling the permissions, and then complain it doesn't
> >> work and give you a bad rating on the market. That is really a
> >> separate topic/argument.
>
> > I think you misunderstood what I asked for: what I'm after is that the
> > DEVELOPER should have the ability to flag a particular permission as
> > optional. Market can use this for filtering - in your case an optional
> > BlueTooth permission would allow users with no bluetooth library
> > (theoretically 1.x) to install the application. For a user who installs it
> > on a device WITH bluetooth, the normal installation warning screen would
> > allow that option to be deselected. The application will have to check
> > whether it actually got the optional permission - if it doesn´t it deserves
> > a bad rating.
>
> > Although this is not exactly your problem at the moment it certainly is
> > closely related. IMHO.
>
> >  Any way back to my issue:
>
> >> Apps are (or were) filtered from the market based on screen size and
> >> android version.
>
> >> They were not filtered based on permissions.
>
> > I wouldn't place any bets on that one. I'm pretty sure that for instance
> > the Barcode Scanner program is filtered out for devices that lack auto focus
> > for instance. This may not exactly be permissions, but rather a device
> > profile (I've noted that new/prerelease phones often see a lot less of the
> > apps on Market), but exactly how it works may be something that we really
> > shouldn't know too many details of since I would expect it to change
> > (hopefully improve) over time.
>
> >  It seems some confusion
> >> has crept in. When i say in my app is android:minSdkVersion="3" - i
> >> mean it :)
>
> >> The bluetooth permissions have been around since the start, they are
> >> nothing new.
>
> >> This is obviously a mistake recently introduced on the Android
> >> Market.
>
> >> Anyone coding a bluetooth app should have made it backwards compatible
> >> (as mine was) OR have set their minSdkVersion="5"
>
> > Well, the good old Bluetooth File Transfer app seems to work. I've not got
> > a 1.6 device handy, but the one installed on my Milestone has target sdk set
> > to 4 and it asks for BT admin plus create BT connections.
>
> >  On Jul 14, 10:39 am, DonFrench<[email protected]>  wrote:
>
> >>> Ok, I clicked the star and added my support.
>
> > Excellent! Anyone else?
>
> >                        Best / Jonas
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to