Skip to content

Instantly share code, notes, and snippets.

View monowar1993's full-sized avatar
🎯
Focusing

Mostafa Monowar monowar1993

🎯
Focusing
View GitHub Profile
@arifNislam
arifNislam / AppInfoActivity.kt
Last active October 15, 2018 14:09
Application information in multi-module android project
class AppInfoActivity : AppCompatActivity() {
private val tag = javaClass.simpleName
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Log.d(tag, "Application Id: ${applicationInfo.packageName}")
val packageInfo = packageManager.getPackageInfo(applicationInfo.packageName, 0)
Log.d(tag, "Version name: ${packageInfo.versionName}")
Log.d(tag, "Version code: ${packageInfo.versionCode}")
@vxhviet
vxhviet / getAllVideoPath.md
Last active September 13, 2020 19:26
Get all video's path on the device

Source: StackOverflow, StackOverflow

Question: How to get the path of all videos stored on device.

Answer:

private String[] getAllVideoPath(Context context) {
        Uri uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
        String[] projection = { MediaStore.Video.VideoColumns.DATA };
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21.
To use the support version of these attributes, remove the android namespace.
For instance, "android:colorControlNormal" becomes "colorControlNormal".
These attributes will be propagated to their corresponding attributes within the android namespace
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------