[android-developers] spurious WAKE_LOCK SecurityException?

2009-01-21 Thread dreamerBoy
I am very confused because I am getting a permission problem when I have clearly included: uses-permission android:name=android.permission.WAKE_LOCK/uses- permission in the manifest. 01-21 15:43:44.318: ERROR/AndroidRuntime(806): java.lang.SecurityException: Neither user 10019 nor

[android-developers] Can WAKE_LOCK be acquired in a Service?

2009-01-21 Thread dreamerBoy
I have included a uses-permission to WAKE_LOCK statement in the Android manifest file. if(checkCallingOrSelfPermission(permission.WAKE_LOCK) == PackageManager.PERMISSION_GRANTED) { Log.i(tag, WAKE_LOCK permission granted); } else { Log.i(tag,

[android-developers] problem acquiring a WakeLock

2009-01-19 Thread dreamerBoy
This code: PowerManager pm = (PowerManager) ftaContext.getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock (PowerManager.PARTIAL_WAKE_LOCK, My Tag); wl.acquire(); with this permission: uses-permission

[android-developers] Re: ACTION_ANSWER never answers the call - phone state stays RINGING..

2008-12-16 Thread dreamerBoy
The only thing that seems to work is the telnet technique: telnet localhost 5554 gsm accept 1234567 On Dec 11, 5:06 pm, dreamerBoy paul.hube...@gmail.com wrote: code:       try       {          // answer the phone          Intent myIntent = new Intent(Intent.ACTION_ANSWER

[android-developers] Re: problem answering a call

2008-12-15 Thread dreamerBoy
I've reverted back to my telnet technique which does work in answering a call. The command is: gsm accept thePhoneNumber. On Dec 11, 2:56 pm, dreamerBoy paul.hube...@gmail.com wrote: I tried to add the incoming number, just like it works for outgoing calls.  The result is that it crashes

[android-developers] Re: problem answering a call

2008-12-11 Thread dreamerBoy
ringing? On 12/10/2008, dreamerBoy paul.hube...@gmail.com wrote: Of course, now, ACTION_ANSWER Activity doesn't do anything.  It doesn't pick up the phone.  The phone state is still RINGING - sigh... Any thoughts are appreciated. On Dec 10, 3:53 pm, dreamerBoy paul.hube...@gmail.com wrote

[android-developers] ACTION_ANSWER never answers the call - phone state stays RINGING..

2008-12-11 Thread dreamerBoy
code: try { // answer the phone Intent myIntent = new Intent(Intent.ACTION_ANSWER); myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP // | Intent.FLAG_DEBUG_LOG_RESOLUTION // | Intent.FLAG_FROM_BACKGROUND // |

[android-developers] Re: new activity from PhoneStateListener callback method

2008-12-10 Thread dreamerBoy
You should be able to define your own constructor or setter that takes the context as a parameter, no? Does that not work? MyPhoneStateListener(Context ctx) { sthustfo wrote: Hi, I would like to know how I can start a new activity from within the PhoneStateListener method, say

[android-developers] Re: new activity from PhoneStateListener callback method

2008-12-10 Thread dreamerBoy
You should be able to define your own constructor or setter that takes the context as a parameter, no? Does that not work? MyPhoneStateListener(Context ctx) { sthustfo wrote: Hi, I would like to know how I can start a new activity from within the PhoneStateListener method, say

[android-developers] Re: new activity from PhoneStateListener callback method

2008-12-10 Thread dreamerBoy
You should be able to define your own constructor or setter that takes the context as a parameter, no? Does that not work? MyPhoneStateListener(Context ctx) { this.ctx = ctx; } or something - sthustfo wrote: Hi, I would like to know how I can start a new activity from within the

[android-developers] Re: problem answering a call

2008-12-10 Thread dreamerBoy
/ /intent-filter appears to fix the crash. On Dec 9, 6:04 pm, dreamerBoy [EMAIL PROTECTED] wrote: code:       try       {          // answer the phone          Intent myIntent = new Intent(Intent.ACTION_ANSWER);          myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP

[android-developers] Re: problem answering a call

2008-12-10 Thread dreamerBoy
Of course, now, ACTION_ANSWER Activity doesn't do anything. It doesn't pick up the phone. The phone state is still RINGING - sigh... Any thoughts are appreciated. On Dec 10, 3:53 pm, dreamerBoy [EMAIL PROTECTED] wrote: I did an upgrade to SDK r2 but it appears to be a Manifest file problem

[android-developers] problem answering a call

2008-12-09 Thread dreamerBoy
code: try { // answer the phone Intent myIntent = new Intent(Intent.ACTION_ANSWER); myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP // | Intent.FLAG_DEBUG_LOG_RESOLUTION // | Intent.FLAG_FROM_BACKGROUND // |

[android-developers] Re: invoking com.android.internal.*

2008-12-04 Thread dreamerBoy
Yes, I know about this URL and have downloaded much of the source code. The delicate problem is how to build in access to the internal classes that I need and have them be invoked correctly by Android. Question is, how to do this without in effect rolling your own version of Android i.e., doing

[android-developers] ActivityInstrumentationTestCase issue - can't send key

2008-11-21 Thread dreamerBoy
The goal of this little test program is to launch initiate a call and then generate a press to the ENDCALL button. 1. It appears that I am incapable of unlocking the keyguard: 11-21 14:40:58.445: INFO/InstTest(209): after inKeyguardRestrictedInputMode() ? true 2. Then, Android tells me I

[android-developers] Re: how to inject a KeyEvent

2008-11-21 Thread dreamerBoy
by the system and never delivered to the focused window).  But if the user is in the in-call screen, then that has focus, and you can't inject a key event since you don't have focus. On Nov 13, 4:13 pm,dreamerBoy[EMAIL PROTECTED] wrote: I'm building a test application and I have to be able to hang up

[android-developers] correct usage of adb shell input

2008-11-20 Thread dreamerBoy
Hi - I am wondering what the correct invocation of adb shell input is - It could be potentially very useful for me if I could inject key events into a running app. I've tried: adb shell input keyevent KEYCODE_0 or adb shell input keyevent KEYCODE_CALL etc. with an emulator running. I

[android-developers] PhoneStateListener not called until Phone Activity completes...

2008-11-17 Thread dreamerBoy
Hi - I'm having a problem with my PhoneStateListener not being called until after the Phone Activity is finished. Here is what I am doing: step 1: Install a PhoneStateListener. The listener is supposed to call notify() (synchronized on the lock object) when it detects a change in the phone

[android-developers] Re: PhoneStateListener not called until Phone Activity completes...

2008-11-17 Thread dreamerBoy
in the documentation - yo Google. On Nov 17, 1:57 pm, dreamerBoy [EMAIL PROTECTED] wrote: Hi - I'm having a problem with my PhoneStateListener not being called until after the Phone Activity is finished.  Here is what I am doing: step 1:  Install a PhoneStateListener.  The listener

[android-developers] Re: PhoneStateListener not being called back

2008-11-14 Thread dreamerBoy
, PhoneStateListener.LISTEN_CALL_STATE); of course - one still uses TelephoneManager.CALL_STATE_IDLE in onCallStateChangedChanged so it's a bit tricky. Hey Google, Java has enums yes? On Nov 13, 4:24 pm, dreamerBoy [EMAIL PROTECTED] wrote: I didn't forget: uses-permission android:name

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-13 Thread dreamerBoy
Hi Mark - Yes, thank you for that - ~so~ much better. Call starts, screen changes.. ooh aah. However, still some issues - Right off, PhoneStateListener callback isn't being invoked for one. Still analyzing the logCat... Frustrating for me that the API is so coy about what is a Thread, what

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-13 Thread dreamerBoy
OK - I invoked ACTION_CALL using startActivityForResult(Intent, MY_ID). I then called finishActivity(MY_ID) - that should have killed the ACTION_CALL Activity created by the system. However, I can confirm that it does not. My next brainwave was to generate a keypress on the hang-up button -

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-12 Thread dreamerBoy
New Approach ... I have a Hello, World-type program. Basically all I do is say Hello, World, install a useless button with a button-handler (to forestall ANR a little), and then I attempt to make a call with the ACTION_CALL Intent. I am no longer attempting to start the ACTION_CALL Activity

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy
initiateCall is just an Activity. Activity initiateCall = new Activity(); (actually a derived class of Activity with nothing added but debug statements to signal when each lifecycle/callback method is called). On Nov 10, 5:37 pm, dreamerBoy [EMAIL PROTECTED] wrote: Hi - thank you for your

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy
the mInstrumentation field is set. Note that calling into an activity from a Service like this is pretty sketchy -- you will need to be very very careful about activity lifecycle and updating the service as the activity changes. On Nov 10, 2:22 pm,dreamerBoy[EMAIL PROTECTED] wrote: Thanks

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy
is set. Note that calling into an activity from a Service like this is pretty sketchy -- you will need to be very very careful about activity lifecycle and updating the service as the activity changes. On Nov 10, 2:22 pm,dreamerBoy[EMAIL PROTECTED] wrote: Thanks for your reply - ha ha

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy
On Nov 10, 6:12 pm, Mark Murphy [EMAIL PROTECTED] wrote: dreamerBoywrote: Thanks for the reply, Mark (I recognize the name - I read your book.) In the ACTION_CALL documentation, it states: Note: there will be restrictions on which applications can initiate a call; most applications

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy
the service as the activity changes. On Nov 10, 2:22 pm,dreamerBoy[EMAIL PROTECTED] wrote: Thanks for your reply - ha ha, wouldn't that be nice if it were that simple.  Nope, I checked the return from the Uri.parse - not null. I got a hold of the Android source code.  It is crashing here

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy
Battle of the quotes, from: http://code.google.com/android/reference/android/app/Service.html Other application components running in the same process as the service (such as an Activity) can, of course, increase the importance of the overall process beyond just the importance of the service

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-10 Thread dreamerBoy
, 6:10 pm, Chris [EMAIL PROTECTED] wrote: You don't check if Uri.parse returns null, do you? On Fri, Nov 7, 2008 at 3:53 PM, dreamerBoy [EMAIL PROTECTED] wrote: Hi, I'm attempting to initiate an outgoing call from inside a Service. In onStart(), I create an ACTION_CALL Intent

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-10 Thread dreamerBoy
=android.permission.RUN_INSTRUMENTATION/uses- permission to the manifest. However, same error. On Nov 10, 2:22 pm, dreamerBoy [EMAIL PROTECTED] wrote: Thanks for your reply - ha ha, wouldn't that be nice if it were that simple.  Nope, I checked the return from the Uri.parse - not null. I got a hold

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-10 Thread dreamerBoy
of PhoneTestService, if that's a class you wrote. On Nov 11, 1:20 am,dreamerBoy[EMAIL PROTECTED] wrote: Taking a hint from the source code, I tried to implement an Instrumentation class in the hopes that that was what Android was looking for - Added: instrumentation

[android-developers] Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-07 Thread dreamerBoy
Hi, I'm attempting to initiate an outgoing call from inside a Service. In onStart(), I create an ACTION_CALL Intent, then attempt to start an Activity myIntent = new Intent(Intent.ACTION_CALL, Uri.parse(tel: + phoneNumber)); initiateCall.startActivityForResult(myIntent,

[android-developers] problem obtaining android source from windows/cygwin

2008-11-06 Thread dreamerBoy
bash-3.2$ /cygdrive/c/myRepo/repo init -u git://android.git.kernel.org/platform /manifest.git Traceback (most recent call last): File /cygdrive/c/myRepo/repo, line 587, in module main(sys.argv[1:]) File /cygdrive/c/myRepo/repo, line 554, in main _Init(args) File

[android-developers] problem downloading Android from windows

2008-11-04 Thread dreamerBoy
bash-3.2$ ../myRepo/repo init -u git://android.git.kernel.org/platform/manifest .git Traceback (most recent call last): File ../myRepo/repo, line 587, in module main(sys.argv[1:]) File ../myRepo/repo, line 554, in main _Init(args) File ../myRepo/repo, line 173, in _Init

[android-developers] Re: hanging up/terminating a call in an automated fashion

2008-10-29 Thread dreamerBoy
or is answered by the g-phone. Paul On Oct 29, 1:42 am, legerb [EMAIL PROTECTED] wrote: You can use a BroadcastReceiver to catch the Intent, and terminate it with abortBroadcast(). On Oct 27, 8:50 pm, dreamerBoy [EMAIL PROTECTED] wrote: Hi - I am looking for a way to terminate a call

[android-developers] hanging up/terminating a call in an automated fashion

2008-10-27 Thread dreamerBoy
Hi - I am looking for a way to terminate a call in an automated fashion. (I realize it can be done manually - the application requires that it have control over the call so that it can hang up automatically.) To initiate a call, one starts an Activity with the ACTION_CALL Intent. However,

[android-developers] Re: hanging up/terminating a call in an automated fashion

2008-10-27 Thread dreamerBoy
Second question is how to hang up an ~incoming~ call after it has been answered On Oct 27, 11:50 am, dreamerBoy [EMAIL PROTECTED] wrote: Hi - I am looking for a way to terminate a call in an automated fashion. (I realize it can be done manually - the application requires that it have

[android-developers] Re: obtaining an IPhone.Stub

2008-10-23 Thread dreamerBoy
the picture? Thanks - Paul On Oct 22, 7:20 pm, hackbod [EMAIL PROTECTED] wrote: These are not public APIs.  The telephony APIs are here: http://code.google.com/android/reference/android/telephony/package-su... On Oct 22, 1:38 pm, dreamerBoy [EMAIL PROTECTED] wrote: Hi - I need

[android-developers] obtaining an IPhone.Stub

2008-10-22 Thread dreamerBoy
Hi - I need to be able to place outgoing calls and interact with IPhone. This apparently, ~was~ the way to get it: private static IPhone getPhoneInterface() throws DeadObjectException { IServiceManager sm = ServiceManagerNative.getDefault(); IPhone phoneService =