Android library for accessing device call logs

Overview

Call Logs - Android library for accessing device call logs

Android Arsenal

Image of the library in action

Installation

Step 1. Add the JitPack repository to your root build.gradle file.

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
	}
}

Step 2. Add the library dependency to your app build.gradle file

dependencies {
        implementation 'com.github.wickerlabs:CallLogs:1+@aar'
}

Step 3. Handle permissions (For API 23+)

For those targeting API 23+, 
you should handle the runtime permissions for READ_CONTACTS and READ_CALL_LOG. 
As a reference, check  out the sample app in the repository. 
Other than that, permissions are automatically added to the manifest file.

Usage

  • Initialization

    LogsManager logsManager = new LogsManager(context);
  • Getting a list of call logs

    List<LogObject> callLogs = logsManager.getLogs(type);
  • Available list types :

    LogsManager.INCOMING_CALLS: for getting the list (LogObject) of all the incoming calls.

    LogsManager.OUTGOING_CALLS: for getting the list (LogObject) of all the incoming calls.

    LogsManager.MISSED_CALLS: for getting the list (LogObject) of all the incoming calls.

    LogsManager.ALL_CALLS: for getting the list (LogObject) of all the calls.

  • Getting call durations

logsManager.getIncomingDuration(): returns the number of seconds for all the incoming calls made.

logsManager.getOutgoingDuration(): returns the number of seconds for all the outgoing calls made.

logsManager.getTotalDuration(): returns the number of seconds for all the calls made.

logsManager.getCoolDuration(type): returns a String in the form of "x hrs xx mins" or "xx mins xx secs"

  • Available duration types :

    LogsManager.INCOMING: for getting duration for all the incoming calls.

    LogsManager.OUTGOING: for getting duration for all the incoming calls.

    LogsManager.TOTAL: for getting duration for all the calls.

Using LogObjects

  • Some useful methods

logObject.getDuration(): returns an int of the seconds used for that particular call.

logObject.getNumber(): returns a String of the number associated with the call made.

logObject.getContactName(): returns a String of the contact name for the number in the log, if not found, it returns the number.

logObject.getType(): returns an int for the type of the call log.

logObject.getCoolDuration(): returns a String in the form of "x hrs xx mins" or "xx mins xx secs" based on the duration.

Examples

  • Retriving a list of all call logs:

     ListView logList = (ListView) findViewById(R.id.LogsList);
     LogsManager logsManager = new LogsManager(this);
     List<LogObject> callLogs = logsManager.getLogs(LogsManager.ALL_CALLS);
     LogsAdapter logsAdapter = new LogsAdapter(this, R.layout.log_layout, callLogs);
     logList.setAdapter(logsAdapter);

be sure to check out the sample app in the repository.

Acknowledgements

Icons made by madebyoliver from www.flaticon.com

You might also like...
Android library which makes it  easy to handle the different obstacles while calling an API (Web Service) in Android App.
Android library which makes it easy to handle the different obstacles while calling an API (Web Service) in Android App.

API Calling Flow API Calling Flow is a Android library which can help you to simplify handling different conditions while calling an API (Web Service)

Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

Android Utilities Library build in kotlin Provide user 100 of pre defined method to create advanced native android app.

A robust native library loader for Android.
A robust native library loader for Android.

ReLinker A robust native library loader for Android. More information can be found in our blog post Min SDK: 9 JavaDoc Overview The Android PackageMan

Joda-Time library with Android specialization

joda-time-android This library is a version of Joda-Time built with Android in mind. Why Joda-Time? Android has built-in date and time handling - why

UPnP/DLNA library for Java and Android

Cling EOL: This project is no longer actively maintained, code may be outdated. If you are interested in maintaining and developing this project, comm

Android library for viewing, editing and sharing in app databases.
Android library for viewing, editing and sharing in app databases.

DbInspector DbInspector provides a simple way to view the contents of the in-app database for debugging purposes. There is no need to pull the databas

Android Market In-app Billing Library

Update In-app Billing v2 API is deprecated and will be shut down in January 2015. This library was developed for v2 a long time ago. If your app is st

Android library to easily serialize and cache your objects to disk using key/value pairs.

Deprecated This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to

Form Validator Library for Android

Android-Validator Form Validator Library for Android [](https://flattr.com/submit/auto?user_id=throrin19&url=https://github.com/throrin19/Android-Vali

Comments
  • Error about illegal character: '\u200b'

    Error about illegal character: '\u200b'

    It error when I call this line

    Code List<LogObject> callLogs = logsManager.getLogs(LogsManager.ALL_CALLS);

    Error `Error:(55, 63) error: illegal character: '\u200b' Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.`

    Can you let me how to fix this issue?

    Thanks

    opened by PitipongXYZ 1
Releases(1.09)
Owner
Wickerlabs International
Innovation meets Experience. More fun on GitLab 😊
Wickerlabs International
Create a simple and more understandable Android logs.

DebugLog Create a simple and more understandable Android logs. #Why? android.util.Log is the most usable library of the Android. But, when the app rel

mf 418 Nov 25, 2022
Convert OkHttp requests into curl logs.

Ok2Curl Convert OkHttp requests into curl logs. Usage Add library to project dependencies. Library is hosted on jcenter. repositories { jcenter()

Michal Moczulski 373 Jan 1, 2023
:iphone: [Android Library] Get device information in a super easy way.

EasyDeviceInfo Android library to get device information in a super easy way. The library is built for simplicity and approachability. It not only eli

Nishant Srivastava 1.7k Dec 22, 2022
An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt

Motion An Android library allowing images to exhibit a parallax effect. By replacing static pictures and backgrounds with a fluid images that reacts t

Nathan VanBenschoten 781 Nov 11, 2022
Android library for checking the internet connectivity of a device.

ConnectionChecker Android library for checking the internet connectivity of a device. Used in https://play.google.com/store/apps/details?id=com.muddas

Muddassir Ahmed Khan 34 Dec 24, 2022
Use Android as Rubber Ducky against another Android device

Use Android as Rubber Ducky against another Android device

null 1.4k Jan 9, 2023
Android device shake detection.

Seismic Android device shake detection. Download Download the latest .jar or depend via Maven: <dependency> <groupId>com.squareup</groupId> <artif

Square 1.2k Dec 27, 2022
A small utility to record Android device screen to a GIF

RoboGif A small utility to record Android device screen to an optimized GIF so you can paste it to GitHub or a similar service. Requirements Python 2.

Jernej Virag 526 Dec 9, 2022
adds an option to the Android Sharesheet that allows you to save files to your device.

Save On Device adds an option to the Android Sharesheet that allows you to save files to your device. Download Get the app from the Google Play Store

null 24 Nov 29, 2022
Android tiny device flow client

OAuth 2.0 Device Flow Example Setup Create an Auth0 application Enable Device Code Grants in Advanced settings Disable Client Credentials Enable Devic

Kenji Saito 0 May 15, 2022