Skip to content

Instantly share code, notes, and snippets.

View mo7amd89's full-sized avatar

Mohammed Imam mo7amd89

View GitHub Profile
@mo7amd89
mo7amd89 / play-auth-proguard-rules.pro
Created October 14, 2024 10:11 — forked from ChanSek/play-auth-proguard-rules.pro
ProGuard rules for Google Play Services (Authentication)
-keepclassmembers class com.google.android.gms.dynamite.DynamiteModule {
** MODULE_ID;
** MODULE_VERSION;
** sClassLoader;
}
-keepclassmembers class com.google.android.gms.internal.in {
** mOrigin;
** mCreationTimestamp;
** mName;
** mValue;

TAKE A PHOTO WITH CAMERA IN KOTLIN

SETTING

Step-1

Create provider_paths.xml in res/xml folder and write below code in it.

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
@mo7amd89
mo7amd89 / FlipCard.kt
Created April 21, 2024 13:04 — forked from ardakazanci/FlipCard.kt
Flip Card with Jetpack Compose
@Composable
fun FlipActionScreen() {
var flippedState by remember { mutableStateOf(false) }
val rotationY by animateFloatAsState(
targetValue = if (flippedState) 180f else 0f,
animationSpec = spring(
dampingRatio = Spring.DampingRatioHighBouncy,
stiffness = Spring.StiffnessVeryLow
)
)
@mo7amd89
mo7amd89 / ApiCall.kt
Created January 11, 2024 07:04
Handle api call Android kotlin
import kotlinx.coroutines.*
// this code snipped from Vengatesh M.’s Post https://www.linkedin.com/feed/update/urn:li:activity:7150818581406994432/
fun main() {
val viewmodel = ViewModel()
runBlocking {
viewmodel.getDataFromApi()
}
}
@mo7amd89
mo7amd89 / ApolloRequestHandler.kt
Created January 8, 2024 06:18 — forked from sahalnazar/ApolloRequestHandler.kt
GraphQL request handler helper class for Apollo Client in Kotlin
import com.apollographql.apollo3.ApolloClient
import com.apollographql.apollo3.api.ApolloResponse
import com.apollographql.apollo3.api.Mutation
import com.apollographql.apollo3.api.Operation
import com.apollographql.apollo3.api.Query
import com.apollographql.apollo3.exception.ApolloException
import timber.log.Timber
/**
* This class handles the execution of GraphQL queries and mutations using the Apollo client.
@mo7amd89
mo7amd89 / logo.md
Last active November 13, 2023 10:56

#ITS logo logo

@mo7amd89
mo7amd89 / UnsafeHttpClient.kt
Last active June 11, 2023 12:49 — forked from maiconhellmann/UnsafeOkHttpClient.kt
UnsafeHttpClient wrote in Kotlin
import okhttp3.OkHttpClient
import java.security.cert.CertificateException
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
class UnsafeOkHttpClient {
companion object {
fun getUnsafeOkHttpClient(): OkHttpClient.Builder {
try {
@mo7amd89
mo7amd89 / DownloadRequest.kt
Created February 25, 2023 12:43 — forked from PrashamTrivedi/DownloadRequest.kt
Download File with progress indicator, written in Kotlin with Co-routines
suspend fun downloadFile(url: String,
downloadFile: File,
downloadProgressFun: (bytesRead: Long, contentLength: Long, isDone: Boolean) -> Unit) {
async(CommonPool) {
val request = with(Request.Builder()) {
url(url)
}.build()
val client = with(OkHttpClient.Builder()) {
addNetworkInterceptor { chain ->
@mo7amd89
mo7amd89 / SaveLogcatApp.java
Created January 3, 2023 11:03
Saving Logcat to a text file in Android Device
public class MyPersonalApp extends Application {
/**
* Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created.
*/
public void onCreate() {
super.onCreate();
if ( isExternalStorageWritable() ) {
@mo7amd89
mo7amd89 / FileLogger.java
Created October 30, 2022 08:52
store Logs in a txt file using the android.util.log
import android.os.Environment;
import android.util.Log;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;