I am a new and developing an android application to solve the following problem.
Sometimes I want to get some information through a call, here is the process.
call the number and I will hear the hint voice
press 1 to select the language
I wonder if there are library that can be used to simulate a click action during a call, so I can just type in the phone number and then the app will automatically select the language for me.
View.performClick() does exist, but the real problem is that you cant interact with that activity (as far as I know).
may be following link would help you:
http://www.androidpolice.com/2010/05/10/how-to-add-hard-wait-and-soft-2-3-sec-pauses-to-your-android-contacts/
Related
I want to start chromecast routing automatically and not when the user presses the button. Does anyone know how i can simulate in any way that the user pressed the media route button? I have looked through the different classes and not found anything.
I am aware that this is not how Google intends developers to use it, and my application is only functioning as a proof of concept.
If anyone knows another way to achieve the same thing (The casting starts when the app starts, if the user has enabled it in the options menu) - let me know!
You can follow the same steps as usual (get a hold of MediaRouter instance, set a selector, register a callback, etc) but then you need to keep a list of discovered routes in your application (as they are discovered by MediaRouter; you will get a call back via onRouteAdded(()). You need to do the bookkeeping as well (via onRouteRemoved() callback). Now that you have a list of routes, you can programmatically decide which one is the one you want to use and again do as usual (same stuff that you would do when you get a callback via onRouteSelected()) except that you need to call MediaRouter.selectRoute(your_selected_route) yourself to tell the framework about it. For the first part, you can take a look at this sample.
So what I discovered was that I couldn't make a check for routes in the beginning of the program because the MediaRouter hadn't discovered them yet. (I.e the call to getRoutes returned only the default route...) In my program, it was enough to start a thread that sleeps for three seconds and then calls selects any available route:
if(mMediaRouter.getRoutes().size() >= 1) {
mMediaRouter.selectRoute(mMediaRouter.getRoutes().get(1));
}
If I needed a more persistent solution, I'd do as Ali Naddaf suggested.
I want to capture ALT+TAB keys pressed from Bluetooth Keyboard connected to Device, and i want to do some custom action in my application.
As by default this Key Combination shows Recent Tasks.(May be in PhoneWindowManager.java::ShowOrHideRecentAppsDialog).
So i want to disable this action and want to handle this in my App. May be with help of onKeyShortCut() Function or so.
Can someone help me with some sample piece of code ?
FYI: If require , can make changes in Platform also.
Thanks a lot
OK I want to be able test internal phone systems in an automated fashion using an Android app, the requirements are asking for an app which can initiate a call programatically. If this is possible then when the call starts they wish to be able to send key presses, like imagine the phone menu says "press 5 to get to the X menu".. can we send that keypress from code? This way the whole system could be tested with a series of waits, and keypresses sent to the dialler.
I'm not sure how to find out if this is actually possible.. I saw PROCESS_OUTGOING_CALLS, but I havent been able to find any resources or examples on doing this, does anyone have any information? I actually got in touch with a freelancer who ended up saying it was definitely not possible (he's pretty good and he simply said 'pressing dialpad during call was impossible'), but my client is telling me apps already exist to do this, so any tips would be helpful!..
You can definitely make a call from code. See:
How to make a phone call programmatically?
You can invoke key presses from code as well:
Invoke keypress event in android?
As for doing it during a call, I haven't tried this, But you can try it using the methods from the links. Good luck!
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 have to do an Android application which should listen for miss call event. Is it possible to simulate this in Android emulator? Please help
Open DDMS ,there you will get a tab called Emulator Control .In the textbox called Incoming Number input the number from you want to call by clicking on the Call button...Then call the Hang Up button...ie. the call is missed.
Hope it helps you.