Enable permission to get WiFi details - Android marshmallow - android

I am using wifiwizard, a cordova plugin to get the available wifi networks in ionic framework. It works fine for all the android os except marshmallow. In marshmallow, I need to enable the location to get the same. How to resolve this issue?
Things tried:
Provided permissions in the wifiwizard-> plugin.xml.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Could anybody help?
Thanks in advance.

You need to update your plugins if you are using old plugins.
https://cordova.apache.org/announcements/2015/11/09/cordova-android-5.0.0.html
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

Related

location permission missing (code 3) - Android 12

I am working for an application which uses BLE technology for pairing and IOT device and uses precises location to perform some specific task related to application requirements
Now, on Android 12 some device (I tested on SAMSUNG SM-M21)
it ended up in error
location permission missing (code 3)
whereas in another device like Realme, Mi it works fine as expected
After referring to the article
https://developer.android.com/guide/topics/connectivity/bluetooth/permissions
I already added these permission in the Manifest
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
I am already requesting permission at runtime from user
If any more information is needed, please let me know. I will update the question accordingly.
I solved it by adding this to manifest
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
and at code level added a condition which add extra permission runtime only for Android 12 and above
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S){
//requesting permission only for Android 12 and above
Manifest.permission.BLUETOOTH_SCAN,
Manifest.permission.BLUETOOTH_CONNECT,
Manifest.permission.BLUETOOTH_ADVERTISE,
}
Note: other permissions also as normally requested

Bluetooth LE (BLE) Scanning Bug & Issue with Android (Nov 2021)

I am trying to scan for Bluetooth LE devices in Android with Java. Everything worked fine and I released an update and on fresh installs it does not work. I went through every weird and funcky permission related to BLE on Android inclusive of ACCESS_FINE_LOCATION permissions.
Deeply reviewed the following:
https://developer.android.com/guide/topics/connectivity/bluetooth/permissions
I can’t see what I’m doing wrong:
My app works on older versions of Android, with a fresh install, on an S7 with Android 8.0.
does not work on Samsung S9 and S10+ running Android 9.0 and 11.0, respectively.
Location permissions is enabled. I can see this programmatically and via settings. Picture below
Screenshot of Location enabled on non-scanning S9 with Android 9.0
I can reproduce the same issue with this independent code base https://github.com/PunchThrough/ble-starter-android.
I thought I was crazy but the above code base is does the same thing for Android 10 and has all the same permissions my app has. with the same problematic results. I’m guessing this is happening for others.
28sec video of issue:
https://youtu.be/PzSZ0RnuORQ
What am I not seeing? What changed?
UPDATE WITH PERMISSIONS:
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
-->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

Android: Why is android.permission.ACCESS_WIFI_STATE automatically added to my signed apk build?

My app uses a couple of permission:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
and:
android:permission="com.google.android.c2dm.permission.SEND">
Yesterday I uploaded a new version to google play and somehow the
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
has been added and thus users won't get an auto update of my app but have to give permission first. I don't want this permission added to my project, but I have no idea how to remove it since pre-build it's not requested in my code anywhere.
Does anyone have some advice?
I was able to remove the permission by adding:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
tools:node="remove"/>
Also #Arnav: I wasn't using any functionality of the library that needed this permission so removing caused no issues.
The library projects as dependency needs to be used as this require that permission. You have enabled the manifestmerger property true in project properties () because of which this issue may occurs.
This permission can be removed as follow:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"
tools:node="remove"/>

app works on development google-play store show device incompatible

I'm developing a android app. While developing I tested it on Moto E os-4.4.4. It works properly. But after deployment playstore shows your device is incompatible with this version. It shows compatible with many other devices running same os version.
I found some similar questions I tried there answers but nothing seems to work for me.
Any help is appreciated.
Here's my manifest file
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18"
/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Not only moto e, its showing incompatible with over 1000 devices. The external libraries I've used are apptentive,flurry,facebook and actionbarshelock.
Android 4.4 is version 19. By setting a max SDK version, you're telling it not to allow install on any version over 18. So it won't consider your device compatible. Remove that max sdk version. Even google no longer checks this on the device beyond version 2.0.1.
There was some problem with google-playstore. It got solved after playstore update and now it's compatible with my device as it should be.

Network state error navigator.connection.type return 0 always with phone gap 2.8.1

I am using navigator.connection.type for the phonegap version 2.8.1 with sencha touch build
Am getting 0 always for even network is or off in device
can any one help me out whats the issue is
http://docs.phonegap.com/en/2.9.0/index.html
I have below permissions for manifest file too
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
You may have to add
NETWORK_STATE_PERMISSION
and maybe
INTERNET
permissions to Android manifest ?

Categories

Resources