android-7.0-nougat

Android: register new PhoneAccount for telecom

和自甴很熟 提交于 2019-12-22 03:40:50
问题 I'm trying to make a new PhoneAccount to use my implementation of ConnectionService. In the documentation it says I need to register a new PhoneAccount with TelecomManager and then select it in my phone-app's settings. Here's my code: TelecomManager telecomManager = (TelecomManager) getSystemService(Context.TELECOM_SERVICE); ComponentName componentName = newComponentName("se.example.connectionservicestandalonetest", "se.example.connectionservicestandalonetest.MyConnectionService");

What Is the Proper Project Configuration for the N Developer Preview?

╄→гoц情女王★ 提交于 2019-12-22 03:37:12
问题 The docs claim a build.gradle like this works: android { compileSdkVersion 'android-N' buildToolsVersion 24.0.0 ... defaultConfig { minSdkVersion 'N' targetSdkVersion 'N' ... } ... } That gives me failed to find Build Tools revision 24.0.0 , when using 'com.android.tools.build:gradle:1.5.0' for the Android Plugin for Gradle and Gradle 2.5. If I look in build-tools/ in my Android SDK installation, I see 24.0.0-preview , not 24.0.0 . However, if I switch my build.gradle to use buildToolsVersion

Android Notification with DecoratedCustomViewStyle

…衆ロ難τιáo~ 提交于 2019-12-21 21:42:24
问题 I'm trying to create a Notification on Android 7 with a custom layout but I want to use the DecoratedCustomView Style from the v7-Support Library: https://developer.android.com/reference/android/support/v7/app/NotificationCompat.DecoratedCustomViewStyle.html The reason why I want to use this style is that I want to use the notification header provided by android, as the documentation states: Instead of providing a notification that is completely custom, a developer can set this style and

Support split screen in Android N+ only on tablets

时间秒杀一切 提交于 2019-12-21 16:17:43
问题 Is there a way to configure multi-window support for an activity only on screens large enough, e.g. tablet? https://developer.android.com/preview/features/multi-window.html#configuring doesn't mention that. Setting android:minimalHeight and android:minimalWidth seems to not help, because If the user moves the divider in split-screen mode to make an activity smaller than the specified minimum, the system crops the activity to the size the user requests. Use case: for certain activities, it

Programmatically enter multi-window mode in Android N

為{幸葍}努か 提交于 2019-12-21 10:19:09
问题 Android N has a new feature - Multi Window Mode. It enables two applications to be active side-by-side (actually one one is active, other one is paused but we can see both simultaneously). I am looking for an API that I can call to have my application enter multi-window mode. I couldn't find much help in Android N SDK docs. I am trying to have two activities of my app run side by side, but without user having to do manual steps. MANUALLY ENTERING MUTLI-WINDOW MODE The user can switch into

How to open an APK file for all Android versions

二次信任 提交于 2019-12-19 19:17:11
问题 Background So far, there was an easy way to install an APK file, using this intent: final Intent intent=new Intent(Intent.ACTION_VIEW) .setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive"); But, if your app targets Android API 24 and above (Nougat - 7.0) , and you run this code on it or newer, you will get an exception, as shown here , for example: android.os.FileUriExposedException: file:///storage/emulated/0/sample.apk exposed beyond app through Intent.getData()

How to deserialize object in OpenJDK (Android 7+), which has been serialized in Apache Harmony (Android *-6)?

大憨熊 提交于 2019-12-19 03:58:56
问题 My app uses http://prevayler.org/ for persistence, piggybacking Java Object serialization. After upgrade to Android 7.0 (Nougat) users cannot open their data, since the deserialization does not work any more: java.io.StreamCorruptedException: invalid type code: 71 at java.io.ObjectInputStream.readString(ObjectInputStream.java:1647) at java.io.ObjectInputStream.readEnum(ObjectInputStream.java:1737) ... at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373) at org.prevayler

Couldn't hear incoming voice in recorded calls in android 7?

假如想象 提交于 2019-12-18 12:34:33
问题 I am developing an Android app for recording calls. This is my code snippet. recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); recorder.setOutputFile(file_path); This is working perfectly for devices below android 7, but when I use Android 7 mobile devices I can hear only outgoing voice but cannot hear incoming voice . Can anyone

Cannot launch AVD in emulator. Output: sh: 1: glxinfo:

你说的曾经没有我的故事 提交于 2019-12-18 12:19:26
问题 Cannot launch AVD in emulator. Output: sh: 1: glxinfo: not found Could not launch '.../sdk/tools/qemu/linux-x86/qem u-system-i386': No such file or directory 回答1: You need to install the tool. On Ubuntu you can do: sudo apt-get update && sudo apt-get install mesa-utils 来源: https://stackoverflow.com/questions/36258908/cannot-launch-avd-in-emulator-output-sh-1-glxinfo

How Do We Generate a Base64-Encoded SHA256 Hash of SubjectPublicKeyInfo of an X.509 Certificate, for Android N Certificate Pinning?

大城市里の小女人 提交于 2019-12-18 10:14:01
问题 The documentation in the N Developer Preview for their network security configuration offers these instructions: Certificate pinning is done by providing a set of certificates by hash of the public key (SubjectPublicKeyInfo of the X.509 certificate). A certificate chain is then only valid if the certificate chain contains at least one of the pinned public keys. The XML that they show is broken (missing a closing tag), but otherwise suggests that the hash is SHA256 and encoded base64: <?xml