android-6.0-marshmallow

Android VOIP applications behavior in Doze mode

懵懂的女人 提交于 2019-12-07 02:52:06
问题 I'm working on legacy VOIP application on Android. It doesn't use Google Cloud Messaging technology right now, but just keeping its own TCP connection forever. Recently Google has introduced its Android M preview release with Doze mode So the question: is there any workaround how the app can receive incoming calls/messages in Doze mode without redesigning the whole system to use GCM? 回答1: You may use ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS to ask the user permission to be ignored by

Enable Mock Locations in Android Marshmallow

北慕城南 提交于 2019-12-07 02:24:20
问题 I cannot get mock locations to work in Android Marshmallow. I have installed app in Android 6.0 . Now, When I want to set mock location for this app by following option. Setting >> Developer Option >> Select Mock location app I can not see any Application to select. Has anyone had success enabling mock locations under Marshmallow? 回答1: If you use the Mock location permission: <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> Then you will be able to select your app by

Scrollbar touch area in Android 6

纵饮孤独 提交于 2019-12-07 00:55:29
问题 I observe new behaviour in Android 6.0 Marshmallow. The touching area of scrollbar is widther than the scrollbar. It is visible on following screenshot. Scrollbar has 20 dp (green area) and touching area is probably 48 dp (blue and green area). I would like to have the touch area above the scrollbar only: I use following: <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="MyTheme.Dark" parent="android:Theme.Black"> <item name="android:fastScrollStyle">@style

Run-time permission of Marshmallow

假装没事ソ 提交于 2019-12-06 21:24:01
问题 Such a new and awesome security functionality is RUN-TIME Permission I am trying to understand it and make one demo for that But one question raise in my mind that when i am at handle user permission with DIALOG. How to handle " Never ask Again " Suppose my application MUST need Location/contact but user DENY it with "NEVER ASK AGAIN". What can i do for that. Not all User understand my field is required. ANY SUGGESTION? 回答1: First you need to implement OnRequestPermissionsResultCallback

onCreate() gets called when reopen from recent task after permission settings is changed

点点圈 提交于 2019-12-06 20:46:12
问题 The question title may sounds complicated but here is my situation. I have a map fragment within an activity. Simple. turn on Storage permission to allow display of Map, works fine. Backgrounds the app by pressing Home button, then turn off the Storage permission and open the app from recent task, app crashes. The problem is instead of calling onResume() of the host Activity, onCreate() is called on the host Activity as well as onCreateView() of the Map fragment. Thus it is throwing

How do we toggle on MTP more easily on a Debug-Enabled Android 6.0 device?

荒凉一梦 提交于 2019-12-06 19:00:51
问题 In Android 6.0, MTP no longer works automatically: Device connections through the USB port are now set to charge-only mode by default. To access the device and its content over a USB connection, users must explicitly grant permission for such interactions. If your app supports user interactions with the device over a USB port, take into consideration that the interaction must be explicitly enabled. MTP needs to be re-authorized at least every time you plug in the USB cable, and possibly more

How to capture images in background using Camera2 api?

六月ゝ 毕业季﹏ 提交于 2019-12-06 16:35:14
I am developing an Android security app, and I want to capture images in background without preview. Is it possible to capture images in the background using the camera2 api? Yes, but as of Android 5.0 Marshmallow, you may be disconnected from the camera at any time, if a foreground app wants to use it instead. And before Android M, using the camera from the background is not recommended, since you'll block any foreground app from using it (the app will just get an error trying to open the camera, and generally will crash as a result). Otherwise, the camera API works the same. You'll need to

How to ask for user permissions in Android 6

为君一笑 提交于 2019-12-06 15:45:58
I am totally confused regarding the new permission system in Android 6 (Marshmallow). I am using two so called 'dangeorus permissions' - <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> And I use these permissions in many places. I need to access the user accounts for Registering the app, Sending Feedback etc.And I also access Device Id for registering the app. I wrote two functions to get the list of Mail Accounts and the device id in a Java Class named util, and uses these function in AsyncTask as well

Android M: Scene transition with hero elements throws java.lang.IllegalStateException

跟風遠走 提交于 2019-12-06 12:04:45
I have a scene transition that I had some issues with: Scene transition with hero elements throws Layer exceeds max. dimensions supported by the GPU But setting transitionGroup fixed it. When I compile the exact same app with the the latest Android M SDK it crashes when pressing back from the transition. Abort message: 'art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethod called with pending exception java.lang.IllegalStateException: Unable to create layer for RelativeLayout' Anyone knows if Google changed anything regarding this in Android M? It is reported

adb command - Marshmallow - change preferred network mode LTE/GSM

拜拜、爱过 提交于 2019-12-06 12:03:09
问题 I am on the 6.0.1 Marshmallow OS and my previous commands to change the preferred network mode are no longer working. Commands used in Kit Kat worked without issue: adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "SELECT * FROM global WHERE name='preferred_network_mode'" adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global SET value=1 WHERE name='preferred_network_mode'" adb shell sqlite3 /data/data/com.android