[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Mark Murphy
GT wrote: Does anybody have an example of using the PhoneState Listener while running a service? I've been having problems having a PhoneState Listener inside of the service. I don't have an example I can publish, but it definitely works. What specifically has been your issue? -- Mark

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread GT
I just quite don't understand how to use the two... This is what I have so far, am I even on the right track? And I do appreciate the response... import android.app.Service; import android.content.Context; import android.content.Intent; import android.os.IBinder; import

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Mark Murphy
GT wrote: I just quite don't understand how to use the two... This is what I have so far, am I even on the right track? And I do appreciate the response... snip @Override public void onStart(Intent intent, int StartId) { String srvcName = Context.TELEPHONY_SERVICE;

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Sujay Krishna Suresh
Hi guys, i'm using the foll code snippet in my program to display the user's phone number... TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); phNoText.setText(You are : + tm.getLine1Number()); i'm getting a no in the emulator... but when i try

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Mark Murphy
Sujay Krishna Suresh wrote: Hi guys, i'm using the foll code snippet in my program to display the user's phone number... TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); phNoText.setText(You are : + tm.getLine1Number()); i'm getting a

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Sujay Krishna Suresh
Thanks a lot for the fast response mark... but i think its not associated with the sim bec i tried this with abt 10 diff sim cards i'm wasting a lot of money for this... i'd like to no wats goin wrong... is there any mechanism to check whether my sim cards r rejecting the call??? -- Regards,

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread GT
Ok thank you, I will mess around with that then On May 25, 5:03 am, Mark Murphy mmur...@commonsware.com wrote: GT wrote: I just quite don't understand how to use the two... This is what I have so far, am I even on the right track? And I do appreciate the response... snip   @Override

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread GT
Ok, Ive fixed that and added more stuff. Just so you know where I am at here is some more code im still working on it, and thank you so much for your help. import android.app.Service; import android.content.Context; import android.content.Intent; import android.os.IBinder; import

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread GT
Actually I was thinking, would a service be the way to go? Because won't my app start(or do what I want it to) if I use the PhoneState Listener? On May 25, 11:05 am, GT burlysk...@gmail.com wrote: Ok, Ive fixed that and added more stuff. Just so you know where I am at here is some more code im

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Mark Murphy
GT wrote: Actually I was thinking, would a service be the way to go? Because won't my app start(or do what I want it to) if I use the PhoneState Listener? I do not understand your question, but let me see if I can address it by pointing out a problem in your code. If you call:

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread GT
Oh, ok thank you. I will rephrase, when you run an app it goes through the the android app life cycle. Lets say my activity that contains the listener is terminated, will it start running and do what it needs to if the phone rings? That is if its not a service... On May 25, 11:56 am, Mark Murphy

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Mark Murphy
GT wrote: Oh, ok thank you. I will rephrase, when you run an app it goes through the the android app life cycle. Lets say my activity that contains the listener is terminated, will it start running and do what it needs to if the phone rings? That is if its not a service... If you do the

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread GT
Oh ok. So I guess I should stick with the service because I want it to run in the background, and yea I have unregistered it. On May 25, 12:16 pm, Mark Murphy mmur...@commonsware.com wrote: GT wrote: Oh, ok thank you. I will rephrase, when you run an app it goes through the the android app

[android-developers] Re: Using PhoneState Listener and Services

2009-05-25 Thread Sujay Krishna Suresh
hey mark... you've got anythin for me?? i sent u a reply but didnt get back a response... plz do respond man.. this thin is killin me... On Tue, May 26, 2009 at 12:52 AM, GT burlysk...@gmail.com wrote: Oh ok. So I guess I should stick with the service because I want it to