I have given user permission in manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
chat app works well with wifi but it doesn't work with GSM connection.
http://pastie.org/9776176 i wrote the database connection code.
Related
On Android12 devices, when using the bluetooth features, I get the flowing exception:
java.lang.SecurityException: Need BLUETOOTH permission
android.bluetooth.BluetoothHeadset.<init>(BluetoothHeadset.java:379)
android.bluetooth.BluetoothAdapter.getProfileProxy(BluetoothAdapter.java:3017)
My app's targetVersion is 29, and the related permissions have already declared in manifest.xml:
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<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_CONNECT" />
This problem will not happen when the app first loading, but happened after turn on/off the Nearby Devices ipermission. It seem that it will clear the BLUETOOTH permission?
I am currently able to get the Bluetooth adapter mac address on devices with sdk from Marshmallow till Oreo.
However, starting Pie, the retrieved mac address is null.
The following method is working only till and including oreo.
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission
android:name="android.permission.LOCAL_MAC_ADDRESS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="READ_PRIVILEGED_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
String macAddress = Settings.Secure.getString(context.getContentResolver(), "bluetooth_address");
return macAddress;
I also tried to access BluetoothAdapter.getDefaultAdapter().getAddress() but it returns a fake Mac address like this "02:00:00:00:00"
I only ask the user for runtime permission for fine location. Should I ask for something else? Is there a way to achieve this on Pie and 10?
N.B: I know such app can not be uploaded to Google Play. I just want to implement this for testing purposes on personal devices.
My app seems to connect to server and work only when I am using the wifi connection. However when I use the mobile network (mobile data) connection it does not connect to server. Does anyone have any suggestions what I should do? My AndroidManifest.xml permissions look like this:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
After the update to Google Policy I've removed the permissions for CALL_PHONE and SEND_SMS from my AndroidManifest.xml.
After uploading the latest version (yesterday) when I login to my Publish Dashboard, I'm still getting the warning that the application will be removed on 9th January.
These are the permissions I'm using in the Manifest now.
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
This is the warning I'm getting.
I've also noticed that if I check the Permissions used in the Google Play Listing, they are:
This app has access to:
Location
approximate location (network-based)
precise location (GPS and network-based)
Phone
read phone status and identity
Photos/Media/Files
read the contents of your USB storage
modify or delete the contents of your USB storage
Storage
read the contents of your USB storage
modify or delete the contents of your USB storage
Wi-Fi connection information
view Wi-Fi connections
Device ID & call information
read phone status and identity
Phone
directly call phone numbers
read phone status and identity
Other
receive data from Internet
mock location sources for testing
view network connections
full network access
prevent device from sleeping
read Google service configuration
Is this due to the READ_PHONE_STATE Permission? or does this take some time to update?
There might be some permission available in some other module or library you are using in project
Please remove manually from manifest like this
uses-permission android:name="android.permission.READ_SMS" tools:node="remove"
uses-permission android:name="android.permission.RECEIVE_SMS" tools:node="remove"
hope it will help
I am making an application in android which integrates twitter and facebook logins and save the logged user info. It is working fine in device with GPRS. But when I am trying to run the application with wifi it gives exception as below.
For Twitter: "Server error"
For Facebook: "DialogError"
please give me some hint to solve this problem.
use permission
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
I think u off ur WIFI in phone.