android-8.0-oreo

Change WiFi hotspot's SSID and password in Android Oreo 8.x

江枫思渺然 提交于 2019-12-04 15:35:58
问题 In my Android application I'm using the following code snippet: @RequiresApi(api = Build.VERSION_CODES.O) private void turnOnHotspot(){ WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); manager.startLocalOnlyHotspot(new WifiManager.LocalOnlyHotspotCallback(){ @Override public void onStarted(WifiManager.LocalOnlyHotspotReservation reservation) { super.onStarted(reservation); Log.d(TAG, "Wifi Hotspot is on now"); } @Override public void

Notification.Builder(context) deprecated Android O [duplicate]

醉酒当歌 提交于 2019-12-04 15:25:55
问题 This question already has answers here : NotificationCompat.Builder deprecated in Android O (9 answers) Closed 2 years ago . Notification.Builder(context) has been deprecated recently with the venue of Notification Channels in Android O. PROBLEM: After using Notification.Builder(context, StringID) instead of Notification.Builder(context) I did receive a notification to my Android O device. However, after trying that on an Android 23 (M), I did not receive a notification. I debugged my code

app launcher icon changed to default icon on Oreo

孤人 提交于 2019-12-04 12:51:18
问题 I have created an Android app with its own launcher icon. It worked well with Nougat. But with Oreo, my icon is replaced by the default Android icon. I have defined ic_launcher.png and ic_launcher_round.png in the mipmap resources for several densities. My manifest contains the following line: android:roundIcon="@mipmap/ic_launcher_round" What should I do to make my own icon appear on Oreo ? 回答1: For API 26+ default Android application template defines another icon resource folder mipmap

Issue Moving from IntentService to JobIntentService for Android O

荒凉一梦 提交于 2019-12-04 12:44:28
I am using Intent Service to monitor Geofence transition. For that I am using following call from a Sticky Service. LocationServices.GeofencingApi.addGeofences( mGoogleApiClient, getGeofencingRequest(), getGeofencePendingIntent() ) and the Pending Intent calls Transition service (an IntentService) like below. private PendingIntent getGeofencePendingIntent() { Intent intent = new Intent(this, GeofenceTransitionsIntentService.class); // We use FLAG_UPDATE_CURRENT so that we get the //same pending intent back when calling addgeoFences() return PendingIntent.getService(this, 0, intent,

Android Oreo: what should I do to publish my app as an Autofill service provider?

北城以北 提交于 2019-12-04 11:51:37
I'm an independent developer of a password manager app. What should I do, or what should I implement (interface/API/Service), to make my app an Autofill service provider (in a device with Android Oreo API >= 26)? I have read all kinds of related documentation, but I can't understand how to do this. Am I missing something? At the moment I see that only well-known password managers support this feature: Any hints are welcome. As usual, Google's own examples repository provides a good starting point for learning the Autofill Framework's API, and covers much more material than I can fit into an

android.graphics.drawable.AdaptiveIconDrawable cannot be cast to android.graphics.drawable.BitmapDrawable error

僤鯓⒐⒋嵵緔 提交于 2019-12-04 11:17:29
I'm getting this error when trying to implement Adaptive Icons while my app crashes on startup. I can't imagine why I'm getting this error because in the files mentioned in the error log below ( MainActivity and BaseActivity ), I don't use both AdaptiveIconDrawable and BitmapDrawable . 2018-04-28 16:50:17.014 31282-31282/de.markustippner.wondermusic2 E/AndroidRuntime: FATAL EXCEPTION: main Process: de.markustippner.wondermusic2, PID: 31282 java.lang.RuntimeException: Unable to start activity ComponentInfo{de.markustippner.wondermusic2/de.markustippner.wondermusic2.activities.MainActivity}:

android sms verification without READ_SMS permission

醉酒当歌 提交于 2019-12-04 10:07:41
I know that with Android O, now we can read SMS verification without requiring READ_SMS permission. It could be done using createAppSpecificSmsToken API. But I need a complete example to demonstrate whole of SMS verification routine. There is not much to it. Call createAppSpecificSmsToken() on SmsManager , supplying a PendingIntent . You get a String back which is the token. If the device receives an SMS with that token, your PendingIntent is run, triggering whatever component you specified. /*** Copyright (c) 2017 CommonsWare, LLC Licensed under the Apache License, Version 2.0 (the "License")

RTL layout bug in android Oreo

浪子不回头ぞ 提交于 2019-12-04 09:56:58
问题 Ever since I upgraded to android oreo on mobile my RTL support for application is not working. it's changing the strings to Arabic but not changing layout direction. but if I run same RTL shift to any of device lower than oreo, everything works fine. anyone else experienced this issue? is there any official statement yet about this bug and workaround? Below is my method to change the locale public static boolean setDefaultLocale(Context context) { Resources resources = context.getResources();

Unity game started crashing on android 8

亡梦爱人 提交于 2019-12-04 09:39:49
问题 Got following stacktrace from Android Vitals: java.lang.Error: FATAL EXCEPTION [main] Unity version : 5.6.2f1 Device model : samsung SM-G955F Device fingerprint: samsung/dream2ltexx/dream2lte:8.0.0/*****/***********B7:user/release-keys Caused by at bitter.jnibridge.JNIBridge.invoke (Native Method) at bitter.jnibridge.JNIBridge$a.invoke (Unknown Source:20) at java.lang.reflect.Proxy.invoke (Proxy.java:913) at $Proxy1.onBindingDied (Unknown Source) at android.app.LoadedApk$ServiceDispatcher

Not allowed to start service Intent - Android Oreo

痴心易碎 提交于 2019-12-04 09:04:01
I am currently using the startWakefulService function which is crashing in Oreo. I realise I either have to switch to startForegroundService() and use a foreground service, or switch to JobIntentService but based on my code below I am not sure what to do. (Sorry I am an android novice). Any points in the right direction will be greatly appreciated. public class GcmBroadcastReceiver extends WakefulBroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // Explicitly specify that GCMIntentService will handle the intent. ComponentName comp = new ComponentName(context