Skip to content

Instantly share code, notes, and snippets.

View AlaaEddinAlbarghoth's full-sized avatar
🔥
Focusing

Alaa Eddin Albarghoth AlaaEddinAlbarghoth

🔥
Focusing
View GitHub Profile
@AlaaEddinAlbarghoth
AlaaEddinAlbarghoth / FileUtils
Created December 1, 2022 16:35
FileUtils for Android, using Kotlin
@file:Suppress("TooManyFunctions", "ComplexMethod", "ComplexMethod", "ComplexMethod")
package com.tawrid.helper.coroutines.extensions
import android.content.ContentUris
import android.content.Context
import android.database.Cursor
import android.database.DatabaseUtils
import android.net.Uri
import android.os.Environment
@AlaaEddinAlbarghoth
AlaaEddinAlbarghoth / build.gradle
Last active October 29, 2022 19:17
Android Standard Dependencies
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-parcelize'
id 'dagger.hilt.android.plugin'
}
dependencies {
@AlaaEddinAlbarghoth
AlaaEddinAlbarghoth / DeviceInfo.kt
Created December 2, 2020 13:43
Get the Device serial number for all versions of android
fun getDeviceSerial(applicationContext: Context): String? {
var serialNumber: String?
try {
val c = Class.forName("android.os.SystemProperties")
val get = c.getMethod("get", String::class.java)
serialNumber = get.invoke(c, "gsm.sn1") as String
@AlaaEddinAlbarghoth
AlaaEddinAlbarghoth / ReactNative1.js
Created December 27, 2019 10:19
Simple, Components, View, Text, StatusBar, StyleSheet, ImageBackground, Dimensions,
// ES6 import statement, we import the entire react library to a variable called react
import React from 'react';
// When you use these new tags, instead of html tags, then when they rendered, they
// will rendered to native components on mobile platforms, and not a browser components like in React..
// View is the container, Text is like TextView
// App registry is important to register views in the screen
import {
View,
Text,
@AlaaEddinAlbarghoth
AlaaEddinAlbarghoth / Using Dexter for Permission in Android
Created May 23, 2019 10:26
Using Dexter for Permission in Android
In Manifest file:
<uses-permission android:name="android.permission.CAMERA"/>
In the build.gradle(Module):
/**
* dependency to request the runtime permissions.
*/
implementation "com.karumi:dexter:5.0.0"
In the Code:
@AlaaEddinAlbarghoth
AlaaEddinAlbarghoth / Enable ARCore.docx
Last active May 2, 2019 08:49
Enable ARCore, This page describes how to enable ARCore functionality in your Android Studio projects.
# First of all, add this libraries to the module gradle:
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.8.0'
implementation 'com.karumi:dexter:5.0.0'
# Second go to the Manifest and add this lines:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>
<application>