[android-developers] Re: How to start an activity from a service

2010-10-05 Thread Bret Foreman
I might be bad manners to start an Activity out of the blue like that, but here's how you do it: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClass( myContext , ActivityToLaunch.class ); startActivity( intent ); Note that the first arg

[android-developers] Re: How to start an activity from a service

2010-10-05 Thread Doug
startActivity works the same in a service as it does in an activity (Context vs. Activity argument not withstanding), and I don't think it's gauche to launch an activity from your service. In many cases, you need to launch an activity from a service when it needs attention. Doug -- You received

Re: [android-developers] Re: How to start an activity from a service

2010-10-06 Thread Prakash Iyer
would you be able to use the NotificationManager and let the user start the activity? if possible that might be less intrusive... On Wed, Oct 6, 2010 at 2:23 AM, Doug wrote: > startActivity works the same in a service as it does in an activity > (Context vs. Activity argument not withstanding),

[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-03-26 Thread Matt Kanninen
Sorry about resurrecting an old thread, but really? All resources from all APK's are public to all APK's at all times? Could yall post a new blog post about how to write secure Android applications? ;) How about assets? And whats the deal with the stuff that ends up in your assets folder that y

[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-13 Thread Menny
OK. I'll be explain my needs: I'm the author of AnySoftKeyboard (http:// softkeyboard.googlecode.com). The reason I made this keyboard, is to provide alternative layouts in the on-screen keyboard (e.g., Hebrew, Russian, DVORAK, etc. and of course, qwerty). But the keyboard APK gets bloated with all

[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-13 Thread Menny
I don't know what the other ContentProviders URI are. They can be anything, I want to release my keyboard service, and then release layouts as I need. This means that, somehow, the keyboard service needs to "know" which layout packages are installed on the device, and what are the URI of their cont

[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-13 Thread Menny
So you suggest that I'll have a pre-define resource which will hold all the information I need (let's say it is an XML resource) for creating the external keyboard. This sounds OK. The only problem is how to query for packages which have this resource? I can still create an Activity which have anot

[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-14 Thread Menny
I'll look at the examples, and try that. Thanks. On Feb 14, 11:07 am, Dianne Hackborn wrote: > You can follow the same model we use for input methods, app widgets, live > wallpapers, and other things (none of which are fundamentally kinds of > things in the platform, but built on top of the fun

[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-15 Thread jotobjects
On Feb 13, 11:36 am, Dianne Hackborn wrote: > This sounds much more complicated than you need.  If you just want to load > resources from another .apk, you don't need any code in it at all -- just > use Context.createPackageContext() to get the context for the other package > and load its resour

[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-16 Thread jotobjects
On Feb 15, 5:01 pm, Mark Murphy wrote: > jotobjects wrote: > > Are the resources of the another application package essentially > > public - can any application call Context.createPackageContext() to > > get the context of a different application? > > Yes. It shocked the heck out of me when I re

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-03-26 Thread Dianne Hackborn
On Fri, Mar 26, 2010 at 4:22 PM, Matt Kanninen wrote: > Sorry about resurrecting an old thread, but really? All resources > from all APK's are public to all APK's at all times? > Yes. > Could yall post a new blog post about how to write secure Android > applications? ;) > One possibility is

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-13 Thread Dianne Hackborn
This sounds much more complicated than you need. If you just want to load resources from another .apk, you don't need any code in it at all -- just use Context.createPackageContext() to get the context for the other package and load its resources from there. And if you don't need any UI, and real

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-13 Thread Mark Murphy
Menny wrote: > I don't know what the other ContentProviders URI are. Then don't use a ContentProvider. Follow Ms. Hackborn's directions instead and use Context.createPackageContext() and access the other APKs' resources that way. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twi

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-13 Thread Mark Murphy
Menny wrote: > I don't know what the other ContentProviders URI are. > They can be anything, I want to release my keyboard service, and then > release layouts as I need. > This means that, somehow, the keyboard service needs to "know" which > layout packages are installed on the device, and what ar

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-14 Thread Dianne Hackborn
You can follow the same model we use for input methods, app widgets, live wallpapers, and other things (none of which are fundamentally kinds of things in the platform, but built on top of the fundamental generic activity, receiver, service, and provider components): 1. Pick the kind of component

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-14 Thread Mark Murphy
Menny wrote: > So you suggest that I'll have a pre-define resource which will hold > all the information I need (let's say it is an XML resource) for > creating the external keyboard. This sounds OK. > The only problem is how to query for packages which have this > resource? I'm not sure if there

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-14 Thread Menny Even Danan
OK, thanks. I'll try that. On Sun, Feb 14, 2010 at 14:15, Mark Murphy wrote: > Menny wrote: > > So you suggest that I'll have a pre-define resource which will hold > > all the information I need (let's say it is an XML resource) for > > creating the external keyboard. This sounds OK. > > The onl

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-14 Thread Mark Murphy
Menny Even Danan wrote: > OK, thanks. I'll try that. Actually, I hadn't seen Ms. Hackborn's response before replying -- definitely consider following her guidance in this area. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Consulting/App Developme

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-15 Thread sai ongoleee
download free important softwares,movies,games &many more http://www.moreutilities.blogspot.com/ On Sat, Feb 13, 2010 at 11:59 PM, Menny wrote: > So you suggest that I'll have a pre-define resource which will hold > all the information I need (let's say it is an XML resource) for > creating th

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-15 Thread Mark Murphy
jotobjects wrote: > Are the resources of the another application package essentially > public - can any application call Context.createPackageContext() to > get the context of a different application? Yes. It shocked the heck out of me when I realized it. It's possible there are some limits, but I

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-16 Thread Mark Murphy
jotobjects wrote: > For instance with a Context you > can get lists of databases and files and delete them! No, you can't. Linux file permissions will prevent this. > Getting access to MetaData via PackageManager seems reasonable if you > are aware that this is how it works, but the rationale for

Re: [android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-02-16 Thread Dianne Hackborn
On Mon, Feb 15, 2010 at 4:37 PM, jotobjects wrote: > Are the resources of the another application package essentially > public - can any application call Context.createPackageContext() to > get the context of a different application? > Yep all resources are public. This allows other application