android

Why do Kotlin files appear as .java is Fabric Crashlytics with Proguard enabled?

耗尽温柔 提交于 2021-02-18 22:04:19
问题 I have recently turned on Proguard minimisation for an Android app which uses Crashylics reporting on the Fabric console. The project is written mainly in Kotlin. Crash reports are still received. The stack trace no longer lists Kotlin source files as .kt though, but as .java eg, MyFragment.java:20 instead of MyFragment.kt:20 From the information in the traces, such as function and variable names, the line numbers in the stack match up to those in the .kt file I have Proguard exclusions as

Sending base64 encoded image to server using HttpUrlConnection Android

。_饼干妹妹 提交于 2021-02-18 22:01:51
问题 I'm trying to send base64 encoded images to a server using HttpUrlConnection. The problem I'm having is that most images gets sent successfully, however some generate a FileNotFound exception. My code for encoding the image can be found below. public static String encodeImage(Bitmap thumbnail) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); String imageEncoded = Base64.encodeToString(b,Base64

Sending base64 encoded image to server using HttpUrlConnection Android

我的未来我决定 提交于 2021-02-18 21:59:58
问题 I'm trying to send base64 encoded images to a server using HttpUrlConnection. The problem I'm having is that most images gets sent successfully, however some generate a FileNotFound exception. My code for encoding the image can be found below. public static String encodeImage(Bitmap thumbnail) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); String imageEncoded = Base64.encodeToString(b,Base64

Duplicate object types in Apollo GraphQL for Android

情到浓时终转凉″ 提交于 2021-02-18 21:58:50
问题 On my project GraphQL schema the object AllowedPeriod (it's just two fields startsAt/endsAt) can arrive inside different objects of the graph. When generating queries, apollo is creating a new type for every <parent_object>.AllowedPeriod For example, in the GetDevicesQuery , the AllowedPeriod can be inside devices , actions or group , hence generating the following classes. GetDevicesQuery.AllowedPeriod GetDevicesQuery.AllowedPeriod1 GetDevicesQuery.AllowedPeriod2 Is there a way to tell

Sending base64 encoded image to server using HttpUrlConnection Android

自古美人都是妖i 提交于 2021-02-18 21:58:30
问题 I'm trying to send base64 encoded images to a server using HttpUrlConnection. The problem I'm having is that most images gets sent successfully, however some generate a FileNotFound exception. My code for encoding the image can be found below. public static String encodeImage(Bitmap thumbnail) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); thumbnail.compress(Bitmap.CompressFormat.JPEG, 100, baos); byte[] b = baos.toByteArray(); String imageEncoded = Base64.encodeToString(b,Base64

What's the proper way to setup an Android PreferenceFragment?

你离开我真会死。 提交于 2021-02-18 21:58:24
问题 I'm trying to implement a basic settings activity in an Android app and either get a blank white screen or a crash. The documentation and samples I've seen aren't helping because they're either old or inconsistent. For example, depending on where you look, the settings activity should either extend Activity, PreferenceActivity, or AppCompatPreferenceActivity (part of the File>New>Activity>Settings Activity). developer.android.com says you should implement the following: public class

Android - No getEditText method in EditTextPreference with Preference Support Library

[亡魂溺海] 提交于 2021-02-18 21:54:12
问题 I've just had to change to using PreferenceFragmentCompat for implementation of permissions checking which means using the support version of EditTextPreference. Unfortunately it seems getEditText is missing. Is there any work around? Update Found this issue logged. Seems it's deliberately been removed but the answer doesn't explain how to implement what I want to do. The code I was using is as follows final EditText editTextTL; editTextTL = ((EditTextPreference) findPreference("my_preference

RecyclerView behavior - Goes empty when keyboard is opened/closed

给你一囗甜甜゛ 提交于 2021-02-18 21:53:32
问题 I have implemented a RecyclerView with SearchView and Filterable ; all classes from v7 . Now there is this behavior that is annoying. Whenever the keyboard is brought up or closed the contents of the RecyclerView goes blank. The count is still correct but the view is empty. My guess, it has something to do with the Layout size change. Is this behavior normal or something is wrong? How to deal with it? I can show the code but don't quite know which part will be relevant so tell me what can I

Android - No getEditText method in EditTextPreference with Preference Support Library

自古美人都是妖i 提交于 2021-02-18 21:53:29
问题 I've just had to change to using PreferenceFragmentCompat for implementation of permissions checking which means using the support version of EditTextPreference. Unfortunately it seems getEditText is missing. Is there any work around? Update Found this issue logged. Seems it's deliberately been removed but the answer doesn't explain how to implement what I want to do. The code I was using is as follows final EditText editTextTL; editTextTL = ((EditTextPreference) findPreference("my_preference

Android 9 WebView (also admob ads) not loading after Chrome update

荒凉一梦 提交于 2021-02-18 21:11:58
问题 We have an application that depends heavily on web views we noticed after last week that if an android 9 user spent some time loading webviews about 10 to 30 after that webviews just show blank page and loading progress gets stock at 10% Also admobe native ads stop showing the only thing changed was chrome update to 77.0.3865.73 we tested on android 9 that has not updated to that version everything works perfectly ( chrome 74.0.3729.136) when debugging the only message I get is : E/chromium: