Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7753557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:05:10+00:00 2026-06-01T12:05:10+00:00

Is it possible to utilize the users phone through their cell provider, and track

  • 0

Is it possible to utilize the users phone through their cell provider, and track the length of a phone call?

So the user presses a button in the app “Call Now”. A call begins to a pre-determined number. We record the start time. When the call ends, we calculate how many minutes were used.

Possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:05:11+00:00Added an answer on June 1, 2026 at 12:05 pm

    To calculate time talked for both incoming , outgoing calls use the following broadcast receiver :

    public class CallDurationReceiver extends BroadcastReceiver {
    
        static boolean flag = false;
        static long start_time, end_time;
    
        @Override
        public void onReceive(Context arg0, Intent intent) {
            String action = intent.getAction();
            if (action.equalsIgnoreCase("android.intent.action.PHONE_STATE")) {
                if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(
                TelephonyManager.EXTRA_STATE_RINGING)) {
                    start_time = System.currentTimeMillis();
                }
                if (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(
                TelephonyManager.EXTRA_STATE_IDLE)) {
                    end_time = System.currentTimeMillis();
                    //Total time talked =
                    long total_time = end_time - start_time;
                    //Store total_time somewhere or pass it to an Activity using intent
                }
            }
        }
    

    Register your receiver in your manifest file like this:

     <receiver android:name=".CallDurationReceiver">
           <intent-filter>
               <action android:name="android.intent.action.PHONE_STATE" />
           </intent-filter>
        </receiver>
    

    Also add the uses permission:

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible utilize javascript in the making of windows desktop applications.I use borland
Possible Duplicate: PHP pagination class are there any PHP/Class libraries that i can utilize
Is it possible to utilize the 3.5 or 4.0 .NET framework with my InfoPath
Software Utilize : C#, VS-2005 Is This Possible to override Shift+Tab Function/Method or detect
Is it possible to write an external application that will utilize Grail's HSQLDB instance?
Possible Duplicate: How to retrieve the android sdk version? I'm developing an Android app
Possible Duplicate: Yield In VB.NET In C#, when writing a function that returns an
Possible Duplicate: Best way to stop SQL Injection in PHP I am creating a
Possible Duplicates: Why is lock(this) {...} bad? In C# it is common to use
Possible Duplicate: Finding the Variable Name passed to a Function in C# In C#,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.