android-6.0-marshmallow

Android M (preview) Doze mode and AlarmManager

只愿长相守 提交于 2019-12-10 13:33:54
问题 I'm trying to test the behavior of our Android app when the OS goes in Doze mode. I'm using an emulator running Android API 23 (Revision 1). The application launches a Service through the AlarmManager using the method setInexactRepeating with type ELAPSED_REALTIME_WAKEUP. I set the alarm to fire approximately every three minutes (only for testing purposes). After several attempts (the official guide is very unclear) I succeed to put the emulator in IDLE state by locking the screen of the

Error inflating class de.hdodenhof.circleimageview.CircleImageView in Android version 6 marshmallow

六眼飞鱼酱① 提交于 2019-12-10 13:24:11
问题 I created an app which uses this hdodenhof CircleImageview library. My app works fine on Android 7 and 7.1 but it is crashing in lower versions such as marshmallow/Android 6. How can I solve this problem? I have read his GitHub posts but it did not solve my problem as people has asked to remove attributes from the .xml, but I didn't use these attributes. Here's my simple implementation of the CircleImageView: <de.hdodenhof.circleimageview.CircleImageView android:id="@+id/civ_requests" android

INTERNET permissions in Android M

℡╲_俬逩灬. 提交于 2019-12-10 13:03:56
问题 Regarding Google's recent announcement about Android M and Permissions model. Per the official Android documentation: Limited Permissions Granted at Install Time: When the user installs or updates the app, the system grants the app all permissions that the app requests that fall under PROTECTION_NORMAL. For example, alarm clock and internet permissions fall under PROTECTION_NORMAL, so they are automatically granted at install time. The system may also grant the app signature and system

getUidTxBytes(int uid) always return 0 in android 6.0

不羁岁月 提交于 2019-12-10 12:58:57
问题 I am trying to get network traffic stats of all apps. I just print total network traffic of every application in my device. The code is working fine in android 4.4 and 5.1 devices but in android 6.0 device it always return 0 for all applications. Anyone can please tell me why this happened in android 6.0 devices. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); for(ApplicationInfo app : getPackageManager()

Android Marshmallow Permission for my eclipse project not working

感情迁移 提交于 2019-12-10 12:22:33
问题 I have created an application using eclipse IDE. And now its crashing on Marshmallow for various permissions say contact. After lot of searching I come up with no result. It is showing error in checkSelfPermission , requestPermissions etc. on CONTACT from Manifest.permission.CONTACTS. I think the solutions are working on android studio projects. So let me know same for eclipse project if any one know it. 回答1: Full working demo You are making mistake of here there is no permission like

How to Restart the app in android marshmallow when permission changed manually

天涯浪子 提交于 2019-12-10 12:13:13
问题 I have an android application which was supporting till lollipop. Now I'm migrating it to support Marshmallow. I am stuck in a case where if we manually changed the app permission in marshmallow it kills all the process. I get it as explained by @CommonsWare in similar question here. But in my case I have to kill the app and need to restart the app. Because my app each activity is dependent on previous activity some data is shared. I just need to know when we manually change the permission is

trying to add marshmallow permissions using “Permissions Dispatcher”

≯℡__Kan透↙ 提交于 2019-12-10 11:53:12
问题 I'm trying to use the plugin Permissions Dispatcher(https://github.com/hotchemi/PermissionsDispatcher) to handle Marshmallow runtime permissions in a GPSTracker class which I want to call in a fragment, but I'm still getting the error "Call requires permission that may be rejected by user: Code should explicitly check to see if permission is available..." I think I need to add something to MainActivity but I can't figure out what. GPSTracker.java package me.paxana.alerta.adapter; import

href to “add to calendar” from web not working with native google calendar app on Android 6.0+

[亡魂溺海] 提交于 2019-12-10 10:48:58
问题 We have some href's linking to .ics files and google calendar etc. Everything works perfectly on the web and iOS devices. However, when linking to "Add to calendar" from Android 6.0+ within chrome, it auto opens the Google Calendar, which is expected, but then it just says "Event not found". Our links are setup the same way as suggested answer in: Link to add to google calendar Doing some research there looks to be some issues with Android 6.0 and google calendar, but I'm wondering if on an

App crashes with SecurityException on Android M [duplicate]

别说谁变了你拦得住时间么 提交于 2019-12-10 10:14:21
问题 This question already has answers here : Android 6.0 Permission Error (5 answers) Closed 4 years ago . Yesterday I set upped target and compile sdk to 23 API level. When I launched the app on Nexus 9 with Preview Android M (MPA441) the app crashes with following SecurityException : FATAL EXCEPTION: main Process: com.grouplogic.mobilecho, PID: 22554 java.lang.RuntimeException: Unable to create application com.mypackage.MyApplication: java.lang.SecurityException: getDeviceId: Neither user 10098

Android Adoptable Storage - get free Space

情到浓时终转凉″ 提交于 2019-12-10 09:31:44
问题 I have a App that uses 3 kinds of storage: The internal storage, a external SD and if Version >= 6.0 a SD which is formatted as internal. I get the external SD path by using getExternalFilesDirs() , the internal Storage by getFilesDir() and the adopted (=internal) SD path by Environment.getExternalStorageDirectory() . Now, if I want to get the free Space, something like this: StatFs statFs = new StatFs(storageDir); long blocks = statFs.getAvailableBlocks(); return Formatter.formatFileSize