Skip to main content

How to find out if a Skype call is currently active on Android


Okay, I decompiled Skype's manifest to find out if there are any Services or Broadcasts running during a call. There are only a few internal broadcasts for incoming calls. Also only one receiver and one service exist.



I monitored all running services with my app, but the SkypeMainService is always running, even if not in a call.



Also AudioMode is not changed by skype (but according to the logcat-logs the dev wanted to, but they just don't do it), so I cannot simply check if it is MODE_IN_CALL .



Do you have any suggestions how to find out, if Skype is currently running and having an active call?



Thanks!



/edit: A brief overview of the Activities etc:




<activity android:name="com.skype.raider.Main">
<activity-alias android:name="com.skype.raider.ui.SplashScreenActivity" android:targetActivity="com.skype.raider.Main">
<receiver android:name="com.skype.MainReceiver" android:enabled="true" android:exported="false">
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MEDIA_MOUNTED" />
<action android:name="android.intent.action.SEARCH" />
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<action android:name="com.skype.raider.INCOMING_GSM_CALL" />
<action android:name="com.skype.raider.ON_GSM_CALL" />
<action android:name="com.skype.raider.intent.action.request_sync" />
</receiver>
<service android:name="com.skype.MainService">


Source: Tips4all
Source: Tips4allSource: CCNA FINAL EXAM

Comments

  1. Okay, I really hoped someone would provide a useful answer. However, I picked up Reuben's advice in the comment and made this method:

    /**
    * Gets the current activity
    *
    * @param context
    * A context to use
    * @return The Activity name
    */
    public static String getCurrentTopActivity(Context context) {
    ActivityManager mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    List<ActivityManager.RunningTaskInfo> RunningTask = mActivityManager.getRunningTasks(1);
    ActivityManager.RunningTaskInfo ar = RunningTask.get(0);
    return ar.topActivity.getClassName().toString();
    }


    Then I check if the result equals com.skype.raider.Main. This will also return true if there is no active Skype call, but the main app is open.

    Thanks for all the help, especially Reuben!

    ReplyDelete
  2. The day Skype changes any of this (might be in that update that's coming in 2 days from now - before you finish coding) your code might break. So I don't think its worth attempting anything of this sort.

    I am sorry, this might not be an "answer", but I don't think time invested into this is worth it.

    ReplyDelete
  3. There is a few things that you can do to increase your chance of guessing it:

    1) Check if the application is running:

    ActivityManager activityManager = (ActivityManager) this.getSystemService( ACTIVITY_SERVICE );
    List<RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses();
    for(int i = 0; i < procInfos.size(); i++){
    if(procInfos.get(i).processName.equals("com.android.browser")) {
    Toast.makeText(getApplicationContext(), "Browser is running", Toast.LENGTH_LONG).show();
    }
    }


    2) Check the phone state for data exchanging using the PhoneManager

    3) and finally check Skype developers page for any known api

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.