Android hide the application from the list of applications and launch it from the broadcast receiver

I want to hide my application from the list of applications so that a third party does not know that this application is installed.

I saw that this can be achieved as follows: if you want to hide your application from the Application Launcher, just do not include android.intent.category.LAUNCHER in any of your actions.

I tried this and it works. Now I need to define a shortcut to launch my application.

I am trying to achieve this with a broadcast receiver for an outgoing call. So I will check in my onreceive if the dialed number = my pattern, then start my activity

I have a few questions here

  1. This is the right way to do it.

  2. Please see my code below for the recipient, here my recipient is called, but along with this, the system application for processing β€œdialing” is also called. Therefore, even if I type in my template, after I show my activity, it will make a call. I want to stop calling if the dialed number matches my pattern. How can I achieve this?

  3. I am starting my activity as a new task. When I launch my application for the first time, an activity screen appears. But when I dial the number again, it is not brought to the fore. How can I achieve this? I think that if I solve my previous question, they will take care of this.

     public class OutgoingCallInterceptor extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { final String originalNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); this.setResultData("0123456789"); final String newNumber = this.getResultData(); String msg = "Intercepted outgoing call. Old number " + originalNumber + ", new number " + newNumber; Toast.makeText(context, msg, Toast.LENGTH_LONG).show(); Intent intent1 = new Intent(context,ShowMessageActivity.class); intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent1); } } 

Menifesto File

 <application android:icon="@drawable/icon" android:label="Outgoing Call Interceptor"> <receiver android:name="OutgoingCallInterceptor"> <intent-filter android:priority="1"> <action android:name="android.intent.action.NEW_OUTGOING_CALL"></action> </intent-filter> </receiver> <activity android:name="ShowMessageActivity" ></activity> </application> <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"></uses-permission> 
+1
source share
3 answers

But if you want to say all installed applications from the list of applications, then I think that this is impossible, you can use

 <action android:name="android.intent.action.CREATE_SHORTCUT" /> 

create shortcut

And for the rest of your requirements, this cannot be achieved, because I have not found a way to hide my application in this way, and, in addition, mobile phones are personal devices. And you can use the broadcast receiver to know when the dialer intent starts. You cannot get a key dialed like all together, another application.

0
source
  • This is not right, but perhaps the only way to do it :)
  • You can try calling this.abortBroadcast () on your receiver to end the call. Unfortunately, I can’t check it now, but it should work.
0
source
 public class OpenApplication extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); String compare_num = "777"; if (number.equals(compare_num)) { Intent myintent = new Intent(context, MainActivity.class); myintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(myintent); // abortBroadcast(); setResultData(null); } } 

}

  <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /> <!-- OPEN APP --> <receiver android:name="receiver.OpenApplication" > <intent-filter android:priority="0" > <action android:name="android.intent.action.NEW_OUTGOING_CALL" /> </intent-filter> </receiver> 
0
source

All Articles