• Breaking News

    [Android][timeline][#f39c12]

    Thursday, November 4, 2021

    Android 12 Is Killing Phantom Background Processes Of Apps Android Dev

    Android 12 Is Killing Phantom Background Processes Of Apps Android Dev


    Android 12 Is Killing Phantom Background Processes Of Apps

    Posted: 04 Nov 2021 12:46 PM PDT

    Phantom Processes

    Android 12 via 15755084 and updated via 5706277f has added the mechanism to monitor forked child processes started by apps and kills them if more than the default 32 are found running.

    The app or phantom processes may also be killed if they use excessive CPU, which was done previously too, but only for app process.

    Track the child processes that are forked by app processes

    Apps could use Runtime.exec() to spawn child process and framework will have no idea about its lifecycle. Now track those processes whenever we find them - currently during the cpu stats sampling they could be spotted. If it's consuming too much CPU while its parent app process are also in the background, kill it.

    By default we allow up to 32 such processes; the process with the worst oom adj score of their parents will be killed if there are too many of them.

    This 32 process limit is for all apps combined and not per app.

    Check PhantomProcessList commit history here.

    This change is neither listed in android 12 changes list nor behavior changes and was done silently.

    They were named "Phantom" because they were designed to give android devs nightmares when then saw them (allegedly of course).

    The termux/termux-app#2366 issue was opened in which this was found out and I have added detailed info about it at https://github.com/termux/termux-app/issues/2366#issuecomment-961305970 and a way to disable it.

    Which apps will this affect?

    This will majorly affect all apps that fork child processes from their app process, like with Runtime.exec() or in JNI.

    For Termux app, this killing will affect all commands runs in the shell, which is basically everything the app does and other plugins are designed around.

    For Tasker, this will affect Run Shell, Adb Wifi and some other actions that run shell commands internally, and also the Logcat Entry event profile.

    Expect such processes to be killed at any time if using Android 12.

    This type of killing is seemingly worse than the ones commonly implemented before by OEM killer apps, which are usually tracked by https://dontkillmyapp.com.

    submitted by /u/agnostic-apollo
    [link] [comments]

    Android ecosystem is plagued by bugs created by Google

    Posted: 04 Nov 2021 02:31 AM PDT

    For more than a year or so, Android developers with growing resentment observed an onslaught of multiple bugs in such popular SDKs as Admob and Firebase. Those bugs cause spikes in what is called ANR (application not responding) type of crashes. They're caused by issues in the SDKs themselves, and because of that developers have no means to reduce impact. In a few cases which I personally faced, responsible support teams simply ignore bugs and do nothing about them. Some of them have already existed for 2+ years with no fix on the horizon.

    On the other hand, Google Play ranking algorithm is very harsh towards apps that exhibit ANRs. Even the smallest spike in ANR rate dramatically reduces an app's visibility, performance, and as a result - revenue. So we have a situation, where Google punishes developers for the bugs that Google has created.

    This post is an attempt to bring attention to this topic since we already tried everything else.

    There are some links to related bugs, and support topics discussion.

    https://github.com/firebase/firebase-android-sdk/issues/2387

    https://github.com/googleads/googleads-mobile-unity/issues/1825

    https://groups.google.com/g/google-admob-ads-sdk/c/eabu4XtJLzo

    submitted by /u/22eu
    [link] [comments]

    Looking for a project with tests. Lots of tests.

    Posted: 04 Nov 2021 02:17 PM PDT

    I have seen tons of projects, samples, libraries, apps with different design patterns like MVVM, MVI, MVP, with clean architecture, with cutting-edge android libraries, with compose, and so on. But I haven't seen any of them with tests. Unit tests on all layers. Datasources (network clients, databases), repositories, viewmodels. And if some of those projects have unit tests, these are mostly very basic tests. Not even say about UI tests. These are like an utopia for Android projects.

    So let me see what you have to share.

    submitted by /u/gts-13
    [link] [comments]

    Retrofit/OkHttp cache control

    Posted: 04 Nov 2021 10:54 AM PDT

    1. I don't ever remember seeing any cache control header in mobile clients. What are some use cases where you need this header?

    2. What is the default cache control for retrofit and okhttp? no-cache?

    3. Usually you would cache using your own repository layer logic into memory or DB, what use case mobile would need caching at okhttp retrofit level?

    4. One case might be for image loading. Client have no idea if an image has changed or not, so cache control header might help. But usually recommended practice for such http resources is to use different file name once image has changed. In that sense, you don't need cache control either.

    submitted by /u/ynkm1692
    [link] [comments]

    At a BLE / Android "learning" crossroads.

    Posted: 04 Nov 2021 04:18 PM PDT

    My BLE device is programmed to send one byte of data when I want it to, and I want it to trigger my Android phone to do something, given byte 00 or byte 01. (For example, to turn on and off my flashlight, or prompt a beep)

    I need to dig into smartphone development now but I found that there are several options to choose from.

    I only have patience for one learning path. Simpler is better, but it needs to be one of the industry standard solutions for my purpose. I thought of two so far:

    1. nRF Connect. It's what I have now and I used it extensively to troubleshoot my Nano33BLESense when it communicates via BLE. But is it a good (or bad) starting place for development? Cursory research led me to thinking that it's quite complex, and might need me to begin learning Zephyr as well. (sounds daunting)
    2. Android Studio. Working with Kotlin sounds good to me. Learning Kotlin is similar to learning Java, which I've wanted to learn. This would be working with a new toolchain for me, though, but it seems much simpler than nRF Connect's SDK, by comparing them from the vids and documentation I've seen. I'm leaning this way, but I haven't learned enough about it.
    3. Something I've not heard of yet.

    What can I develop so that my BLE device will turn on my Android's flashlight?

    Which is best out of options 1 and 2, or can you tell me something I've not thought of?

    crosspost: androiddev, arduino ble

    View Poll

    submitted by /u/aimeeai
    [link] [comments]

    I made a very simple XKCD app

    Posted: 03 Nov 2021 09:58 PM PDT

    I made a very simple XKCD app

    I am a hobbyist, with no formal training and with no intention of going pro. I code (poorly) for myself, just for fun. A few months ago, I decided to get into Android development by choosing a simple project first and then learning new concepts and ideas on the way.

    Here's what I made so far: https://github.com/nskHimel/XKCDViewer/tree/master

    Made my app using Kotlin and Jetpack Compose.

    It's pretty rudimentary, and probably poorly coded, but I am pretty happy with my progress. I'd love to hear your comments and ideas on this.

    Note: I tried to limit my use of external libraries, so that I can learn how to do basic stuff myself. I should have used Glide to download the images, for instance. I do plan on learning Glide and other libraries in the future.

    Here's how my app looks:

    https://i.redd.it/6um7sc0nmjx71.gif

    submitted by /u/PlusUltraBeyond
    [link] [comments]

    Dagger 2 - component dependency - nullify dependencies

    Posted: 04 Nov 2021 02:13 PM PDT

    Components have different life span.

    What happens when you specify a dependency: A depends on B, but you destroy B while A is still alive?

    1. If the behaviour is crashing then anyway to safeguard this?

    2. On the other hand, sub component will never have this issue since parent component always outlive sub component, is this assumption right?

    submitted by /u/ynkm1692
    [link] [comments]

    Any way to disable the list view/recycler views ending swipe/expanding animation on android 12?

    Posted: 04 Nov 2021 01:29 PM PDT

    When you hit the end of a list, you get it where the list will do this expand animation when you swipe up making the entire list look weird and it just doesn't look right. Anyone know a fix/option or something in code to remove it?

    submitted by /u/slai47
    [link] [comments]

    Jetpack Compose: Modifiers fundamentals

    Posted: 04 Nov 2021 12:10 AM PDT

    Cédric Champeau's blog: Multi-repository development made easy

    Posted: 04 Nov 2021 11:45 AM PDT

    Why did Android Application start 1 to 3 times on a single launch?

    Posted: 04 Nov 2021 06:13 AM PDT

    I have a simple code as below

    class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) MainApplication.something++ Log.d("Tracking", "onCreate ${MainApplication.something}") setContentView(R.layout.activity_main) } } class MainApplication: Application() { companion object { var something = 0 } override fun onCreate() { super.onCreate() Log.d("Tracking", "Application onCreate $something") } } 

    I get the below log

    2021-11-04 23:55:31.409 7810-7810/com.example.empty D/Tracking: Application onCreate 0 2021-11-04 23:55:31.445 7810-7810/com.example.empty D/Tracking: onCreate 1 2021-11-04 23:55:31.409 7810-7810/com.example.empty D/Tracking: Application onCreate 0 2021-11-04 23:55:31.445 7810-7810/com.example.empty D/Tracking: onCreate 1 2021-11-04 23:55:31.445 7810-7810/com.example.empty D/Tracking: onCreate 1 

    Why Application can start multiple times on a single launch?

    I have a little investigation with more detail here https://stackoverflow.com/questions/69839732/why-did-android-application-start-3-times-on-single-launch

    Thanks.

    submitted by /u/ElyeProj
    [link] [comments]

    App update stuck in review

    Posted: 04 Nov 2021 03:46 AM PDT

    We uploaded an update for our Android app to the Play Store almost 2 days ago. Since then it is "in review". Usually our updates make it through review in a few hours. Is anyone experiencing the same issue?

    submitted by /u/Galahad-Threepwood
    [link] [comments]

    Google Play Console - app not getting reviewed

    Posted: 04 Nov 2021 06:42 AM PDT

    Hi,

    I have uploaded an app with my newly created developer account on october, 14th and it has not been reviewed by google since then, so almost 3 weeks.
    Is it normal ? What can I do ? I can't find any place where I can contact Google about it.
    Thank you.

    p.s : I have another developer account where I had uploaded the Alpha version of the same app and it took only a few days, but maybe there is a conflict between the 2 developer accounts (with different emails but paid with the same credit card).

    submitted by /u/roubignolle
    [link] [comments]

    Introduce Kotlin coroutines and Flows to the callback-based Java client

    Posted: 04 Nov 2021 02:51 AM PDT

    How to make Request to get the serial number of Android device in Android 10+ ? (unity)

    Posted: 04 Nov 2021 06:28 AM PDT

    Hello,
    In android 8- the getting of serial number of the android device was easy and don't need to make access but in android 10+ we should make request to the user to take the permission to do that .
    Does anyone knows how to request this permission?
    Thanks.

    submitted by /u/AndrewGamal96
    [link] [comments]

    How to make Request to get the serial number of Android device in Android 10+ ? (unity)

    Posted: 04 Nov 2021 05:31 AM PDT

    Hello,
    In android 8- the getting of serial number of the android device was easy and don't need to make access but in android 10+ we should make request to the user to take the permission to do that .
    Does anyone knows how to request this permission?
    Thanks.

    submitted by /u/AndrewGamal96
    [link] [comments]

    Best ways to (indirectly) direct users to a web payment platform?

    Posted: 04 Nov 2021 02:19 AM PDT

    I would like to ask opinions & resources for best practices on directing mobile app users to a web payment platform, without deteriorating the funnel and the UX. Any insight would be appreciated.

    Details:

    Our mobile app has cross-platform access across Android, iOS, Windows and Mac (desktop versions recently launched). Users can only get cross-platform access if they make a purchase from the web payment platform. I'm looking for an optimal workaround: both UX and CR-wise.

    submitted by /u/erin_hammett
    [link] [comments]

    Question: Is there any documentation with available api for specific android version

    Posted: 04 Nov 2021 01:43 AM PDT

    In apple world you have page like this: Technologies where you can see all API which you can use in ios, macos and so on. Plus there is page for swift about basic library telling you what can you use. For android i'm looking for something like this. But I found only Reference which for me looks like few class for google play interaction.

    And for kotlin/java is there something telling me which packages I can use in my app ?

    Thanks for clarification

    submitted by /u/brut4r
    [link] [comments]

    Hey Android Developers, Do you believe Windows 11 is here for rescue to give you a faster build time? In this video I did a benchmark testing how your Android app build time changes on Windows 11.

    Posted: 04 Nov 2021 12:24 AM PDT

    Can anyone explain to me the way of showing data from SQL database in a mobile app securely?

    Posted: 03 Nov 2021 04:19 PM PDT

    Hello. Noob here, I'm starting to learn mobile development. After I complete courses and learn Kotlin I want to do the following, but I simply don't understand the way of doing it from the beginning to the end.

    I have a SQL Database, running on a Windows Server and I can access it via ODBC within the same network. I want to show customers, articles, invoices, etc. from that database in my mobile app, but it must be secure so others can't access the data in any way. How do I do that?

    Do I need a backend/server-side app that gets data via odbc on that server from the database and then afterwards I have to connect my mobile app to that backend to access data? If so, which backend do I need for example? How do I make it secure?

    Afterwards I would want to make some changes within the app (change customers address for example) and change the data in the database too.

    Sorry, it may sound dumb but since this is completely new for me, I don't understand how could I do that.

    I've read about REST api but idk how it works with odbc, should it be written in python, php, node.js or something else. Do I need firebase, something else? If firebase, is that normally used by companies or do companies build the connection between phone and database without firebase?

    Thank you.

    submitted by /u/grabowashion
    [link] [comments]

    Help!? Google rejecting my app for uploading user contact list.

    Posted: 03 Nov 2021 09:02 PM PDT

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel