Is it possible to open android dialer directly. The standard solution (via Intent.ACTION_DIAL) does not suit me, because it create intent chooser, and there are other dialer apps, like viber. Any solutions?
Unfortunately there is no way to directly open the dialer because you cant tell all the dialers package names on all the vendors, for instance a Xiaomi dialer would have a different package name than the LG one.
The only way is to use Intents to ask the OS to open the dialer, if there is a default dialer selected it will open the default one, if default is not selected the user will be asked to choose.
This is the correct and expected behavior and is made so for a reason.
Related
I'm running into a problem with building an app. The app has a contact list, when you click a contact the default dialer app should open and place a call to the number associated with the contact. This has been working fine for quite a while but recently we got a question from a user who uses a third-party dialer app, and he would like it to open when clicking a contact from the contact list in our app instead of the stock android dialer.
We installed this third party dialer on a test device and set it was the default dialer app (through apps -> defaults -> default telephony app), however when we click on a contact in our app, the stock (Samsung) dialer still opens, instead of the third party one. We restarted the phone to be sure but this doesn't help either.
When i open the stock contacts app and place a call through there the third party dialer does run correctly and manages the call.
The specific piece of code we use to place the call:
Intent intent_call = new Intent("android.intent.action.CALL");
intent_call.setData(Uri.parse("tel:" + number));
startActivity(intent_call);
From what I can find in the documentation this should respect the default dialer setting but it seems like it does not. Does anyone have any idea why this could be? I've been searching all over but I can't seem to find any info other than the way we already use through the intent.action.call.
My team is developing an Android app that includes the ability to call and talk to customer support. We are calling an Intent with ACTION_DIAL, which brings up the dialer with the phone number pre-populated, as expected. In the device emulator, we also see links to Create a new Contact and Add to a Contact, which are fine, but we want to suppress the Send SMS link, since there is no way for us to read messages sent to that number. Ideally, I'd like to be able to pass a parameter or change a setting that disables SMS messaging for that one invocation, but I'm open to other solutions. Searches that I've done haven't turned up anything.
Thanks in advance,
Dan
No. There's no way of knowing what dialer is being launched for action dial- OEMs all have the option of using their own, or the user can even download one of their own. There's no way of knowing what options those dialers support, and definitely no way of configuring them. Even if there was, a dialer app could ignore the configuration. You may want to use ACTION_CALL instead, which requires additional permissions but will directly call without bringing up a prefilled dialer.
My Android app has to allow the user choose which app will open a certain file format, exploiting the system chooser, so next time a certain intent is handled as the user decided.
I would like that it is able to open a chooser of apps for an intent but without opening the chosen app.
I mean, the chooser has to be called just to have the user choosing the app but the app wouldn't open.
Is it possible, maybe with a special intent or workaround?
Your requirement is a little bit like the one feature in "Android for Work", maybe you can check it.
We have an app that starts an activity for SENDTO with the intention of letting the user send an email. the choice of all the various email apps is fine, but we'd like to give the user of bypassing that step in the future ... e.g., add a "remember this decision" button at the bottom of the chooser. from then on, we'd launch that specific activity instead of getting the chooser.
I'm wondering if we can interact with the built-in create chooser functionality at a lower level to affect this. If not, could someone point / post some code snippets for this? I suppose the trick is understanding how to get a list of activities that can handle the intent.
I've seen a lot of questions about modifying the app chooser, and they all seem to state that no, you cannot change the built-in app chooser, but you can create a custom app chooser using queryIntentActivities() in the PackageManager class.
i'm trying to port my android application to windows. in android, there is a way to start an activity with the ACTION_SEND flag i.e.
Intent intent = new Intent(android.content.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(android.content.Intent.EXTRA_TEXT, "....");
startActivity(Intent.createChooser(intent, "Subject"))
when you do this, a list of applications (i.e. facebook, text messaging, twitter, evernote, etc...) that can receive the passed in information is presented. the user selects one and information can be shared thus.
is there something analogous in windows phone 7?
Yes, Windows Phone 7 does have something similar. Take a look at Launchers and Choosers.
With launchers, you can launch another application but you do not get any information back from the newly launched application after it ends. This is similar to startActivity in Android. With choosers, you can receive information back, similar to startActivityForResults. There are a bunch of launchers and choosers available.
Windows Phone 7 currenlty includes no publicly available direct equivalent to Androids Intents.
To access system data and to perform certain actions that are built into the core of the OS and require user interaction, it uses Launchers and Choosers which can seem similar. It is not possible to create your own ones though.
If you want to add functionality like sharing to Twitter, etc. you'll need to add this functionality to your application.