adr_playground's Introduction
adr_playground's People
adr_playground's Issues
Wifi and Mobile Data - Toggled on but wifi is locked behind password
Use case to alert user from avoiding large downloads over mobile data.
Eg: Wifi connected to Hotel (not yet authenticated with password), mobile data on.
Android 12: activity restart on changing phone wallpaper
onStop is called when lock screen is activate
it's wrong to use onStop
to detect user tapping home button / changing to other apps ๐
READ_BASIC_PHONE_STATE - non dangerous permission
With Android 13 comes READ_BASIC_PHONE_STATE which returns only some data like system version or network type to which it is connected, therefore being a less dangerous permission than the previous one.
let's check if it can be used to detect phone call
https://developer.android.com/reference/android/Manifest.permission.html#READ_BASIC_PHONE_STATE
FGS + wakelock issue
https://developer.android.com/training/scheduling/wakelock
(Foreground service + Wake Lock + Letting user whitelist your app seems the only solid option if your app targets Chinese market).
Need to acquire a wake lock if you want your service keep running after the screen is off.
But from my testing, 15min+ is still good on Samsung. However, Seems FGS alone is not enough to keep app alive in bg :)
Android 13 FGS notification is swipeable unless setOngoing(true)
Starting in Android 13 (API level 33), users can dismiss the notification associated with a foreground service by default.
If you would like the notification to be non-dismissable by the user, pass true into the setOngoing() method when you create your notification using Notification.Builder.
https://stackoverflow.com/a/75026688/8621574
return NotificationCompat.Builder(this, MY_FOREGROUND_CHANNEL_ID)
setContentTitle("Title")
.setContentText("Text")
.setGroup("abccccc") // Prevent the FGS notification from being lumped in together in same group with others
.setContentIntent(pendingIntent)
.setSmallIcon(com.flamyoad.styles.R.drawable.ic_notification_2)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setOngoing(true) // Starting in Android 13 (API level 33), users can dismiss the notification associated with a foreground service by default.
.build()
}
Does an empty foreground service keep an android app alive?
If an app has foreground service that depends on a RX stream that has lifecycle in @ApplicationScope
(it's inside Application
class)
If app is swiped up, foreground service will keep running, but is the app still running????
Any chance that closing the application manually will leave only the service running???
Context is the foreground service is broken if the @ApplicationScope
stream is terminated.
It should be yes but We can't be too sure of it nowadays. Please check by running code on android 12 / 13
CustomTarget height & width actually downscales image @@ !!!
// need to worry about transparency, !#!@#!@#!!#!@#!@#
Glide.with(context)
.asDrawable()
.centerInside()
.load(imageUrl)
.into(object: CustomTarget<Drawable>(32, 32) {
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>?) {
}
override fun onLoadCleared(placeholder: Drawable?) {
// no-op
}
})
fuck
Original image: https://w7.pngwing.com/pngs/941/692/png-transparent-black-small-apple-logo-logo-material-apple-logo-black-thumbnail.png
android:stopWithTask="true" doesn't seem to work with 2nd FGS if 1st FGS is present
- activate first FGS
- activate 2nd FGS with
android:stopWithTask="true"
- swipe up app in Recents
- 2nd FGS is still there
it shouldnt be possible
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.