android-6.0-marshmallow

USE_CREDENTIALS not available in new Android M API

谁说我不能喝 提交于 2019-12-11 05:46:49
问题 While trying new permissions API, notably: ActivityCompat.checkSelfPermission ActivityCompat.shouldShowRequestPermissionRationale ActivityCompat.requestPermissions for permission: android.permission.USE_CREDENTIALS (whichn is not listed as "normal" permission) I've received an "unknown permissionn exception". Is it a bug? Or is USE_CREDENTIALS a normal permission after all? 回答1: Neither. USE_CREDENTIALS was removed from the Android SDK in Android 6.0. Not only will you not find it in Manifest

Android 6.0 Broadcast Receiver don't receive BOOT_COMPLETE

ぐ巨炮叔叔 提交于 2019-12-11 05:14:45
问题 My receiver is not working with Android 6.0 Marshmallow . I am sending a broadcast through adb shell, see below: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED received if application was open, App say:Working! But if the application was not open, it has not been returning anything. My code is here; AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.berate.rebootreceiverfromb3r0">

Activity.onProvideAssistContent() example

梦想与她 提交于 2019-12-11 04:55:28
问题 Could anybody give mi an example of using Activity.onProvideAssistContent(), new in Android 6.0? 回答1: For example for Music file you will use MusicRecording type from Schema.org in such way: @Override public void onProvideAssistContent(AssistContent assistContent) { super.onProvideAssistContent(assistContent); String structuredJson = new JSONObject() .put("@type", "MusicRecording") .put("@id", "https://example.com/music/recording") .put("name", "Album Title") .toString(); assistContent

How to add the custom button on google's(device) native application in android?

天大地大妈咪最大 提交于 2019-12-11 02:49:39
问题 I want to add one button on google(device)'s native application Like(Google Map),Using this button I want to open my application. I have do some work regarding that. Using AccessibilityService I find the which application still running using this service I open the stand alone dialog using SYSTEM_ALERT_WINDOW permission. But the dialog cover whole screen , I manage to display this dialog in screen bottom side, but still I can't do anything in device native application like (google map),

Background Service stop after power saver enable and disable

被刻印的时光 ゝ 提交于 2019-12-11 02:15:43
问题 I have an application in which I perform some task in background, So the task will perform if my background service is running Problem : When I enable and disable power saver, so it close everything and stop every background services which are running. After turning off power saver the service is not getting start till I open the application. So how I can restart my background service when power saver off for lower version than Android.M Facing issue in Android 6.0 and below. Myservice.java

Not able to grant my custom content provider permission in android?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 01:38:24
问题 I was developing a content provider app. In the manifest of that app I was placed a provider element In the application tag. The following are the code <provider android:name=".PlatesContentProvider" android:authorities="com.tag.custom_contentproviderdemo.Plates" android:enabled="true" android:readPermission="PlatesContentProvider._READ_PERMISSION" android:writePermission="PlatesContentProvider._WRITE_PERMISSION" android:exported="true" > I also developed another app namely CPClient. It will

Android Marshmallow [API 23] : Bluetooth UUID returns NULL

微笑、不失礼 提交于 2019-12-11 00:58:17
问题 Just updated my android to marshmallow and realized that is not working very well. I have just created an app that reports the Devices and Services (with UUIDs) availables via classical bluetooth: I've tested it in: API 16 API 22 API 23 My manifiest permissions are: <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name=

Difference between setAndAllowWhileIdle and setExactAndAllowWhileIdle

江枫思渺然 提交于 2019-12-10 20:32:37
问题 What is difference between AlarmManager.setAndAllowWhileIdle() and AlarmManager.setExactAndAllowWhileIdle() ? How does these both affect Doze mode introduced in Android 6.0 (Marshmallow) API? 回答1: Refer to the documentation of AlarmManager : Note: Beginning with API 19 (KITKAT) alarm delivery is inexact: the OS will shift alarms in order to minimize wakeups and battery use. There are new APIs to support applications which need strict delivery guarantees; see setWindow(int, long, long,

requestPermissions NameNotFoundException android M

给你一囗甜甜゛ 提交于 2019-12-10 19:44:24
问题 I have the following code: public static void requestPermissions(final Activity activity){ System.out.println("Permission 0 : " + activity.getPackageName()); int permission = activity.getPackageManager().checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, activity.getPackageName()); if(permission != PackageManager.PERMISSION_GRANTED){ PackageManager pm = activity.getPackageManager(); try { PackageInfo pi = pm.getPackageInfo(activity.getPackageName(), PackageManager.GET_ACTIVITIES);

Unable to retrieve number before incoming call in marshmallow

六眼飞鱼酱① 提交于 2019-12-10 18:44:38
问题 I am able to retrieve incoming call number in other version of android but unable to retrieve incoming call number in marshmallow android public void onReceive(Context context, Intent intent) { mContext=context; if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_RINGING)) { String incomingNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER); Toast.makeText(context, "Call from:" + incomingNumber, Toast.LENGTH_LONG).show(); final Thread