wood burning stoves 2.0*
The moose likes Android and the fly likes how to start application after pressing a particular number? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "how to start application after pressing a particular number?" Watch "how to start application after pressing a particular number?" New topic
Author

how to start application after pressing a particular number?

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Is it possible to start application after pressing a particular key sequence.
suppose i pressed '000' then how to start my application?


Life is easy because we write the source code.....
Piyush Patel
Ranch Hand

Joined: Feb 24, 2009
Posts: 127

i would like to give you idea on this, you need to listen to Broadcast Intent (type here would be 'Call ') . when you find this intent is broadcasted ( write down code which opens your app) .


[My Blog] [ Follow @Twitter] | Innovations never goes out of Style...
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Thanks Piyush,

how to monitor which number is pressed on dialer?
Piyush Patel
Ranch Hand

Joined: Feb 24, 2009
Posts: 127

Hi, Pramod . in #onReceive() method of brodcast you can get Number by following line (using intent).

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629


i would like to give you idea on this, you need to listen to Broadcast Intent (type here would be 'Call ') . when you find this intent is broadcasted ( write down code which opens your app) .


I had write in manifest.xml to register broad cast receiver as




in MyReceiver class I write as



and in my MicroERS I have



but when I call on any number then it will not send message. What is wrong in my code.
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

If I change in manifest.xml as




Then message is sent when I pressed the camera key, then why



this is not run when I pressed call button, Please help me

Thanks in advance
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

I have also tried "ACTION_NEW_OUTGOING_CALL" instead of "ACTION_CALL_BUTTON" but still it is not working. What do you think where is the problem?


Thanks in advance
Piyush Patel
Ranch Hand

Joined: Feb 24, 2009
Posts: 127

hi,Pramod have you entered permission for call in AndroidManifest.xml . if not then, find appropriate permission related to CALL from http://developer.android.com/reference/android/Manifest.permission.html
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

I have write following permission in manifest.xml

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Hello anybody is there?
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

still problem is not solved
Piyush Patel
Ranch Hand

Joined: Feb 24, 2009
Posts: 127

please add one more permission <uses-permission android:name="android.permission. CALL_PRIVILEGED" />
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Thank you PIYUSH
Now it is working
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to start application after pressing a particular number?
 
Similar Threads
WTE debug option
JFrame won't setVisible( false )
System.exit(0) in Swing
How to write code that will start application on pressing key more than 2 second
Dynamically change tab color JTabbedPane