Install ffmpeg
brew install ffmpeg
Download file through url, like this:
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
import android.service.dreams.DreamService | |
import androidx.annotation.CallSuper | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.platform.ComposeView | |
import androidx.compose.ui.platform.ViewCompositionStrategy | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleRegistry | |
import androidx.lifecycle.ViewModelStore | |
import androidx.lifecycle.ViewModelStoreOwner | |
import androidx.lifecycle.setViewTreeLifecycleOwner |
class LocationActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
// Listen to one flow in a lifecycle-aware manner using flowWithLifecycle | |
lifecycleScope.launch { | |
locationProvider.locationFlow() | |
.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED) | |
.collect { | |
// New location! Update the map |
Install ffmpeg
brew install ffmpeg
Download file through url, like this:
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
#!/bin/sh | |
# Author : Wang Poh Peng | |
# Description : Use FFMPEG to download videos into mkv or mp4 format | |
RED='\033[1;31m' | |
NC='\033[0m' # No Color | |
GREEN='\033[0;32m' | |
CYAN='\033[0;36m' |
<templateSet group="AndroidLogKotlin"> | |
<template name="logm" value="android.util.Log.d(TAG, $FORMAT$)" description="Log method name and its arguments" toReformat="true" toShortenFQNames="true"> | |
<variable name="FORMAT" expression="groovyScript("def params = _2.collect {it + ' = [$' + it + ']'}.join(', '); return '\"' + _1 + '() called' + (params.empty ? '' : ' with: ' + params) + '\"'", kotlinFunctionName(), functionParameters())" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="KOTLIN_STATEMENT" value="true" /> | |
</context> | |
</template> | |
<template name="logd" value="android.util.Log.d(TAG, "$METHOD_NAME$: $content$")" description="Log.d(String)" toReformat="true" toShortenFQNames="true"> | |
<variable name="METHOD_NAME" expression="kotlinFunctionName()" defaultValue="" alwaysStopAt="false" /> | |
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" /> |
package com.aidanvii.extensions | |
import android.util.SparseArray | |
import java.util.* | |
val SparseArray<*>.max: Int get () = size() - 1; | |
inline fun <V> SparseArray<V>.forEachValue(action: (V) -> Unit): SparseArray<V> { | |
for (index in 0..max) { | |
val key = keyAt(index) |
https://stackoverflow.com/a/18003462/348146
None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:
Determine the package name of the app, e.g.
com.example.someapp
. Skip this step if you already know the package name.
adb shell pm list packages
Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.TransitionDrawable; | |
import android.support.annotation.DrawableRes; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.view.animation.AlphaAnimation; |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |