I want my app to open whenever the user makes a call. I am able to know that call has started but cant open my app. Is there any way i can do that.
Thanks in advance
When you know that a call has started, use your package name / class directly, for example to create a new intent to call the twidroid program you'd use the followinglink text:
Intent intent = new Intent("com.twidroid.SendTweet");
You'd probably want to put a try/catch around for a ActivityNotFoundException for when the application is not installed.
Related
I need to open my app from a serviceintent, but this one need to get data from the same app, and I have no idea how to make this.
Thanks for the help!!!
I'm not completely sure what you mean, but my guess is that you want to send an extra.
Use this when creating the intent in your service:
intent.putExtra("KEY",intValue);
When starting the activity, in the onCreate
getIntent().getIntExtra("KEY",defaultValue);
Firstly, I understand that commonly this is not something that you typically want to do. However, the app I'm developing adds functionality to another app, but requires that the other app be restarted for it to work.
Is it possible to restart another app (i.e. -> user clicks a confirm button, other app is closed and reopened)? How would I accomplish this?
If it's not possible normally, would it be possible if the app has SU? How would it be accomplished then?
I found a way that no need root permission.
ComponentName componentName = getPackageManager().getLaunchIntentForPackage("com.xxx.yyy.zzz").getComponent();
Intent intent = IntentCompat.makeRestartActivityTask(componentName);
startActivity(intent);
There are some ways to interact with other apps through Android. Usually, intents are used for this.
You can go through this tutorial that shows what are the possible things you can do with other apps using your activity.
Especially, see the Lesson: Sending the User to Another App
I was able to uncover an answer... hopefully this will be helpful to those of you looking for the same.
Using RootTools, this is very easily done.
RootTools.killProcess(package);
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(package);
startActivity(LaunchIntent);
I have a webview in my app, on trying to do actions like making a call (Tapping call button from results displayed in webview), sending mails and other actions, my webview doesn't perform those actions
I Found a solution to add the intent actions in my web view activity as
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
startActivity(intent)
Instead of doing so is there any way to add in the android manifest file
or Is there any way to turn on all of the intent actions for the webview so that
there wont be further issues in handling the actions
Can someone help me on this pls
Your answer seems to me a bit strange, I think you are a bit confuse about the difference between Intent and manifest permission. The first one are the system used by android to let app communicate with each other, the second one allow you to use some feature of the device like wifi and direct phone call that need the explicit agreement of the user to be used (the prompt that popup when you make the first install of an app).
With this clarification it is clear that if you want to do something that require another app you will have to make an Intent. This Intent, if well formed, will be elaborated by the os that will take care of sending it to the correct application able to accomplish the Intentrequirement.
So the answer to your question, as far as i know, is no, you have to use intent if you have the need of calling external app. It's also a good practice to set in the manifest only the permission really needed by the app, this way the user know what the app really can do and and what it can't do.
Hope i understand your question and answer it.
Can any body suggest me, any Android Intent to make SIP Call? or even third party framework/lib/app, which has the facility to be invoked using an intent and some parameters will be fine.
Kindly Note: Not regular phone call, needed intent for SIP/Internet Phone call.
Thanks In Advance.
1) Do you mean you want to implement a SIP app?
Then, check this:
http://developer.android.com/guide/topics/connectivity/sip.html
Make you app and listen to ACTION_CALL.
Or
2) Do you want to invoke a calling app?
Then the usual ACTION_CALL will do.
(For example, in my phone ACTION_CALL will prompt me if I want to use Skype or Phone App)
Added:
I am using SipDroid in one of my phone. This is what happens when I try to make call:
Alternatively, if you meant to create an Intent, you could trying looking into declaring a custom scheme within an IntentFilter in your AndroidManifest.xml, such as calling an Intent with a sip:<numberToCall> will open your Activity.
Can someone explain me how to control one application from another application? I'm running a music player in an app1 using service class. And I want to stop that music player from another app.,i.e app2. But, I'm fallin short o the concept.
Depends what you need to do.
Opening another activity (or sending messages) is by using Intents:
Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
// ...
startActivity(intent);
Starting service is by using startService()
What you are trying to do can also be done using Intent broadcasts but only if your target app supports and listens to specific actions on the broadcast. You need to see if there is such an ACTION supported.
I'd like to continue this question a bit.
In my case, I'm developing the target app and I need to implement few simple procedure calls for the main app. Basically 'start', 'stop' and 'sendData'. As I wrote, I'm developing the target app so I can support whatever I want. Which would you say is the easiest way to handle.
The whole situation a bit more explained. Main app would like my app to start it's work, and if needed they'll request that I turn myself off and when the main app is closing it would request me to send my data forward.
I'm quite new to android development, so code snippets are preferable. Thank you.