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.
Related
My security company's mobile app (CPI inTouch) allows me to create "scenes" which trigger multiple actions at the same time with a press of one button (e.g. disarming the alarm and unlocking the smart lock on my door). I've also added shortcuts to each of the scenes on my home screen (on my Samsung Galaxy Note9, if that's relevant) so I can launch a scene via the shortcut without having to go into the app itself.
However, having just purchased Tasker, I'd like to trigger the shortcut (or the activity in the app itself) programmatically in a Tasker profile or some other automation app. I've tried plenty of apps that allow you to trigger a shortcut based on an event, but none have these particular shortcuts in the list of available ones. I read that I should be able to use a Send Intent task in Tasker to do this, but I don't know what the intent string would be or where to find it.
In case you can suggest a different way to achieve this, the main use case so far is to have my alarm system automatically disarmed when my phone's morning alarm goes off.
First thing to check would be...
create new task to Launch App,
find your CPI app and if it has a "+" in top right corner of app icon you can long press it to reveal a list of activities.
if your app does not offer those options...
The Tasker dev also has a group of plugins under the AutoApps group, there is one called AutoShortcut that launches shortcuts.
edit: there are apps such as APK Analyzer that can show you the activities and services inside an app and whether or not they can receive intents from external apps.
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.
I am taking the reference of one application from android market and I want a similar interface actually so the actual problem goes like this:
Step 1) We have our native contact list in android Phone right please see the screen shot attached:
Step2) Now i select a Particular Contact from this contact List Lets say I select Narendra Kirusa so we will reach to the following Page
On this Page the Call mobile option is the default one of the android Phone but after that there is a second row coming with the option of Walkie-talkie thats the customised one by the application developer now when you click on that walkie talkie then it starts your application screenshot attached:
now it lands to application. Now the thing is where should i make changes do give that option of walkie talkie to start your own application. like here they gave Walkie talkie on the contact details page the similar option i want to give for my application also then where should i give this option??
We cannot make the changes in the OS files as it is the application.
There Must be some option in the android-manifest.xml file to give this option of putting a new row to start our own application from the android Native Contact Details Page.I tried googling it but could not figure out much.
See there are intents to interact with the native Phone call or SMS so like that only for example to send the sms on click on call phone we can do like this to move it to our application like if you click on call Mobile then we are able to give options like see on click on the call mobile
If you click on dial it goes to android native phone call and if you click on Send Voice SMS then it goes to my application for this what they did is see in the android-manifest.xml file for mail activity they put this option, i am not sure this can be done
using Broadcast Receiver or how??
So can you please suggest how I can put a new row after the android native call Mobile row.....??
Finally how to add this walkie talkie option??
I think here should be used the same mechanism as for opening files in different applications.
You can implement custom BroadcastReceiver which would be registered for receiving this type of action (you'll need to find out what action and category are used)
You can read more about it in docs http://developer.android.com/reference/android/content/Intent.html
I am developing a Contacts Application for Android. Now how can I replace Default out of the box Contacts Application with my new application?
You cannot replace an Android system application (meaning one bundled with the device when shipped) with one of your own unless you are creating a custom ROM image...period.
You may, however, emulate that application's functionality so that anytime a user would be presented with an option to jump into the default Contacts app, they can choose yours instead. You do this by exposing that your application responds to the same list of Intents as that particular app. Here is a link to the current Contacts manifest to give you an idea of which Intents it responds to.
The user will be presented with an option to select your app as the default when triggering a Contacts related action. IF THE USER CHOOSES to make your application the default handler of these activities, they may do so, but there is not way to force that decision upon them.
HTH
I want to create an app or background service that just listens for the launch of a 'default' app, say Contacts or the built-in Gmail app. If the contact app is clicked, I want to transfer control to my app temporarily (e.g. present a Yes/No popup to the user or increment an internal counter of my app ) and then redirect the user back to the app that was clicked. I want to do this only for a couple of 'well-known' built-in default apps, not any third party apps.
Is this possible? May be using some special intents?
Have you tried registering broadcast receivers for the intents that would launch those built-in apps? This might not work since that might confuse Android into thinking your app is a potential target for those intents (e.g. that it should be used to actually write and send the email in the case of a 'compose an email' intent), but it should be a good place to start.