Skip to content

Instantly share code, notes, and snippets.

View anandrex5's full-sized avatar
🎯
Focusing

Anand Nishad anandrex5

🎯
Focusing
View GitHub Profile
@anandrex5
anandrex5 / Get Android phone call history.md
Created June 4, 2024 10:10 — forked from kannansuresh/Get Android phone call history.md
Get Android phone call history/log programmatically

Source: AndroidDev

To get call history programmatically first add read contact permission in Manifest file:

<uses-permission android:name="android.permission.READ_CONTACTS" />

Create xml file. Add the below code in xml file:

<Linearlayout android:layout_height="fill_parent"
@anandrex5
anandrex5 / BookListAdapter.kt
Created August 8, 2022 10:05
APi_RxJava_Retrofit_RecyclerView (API TYPE - QUERY)
package com.example.api_rxjava.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.example.api_rxjava.R
import com.example.api_rxjava.network.VolumeInfo
import kotlinx.android.synthetic.main.recycler_list_row.view.*
@anandrex5
anandrex5 / ApiClient.kt
Created July 28, 2022 12:47
Query Api Fetch using Adapter (Kotlin + Multiple Data Classes )
package com.example.exam3.application.network
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
object ApiClient {
val BASE_URL : String = " https://newsapi.org/"
@anandrex5
anandrex5 / AndroidManifest.xml
Last active July 28, 2022 20:52
Notification_FireBase (Generate Notification through FireBase)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.notification_firebase">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
@anandrex5
anandrex5 / GetAPI.kt
Created July 28, 2022 12:21 — forked from sudhirkrsingh/GetAPI.kt
APIWithRxJava
package com.mega.kotlinapp.postAPIKotlin.mvvvm.network
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
object GetAPI {
@anandrex5
anandrex5 / MainActivity.kt
Created July 27, 2022 12:59
Realtime_FireBase Data Insertion and Retrieve
package com.example.realtime_firebase
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import androidx.databinding.DataBindingUtil
import com.example.realtime_firebase.databinding.ActivityMainBinding
import com.google.firebase.database.*
@anandrex5
anandrex5 / MainActivity.kt
Created July 27, 2022 12:17
Realtime_FireBase Data Insertion (DATA BINDING)
package com.example.realtime_firebase
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import androidx.databinding.DataBindingUtil
import com.example.realtime_firebase.databinding.ActivityMainBinding
import com.google.firebase.database.DatabaseReference
@anandrex5
anandrex5 / MainActivity.kt
Created July 27, 2022 12:02
Realtime_FireBase Data Insertion
package com.example.realtime_firebase
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import com.example.realtime_firebase.databinding.ActivityMainBinding
import com.google.firebase.database.DatabaseReference
import com.google.firebase.database.FirebaseDatabase
@anandrex5
anandrex5 / ApiClient.kt
Last active June 29, 2023 07:58 — forked from ankitchauhan20/ApiClient.kt
Retrofit with MVVM (Get Api)
package com.example.application.network
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
object ApiClient {
val BASE_URL: String = "https://jsonplaceholder.typicode.com/"
var retrofit: Retrofit? = null
@anandrex5
anandrex5 / AndroidManifest.xml
Created July 25, 2022 13:07
Notification_Firebase Kotlin
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.notification_firebase">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"