- Android Studio Flamingo | 2022.2.1
- Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
- Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
- Windows 11 (version 10.0.22000.1817)
interface CircularTimerListener { | |
fun updateDataOnTick(remainingTimeInMs: Long): String? | |
fun onTimerFinished() | |
} |
data class DownloadItem( | |
val bytesDownloadedSoFar: Long = -1, | |
val totalSizeBytes: Long = -1, | |
val status: Int, | |
val uri: String | |
) | |
class DownloadProgressLiveData(private val activity: Activity) : | |
LiveData<List<DownloadItem>>(), | |
CoroutineScope { |
package com.geothings.geobingan.ui | |
import android.animation.Animator | |
import android.animation.AnimatorListenerAdapter | |
import android.animation.ValueAnimator | |
import android.content.Context | |
import android.graphics.Color | |
import android.text.Spannable | |
import android.text.SpannableStringBuilder | |
import android.text.style.ForegroundColorSpan |
saveImageToPDF(layout, layout.getScreenShot(), fileName) | |
fun View.getScreenShot(): Bitmap { | |
val returnedBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) | |
val canvas = Canvas(returnedBitmap) | |
val bgDrawable = background | |
if (bgDrawable != null) bgDrawable.draw(canvas) | |
else canvas.drawColor(Color.WHITE) | |
draw(canvas) | |
return returnedBitmap |
If you want install application programmatically in Android 10, You need to give permission to install app for your application | |
============================================================================== | |
Steps 1: Give permission in Manifest | |
============================================================================== | |
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
============================================================================== | |
Step 2: Write provider in Android Manifest |
Android Drawable Preview | |
Android WiFiADB | |
ChroMATERIAL | |
Json To Kotlin Class | |
Kotlin Fill Class | |
MAD Scorecard | |
Material Design Icon Generator | |
Material Theme UI | |
Rainbow Brackets | |
Regex Rename Files |
https://lankydan.dev/ // nice tutorials | |
https://proandroiddev.com/ // nice tutorials | |
https://medium.com/androiddevelopers | |
https://androidweekly.net/ | |
https://mindorks.com/ | |
https://blog.stylingandroid.com/ === Best Reading | |
https://www.reddit.com/r/androiddev/ === Users | |
https://medium.com/androiddevelopers === Android Developers | |
https://www.uplabs.com/ === Designer resources | |
https://codelabs.developers.google.com/?cat=Android === Android Practice |
/** | |
* It took me AGES to figure this out, seriously, exoplayer documentation IS SO BAD. | |
*/ | |
package xxx | |
import android.net.Uri | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import com.cube.arc.R |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.os.Build | |
class BroadCastReceiver : BroadcastReceiver() { | |
override fun onReceive(context: Context, intent: Intent) | |
{ | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) | |
context.startForegroundService(Intent(context,LocationMonitoringService::class.java)) |