Android 12 bluetooth permission for react-native 0.62 - android

According to
https://developer.android.com/guide/topics/connectivity/bluetooth/permissions
There are need to grant permission manually to handle bluetooth for android 12 (API level > 30)
uses-permission android:name="android.permission.BLUETOOTH_SCAN"
uses-permission android:name="android.permission.BLUETOOTH_CONNECT"
But according to
https://reactnative.dev/docs/0.62/permissionsandroid
These two PermissionsAndroid in RN 0.62 are not available and only available for RN ^0.66 causing error permission is null.
Is there any solution to use these permission in RN 0.62?

There are one way to go around it....
Upgrade the target or compileSDK (don't remember exactly which one - but since you are already working with android 12, I'm assuming you've already set it to sdk 30), use a package like https://www.npmjs.com/package/react-native-permissions
Or....... Upgrade your entire app to latest react native version (I recently upgraded my two projects from react native 0.63 to latest and it was pure chaos and pain :) - nah just exaggerating, it feels so great to have your apps on latest version)

Related

Android Apps run well on android studio but not compatible in store

I've been developing with a device in android studio, and run well, no issue at all.
But after I released it in store, some devices including mine could not find it because it was incompatible.
Is there anyway to find out why my device isn't compatible in store?
you beat me by seconds to the answer except mine was wrong. :)
Well not exactly- what I was going to say is that Android Studio has great documentation and I remember reading about that when I first downloaded it.
If you want to run on older devices the best way to be sure is to download a VM that is the lowest possible supported version and test on that before dist.
All the best.
You must be setting your minSdkVersion higher than your device sdk version in build.gradle or setting supports-screens to the limited device in your manifest.
Apart from that if you are using some hardware permission which is not necessary then set required false in manifest.
e.g
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

How do I set my Eclipse to compile for Android 2.3

This is probably very basic but I have failed to find information on how to do this. On iOS I have a base SDK and a target SDK so I can use the latest features from the base SDK (of course check if they are available first) and at the same time make my app run on devices with the target SDK. How can I do the same thing with Android in Eclipse, how can I compile with Android 4.1 and at the same time make my app run on (deploy to) Android 2.3?
Im not asking about checking which version I am running at run time, but how do I configure Eclipse correctly.
Thank you
Søren
Start by reading backward compability on Android developer site. You are probably looking for "Set Minimum and Target API levels".
On your Androidmanifest.xml check for the uses-sdk tag
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
version 8 is Android 2.2 up to 16 for 4.1/4.1.1
from here

Sell Apps with sdk target 13?

I would like to know if phones with Android 2.3 or lower could download Apps with:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
and Build Target 15?
Becuase I have to do so to use the AdMob jar.
Thanks
Yes they can, this is the goal of the android:minSdkVersion attribute. It prevents users with an older android version to download and install the app.
Yes, any device running SDK version 7 and above will be able to install your application. The targetSdkVersion attribute doesn't restrict devices from installing your application. Instead, it specifies the maximum API level on which your application should be able to run on.
Just be careful that you protect earlier versions of Android from making use of the new methods provided in SDK 15, as this will cause your application to crash.

android app to be runned only in 2.2 and 2.1 versions

in my app i have two set of designs. One design is for the android devices version of 2.1 and 2.2, the other design is for devices of 2.3 and above.
Now the problem is i take a build setting as follows in my manifest file
<uses-sdk android:minSdkVersion="7" />
<uses-sdk android:maxSdkVersion="8" />
My android project properties in been set to 2.2. When i run this build in 2.3.4 devices it gets run properly. How does it happens?
I am planning to submit the app with multiple apk files in market. How to block my apps
one build to be run in 2.1 and 2.2 and
the other build to get run in 2.3 and above
I just tried setting only <uses-sdk android:minSdkVersion="7" /> or <uses-sdk android:maxSdkVersion="7" /> or <uses-sdk android:maxSdkVersion="8" /> or
<uses-sdk android:targetSdkVersion="8" /> then also it gets run in all devices of 2.3.4 devices
Please help me friends....
Hey as per the android documentation :
Introduced in: API Level 4
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation. Google Play will continue to use the attribute as a filter, however, when presenting users with applications available for download.
You might want to have a look at last few lines of this link
EDIT1:
Also have a look at the Warning
Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible. Your application should work properly on new versions, provided it uses only standard APIs and follows development best practices. Second, note that in some cases, declaring the attribute can result in your application being removed from users' devices after a system update to a higher API Level. Most devices on which your application is likely to be installed will receive periodic system updates over the air, so you should consider their effect on your application before setting this attribute.
According to documentation:
Future versions of Android (beyond Android 2.0.1) will no longer check or enforce the maxSdkVersion attribute during installation or re-validation
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#max
Alternatively, you can check API version at runtime and block the use of your app.
http://developer.android.com/reference/android/os/Build.VERSION.html
You can install it using the adb or directly downloading the apk through a website.
The minSdk and maxSdkVersion is checked only when its installed from Android market. Devices with versions out of this range will not see your app in the market.
You need to use PackageManager Class for Version Specific Application. There is a method called getPackageInfo() which returns an object of PackageInfo. From this PackageInfo, you can fetch values of Version Name & Code.
Now you have values, so use logic and implement it

What happens if we use/install 2.3 build in 2.2 device

I am working on application which should go into android 2.2(Froyo) and android 2.3(GingerBread) devices.
I have built application with android 2.3 SDK , and Installed the same application in 2.2(Froyo) and 2.3 (Ginger Bread) devices.
In both the devices application installed successfully and it is working properly.
I want to know if we install the higher version build into lower version devices is there any chances to face problems.
Till now I didn't found any issue with this.
I didn't used the MIN:SDK version field in the Manifest file.
If you want only users from version 2.2 and up to download your app, just make sure your minimum SDK version is 2.2 by putting this line in your AndroidManifest.xml:
<uses-sdk android:minSdkVersion="8" />
If you want an upper bound limit as well, you can add:
android:maxSdkVersion="10"
So users with Android SDK version 2.2 up to 2.3.3 will be able to install your app.
Regarding problems: If you're using a specific SDK API then just make sure to add an if clause around it to make sure you're on the right version. The best thing to do is change the target to 2.2 just to see if you have any compilation errors... Then you'd know what to change.
Then just fix the problems, change back to 2.3 and build.
If you don't specify the minimum sdk attribute in the manifest file users with 2.2 won't see your application on the market. It specifies that your application supports 2.2 so that users can see the app on the market.
Make sure any functionality that you use from 2.3 has an alternative functionality so that 2.2 users have the ability to actually use your application.
yes , u can find problem ,
try to install that app on android 1.6
it's about API version , there will be some APIs in your app doesn't supported in a lower API version

Categories

Resources