android-6.0-marshmallow

How to send a high-priority GCM?

自古美人都是妖i 提交于 2019-12-22 01:53:49
问题 I'm using a Nexus 5 with Android M Preview. My problem that I'm trying to solve is: Network access is disabled, unless your app receives a high priority Google Cloud Messaging tickle. What I'm doing is: I put the phone into Doze mode and then I send a push notification with the priority with value 10 and I'm expecting to have internet access for a brief moments, but this is not working. Should I use other type of notifications? There are any documentation already available? Thanks. Android M

Android app time delay on 5.0+ devices

…衆ロ難τιáo~ 提交于 2019-12-22 01:32:41
问题 My app is taking 10-12 sec delay while first load on 5.0+ devices, 4.4 or below devices does not have this problem. I have added a log message in Application class onCreate method but it is also called after 10-12 sec seconds. I have tried multidex enable false, minify enabled true but does not make any difference. I have found one thing, when we clear cache and data from app info activity, then it again delay while loading and my app is taking around 10mb of cache and 5 mb of data which is

location.getSpeed() not coming for Marshmallow, using Fused Location API

喜你入骨 提交于 2019-12-21 23:52:21
问题 I'm using Fused Location API in my app ( getLatitude() , getLongitude() , getSpeed() , getElevation() , and distanceTo() ). It was working fine until I updated my phone (Moto X2 2014) to Marshmallow. Now I don't receive speed in the location object in my app, rest methods are responding normally. However, if I run navigation on google maps in the background, I seem to receive speed inside my app as well. Also, my app seems to work without any issues on Nexus 5X (Marshmallow) and other below

DragEventListener not working on Samsung S7 (6.0)

丶灬走出姿态 提交于 2019-12-21 23:44:26
问题 I'm looking for a direction to go with this one. I have a card melding game (Five Kings) which has been up for about 6 months; my latest version 0.9.22 has been stable since March. However, recently I have been getting reports of users unable to drag discards to the discard pile, and the common thread seems to be Samsung S7 with Android 6.0 . When you drag a card from your hand, the places you can drag turn transparent and when you drag over them they go back to normal (alpha=1). Other places

Some Permissions' protectionLevel seems wrongly documented or implemented

痴心易碎 提交于 2019-12-21 21:36:00
问题 I'm running through many permissions tagged PROTECTION_NORMAL and PROTECTION_DANGEROUS in a ListView . Upon click my application calls ActivityCompat.requestPermission() . All permissions I tested (by that I mean all normal and dangerous permissions for API-7 and above I could find) are working fine on my Emulator, except for some: CHANGE_NETWORK_STATE Requesting CHANGE_NETWORK_STATE always returns PackageManager.PERMISSION_DENIED (without even prompting). I would expect it granted by default

Marshmallow app permission revoke notification? [duplicate]

有些话、适合烂在心里 提交于 2019-12-21 13:16:38
问题 This question already has an answer here : Android Marshmallow Callback when user revokes permissions from settings ? (1 answer) Closed 4 years ago . In Android 6.0 (Marshmallow), users can revoke specific app permissions, even after granting it from inside the app. I know I can check permissions with ContextCompat.checkSelfPermission() . But Is there a way for my app to get notified when the user revokes one of my app's permissions, without repeated checking with ContextCompat

Android 6 getAccountName() Missing android.permission.GET_ACCOUNTS

▼魔方 西西 提交于 2019-12-21 07:13:21
问题 I get the following Exception while running on a Android 6 device. java.lang.SecurityException: Missing android.permission.GET_ACCOUNTS This looks like a fairly straight forward exception, but for me it's not. My manifest looks like this: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="..." > <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android

Android Draw behind Status bar but not behind the navigation bar

坚强是说给别人听的谎言 提交于 2019-12-21 04:14:34
问题 I'm looking into a way where the status bar is completely transparent, not translucent and where the Navigation Bar is left untouched. Closest I can get is to use the flag WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS but this draws behind the Navigation Bar as well. The background is what is making this tricky, it is a subtle gradient, and when I set the status bar color to the start of the gradient, it looks almost right, but has a subtle line across the top of the screen. Is there a

Android Robolectric unit test for Marshmallow PermissionHelper

旧巷老猫 提交于 2019-12-21 03:38:23
问题 I wanna learn Robolectric to use it for unit tests on an Android Marshmallow app. I wrote a PermissionHelper with some methods to make permission handling a bit easier. To get started with unit tests for this class, I am trying to test the most simple method: public static boolean hasPermissions(Activity activity, String[] permissions) { for (String permission : permissions) { int status = ActivityCompat.checkSelfPermission(activity, permission); if (status == PackageManager.PERMISSION_DENIED

Flashlight control in Marshmallow

为君一笑 提交于 2019-12-20 18:28:21
问题 I have a problem regarding the camera in the most recent Marshmallow build, more specifically the flashlight. On any pre-Marshmallow version all I need to do to turn the flash on/off was the following: private void turnFlashOn(final Camera camera, int flashLightDurationMs) { if (!isFlashOn()) { final List<String> supportedFlashModes = camera.getParameters().getSupportedFlashModes(); if (supportedFlashModes != null && supportedFlashModes.contains(Camera.Parameters.FLASH_MODE_TORCH)) { mParams