How do I know if a Skype call is active on Android?

Well, I decompiled the Skype manifest to find out if there are any services or broadcasts running during the conversation. There are only a few internal broadcasts for incoming calls. There is also only one receiver and one service.

I tracked all running services with my application, but SkypeMainService always works, even if not in a call.

Also, AudioMode does not change using skype (but according to the logcat logs that dev would like, but they just don't), so I can’t just check if it is MODE_IN_CALL .

Do you have any search suggestions if Skype is currently running and has an active call?

Thanks!

/ edit: Brief overview of events, 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"> 
+8
android skype android-package-managers
source share
3 answers

Well, I really hoped someone would provide a helpful answer. However, I took Ruben's advice in a 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 is com.skype.raider.Main . This will also return true if there is no active Skype call, but the main application is open.

Thanks for the help, especially Ruben!

Edit: You will need the following permission in your manifest

 <uses-permission android:name="android.permission.GET_TASKS"/> 
+2
source share

The day that Skype changes all of this (maybe this update arrived 2 days later - before you finish coding), your code may break. Therefore, I do not think that it is worth trying something like that.

I apologize, this may not be the "answer", but I do not think that the time spent on this is worth it.

0
source share

There are several things you can do to increase your chance of guessing:

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 status of the phone for data exchange using PhoneManager

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

-one
source share

All Articles