[android-developers] WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH and 4.0+ touch events not captured
I have a service that I allow other applications to bind to remotely. During key events that they record to my service, I show a small overlay above their app. I use the following: WindowManager.LayoutParams params; params = new WindowManager.LayoutParams(); params.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH ; params.format = PixelFormat.RGBA_; params.gravity = Gravity.CENTER; params.type = WindowManager.LayoutParams.TYPE_TOAST; windowManager.addView(this, params); Pre ICS I was able to capture the special touch event as indicated by FLAG_WATCH_OUTSIDE_TOUCH. If the touch landed in my overlay, I would launch an activity. Otherwise I would ignore the touch event. In both cases the underlying activity would receive the touch event. This all works fine until I try to use this code on ICS. Now I am unable to capture any touch events for my overlay. So in summary what I want is this: *Draw a temporary view from a remote service * Not pause the running activity * Not take all touch events from the running activity * Detect with my temporary view is touched. I realize that the method I have used in the past may not be supported. If anyone has any suggestions outside of don't do this to get the stated functionality I would very much appreciate it. Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Remote Service + Async Calls + Activity + Callbacks... oh my!
I'm building an Android application that will provide some helpful services to other android applications. Activities will remotely bind to my service to interact with it. Per feedback and requests from developers using my services, I have been asked to handle some of the UI flow. This requires us to handle a case where I need to get input from the user. Since some of the services I give access to use web service calls, the calls to my service are asynchronous. I use handlers to callback to applications that have made request to my service. So in launching an activity to help handle the UI Flow this I have run into a problem. It appears I need my service to continue running from the point it was when it prompts the user to choose an action. So if I don't block the service thread, my handlers have to finish and lose context to the message. I didn't like this approach, so to get around this I tried to launch an intent with the original message passed to my service in the extras of an intent. But it doesn't look like it retains the replyTo to respond to the eventual action chosen by the user. Am I doing something fundamentally flawed? Is there an *Android Way* of doing this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to determine what Activities are bound to my Service
Diane and Mark, Thanks for your help. I am able to determine the calling applications. Harri, if you are curious this is what I did: 1. Activity binds to my service and makes a call to my remote service requesting a token. 2. In the remote binder interface, the service uses Binder.getCallingUid to get uid, then package then signatures 3. Service generates a UID (token) and associates the signature in a cache with that token. Token is returned to activity 4. Activity unbinds from token binder and binds again to my actual service binder. Passes the token in the intent. Service validates the signature. Thanks again all! On Dec 17, 7:43 am, Harri Smått har...@gmail.com wrote: Oh, Forgot to add. Bear in mind that Facebook SSO uses Activity.startActivityForResult(..) which gives them access to Activity.getCallingActivity() once authentication Activity is spawned. -- H On Dec 17, 2011, at 5:22 PM, Harri Smått wrote: Hi, AFAIK there is no way to determine calling application from yourServiceautomatically (as many have stated already). As for Facebook SSO, it's a bit different situation since it handles logging in directly into their web services via assigned access token. In your situation you ought to do something similar though, especially give your clients a client library for making it easier to authenticate with your AndroidService. Now, if you have a webservice, which clarifies your situation a lot, the whole authentication procedure could go roughly as follows. 1. Your clients have to register their package signature vie web interface to server side. 2. Client calls, e.g, identify(signature) IPC method after binding. 3.Serviceforwards it to webservice, which determines is it ok to continue. 4.Serviceassigns client a session id on positive answer. It would be totally up to you do you want to do whole identifying procedure as a separate thread, which returns session id viaServicecallback mechanism, or as a blocking method which returns it instantly. When it comes to safely dealing with client signature, and package signatures in general, goes beyondmyknowledge though. -- H On Dec 17, 2011, at 1:14 AM, Bsweet wrote: Ultimately what I would like to do is check the signature of thebound application. I want to have a mechanism where developers can register their signatures withmyservice, then I will check to see if their package/ signature combination matches what I have inmywebservice. This is exactly what the Facebook Android application does for Single Sign On. I just can't find a clean way to get the calling application. On Dec 16, 8:46 am, Harri Smått har...@gmail.com wrote: Hi, I would go for a simple handshaking mechanism quite likely. You can let anyone bind to yourservicebut disallow usage of IPC methods for unidentified clients. E.g. 1. Client connects toservice. 2. After connection is established, client is required to call, say, identify() IPC method which returns a String, Integer, what so ever. 3. After receiving this challenge, client has to call identify(result) method which gives client a session id. 4. For all of the later calls client has to use this session id among with the call. Quite obviously all this depends totally on how much security you're required to have within your client-serviceinteraction but some very simple handshaking protocol might work surprisingly well if it's kept secret. -- H On Dec 16, 2011, at 6:26 PM, Bsweet wrote: It is the spoof part that concerns me. Anyone else out there have any creative ideas? Right now I'm considering just checking who is on the top of the activity stack, but that is hokey and not reliable. On Dec 16, 4:30 am, Mark Murphy mmur...@commonsware.com wrote: On Thu, Dec 15, 2011 at 9:54 PM, Kristopher Micinski krismicin...@gmail.com wrote: When you get a bind in yourservice(your onBind) can you just take the intent and get component associated with it? From Intent: ComponentName getComponent() Retrieve the concrete component associated with the intent. That should be the recipient, not the sender. The only way I know to find out whoboundto you is if you require that information in an extra, and that can always be spoofed. The expectation is that you should not care *who*boundto you, merely whether they had sufficient permissions to do so. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 4.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit
[android-developers] Re: How to determine what Activities are bound to my Service
It is the spoof part that concerns me. Anyone else out there have any creative ideas? Right now I'm considering just checking who is on the top of the activity stack, but that is hokey and not reliable. On Dec 16, 4:30 am, Mark Murphy mmur...@commonsware.com wrote: On Thu, Dec 15, 2011 at 9:54 PM, Kristopher Micinski krismicin...@gmail.com wrote: When you get a bind in your service (your onBind) can you just take the intent and get component associated with it? From Intent: ComponentName getComponent() Retrieve the concrete component associated with the intent. That should be the recipient, not the sender. The only way I know to find out whoboundto you is if you require that information in an extra, and that can always be spoofed. The expectation is that you should not care *who*boundto you, merely whether they had sufficient permissions to do so. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 4.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to determine what Activities are bound to my Service
Ultimately what I would like to do is check the signature of the bound application. I want to have a mechanism where developers can register their signatures with my service, then I will check to see if their package/ signature combination matches what I have in my web service. This is exactly what the Facebook Android application does for Single Sign On. I just can't find a clean way to get the calling application. On Dec 16, 8:46 am, Harri Smått har...@gmail.com wrote: Hi, I would go for a simple handshaking mechanism quite likely. You can let anyone bind to yourservicebut disallow usage of IPC methods for unidentified clients. E.g. 1. Client connects toservice. 2. After connection is established, client is required to call, say, identify() IPC method which returns a String, Integer, what so ever. 3. After receiving this challenge, client has to call identify(result) method which gives client a session id. 4. For all of the later calls client has to use this session id among with the call. Quite obviously all this depends totally on how much security you're required to have within your client-serviceinteraction but some very simple handshaking protocol might work surprisingly well if it's kept secret. -- H On Dec 16, 2011, at 6:26 PM, Bsweet wrote: It is the spoof part that concerns me. Anyone else out there have any creative ideas? Right now I'm considering just checking who is on the top of the activity stack, but that is hokey and not reliable. On Dec 16, 4:30 am, Mark Murphy mmur...@commonsware.com wrote: On Thu, Dec 15, 2011 at 9:54 PM, Kristopher Micinski krismicin...@gmail.com wrote: When you get a bind in yourservice(your onBind) can you just take the intent and get component associated with it? From Intent: ComponentName getComponent() Retrieve the concrete component associated with the intent. That should be the recipient, not the sender. The only way I know to find out whoboundto you is if you require that information in an extra, and that can always be spoofed. The expectation is that you should not care *who*boundto you, merely whether they had sufficient permissions to do so. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 4.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to determine what Activities are bound to my Service
Thanks Dianne, I'm sorry if I am just slow here, but it still isn't clear to me how I would get the uid of the caller from the service. Because it is a synchronous call to my remote service, is it just that my remote service will be running on the same thread and I can get the id from the Process.myTid()? Thanks, -Tony On Dec 16, 3:39 pm, Dianne Hackborn hack...@android.com wrote: Yep. What the platform typically does is have the service publish a factory interface, with a call to request a new session: interface IMySession { void close(); } interface IMyService { IMySession makeSession(); } In makeSession(), check the uid of the caller. If you want to check signing cert, you can get the packages associated with the calling uid and check the cert of one of them. (All packages associated with the same uid must be signed with the same cert.) 2011/12/16 Harri Smått har...@gmail.com Hi, I would go for a simple handshaking mechanism quite likely. You can let anyone bind to your service but disallow usage of IPC methods for unidentified clients. E.g. 1. Client connects to service. 2. After connection is established, client is required to call, say, identify() IPC method which returns a String, Integer, what so ever. 3. After receiving this challenge, client has to call identify(result) method which gives client a session id. 4. For all of the later calls client has to use this session id among with the call. Quite obviously all this depends totally on how much security you're required to have within your client-service interaction but some very simple handshaking protocol might work surprisingly well if it's kept secret. -- H On Dec 16, 2011, at 6:26 PM, Bsweet wrote: It is the spoof part that concerns me. Anyone else out there have any creative ideas? Right now I'm considering just checking who is on the top of the activity stack, but that is hokey and not reliable. On Dec 16, 4:30 am, Mark Murphy mmur...@commonsware.com wrote: On Thu, Dec 15, 2011 at 9:54 PM, Kristopher Micinski krismicin...@gmail.com wrote: When you get a bind in your service (your onBind) can you just take the intent and get component associated with it? From Intent: ComponentName getComponent() Retrieve the concrete component associated with the intent. That should be the recipient, not the sender. The only way I know to find out whoboundto you is if you require that information in an extra, and that can always be spoofed. The expectation is that you should not care *who*boundto you, merely whether they had sufficient permissions to do so. -- Mark Murphy (a Commons Guy)http://commonsware.com| http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 4.1 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to determine what Activities are bound to my Service
I'm writing a service in my application that will allow remote bindings from other apps. I want to know what activities or application packages are binding to my service. Is it possible to determine this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Recommendation for Android Training
Has anyone attended any in person Android development training? If so, I would love to hear any recommendations (or classes to avoid). I'm in Seattle, but willing to travel. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Select Contact as First Step in Application
I want to use the built in functionality to select a contact as the first step in my application. 1. User clicks my app icon 2. Contact Select Appears 3. My Activity Appears How do I go about this? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en