How to programatically launch an installed app?

by Yasser » Sat, 11 Jul 2009 04:02:29 GMT


Sponsored Links
 Hi,

I want to launch/start an already installed application like
Calculator on Android and then send some keystrokes to it.

Is there a way to programatically launch an app without having access
to its code?

Thanks
Yasser
--~--~---------~--~----~------------~-------~--~----~



How to programatically launch an installed app?

by Mark Murphy » Sat, 11 Jul 2009 04:24:13 GMT


 


You cannot send keystrokes to other applications.


If you can find out an Intent that launches it, you use startActivity()
like you would any other activity. Finding the proper Intent can be a
bit tricky, though there are methods on the PackageManager class that
may help you identify what is launchable.

Bear in mind, though, that unless those Intents are publicly documented,
they are likely to break in future releases of Android (or of whatever
3rd party app you attempt to launch).

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Need help for your Android OSS project?  http://wiki.andmob.org/hado 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to programatically launch an installed app?

by Yasser » Sat, 11 Jul 2009 07:02:23 GMT


 To know the intent for an activity in order to launch it, do I need to
have access to the app source code?






--~--~---------~--~----~------------~-------~--~----~



How to programatically launch an installed app?

by Mark Murphy » Sat, 11 Jul 2009 07:05:46 GMT


 


Ideally, you have documentation telling you "hey, it is perfectly
acceptable to use this Intent to launch my application: ...".

Now, you can find out possible Intents other ways -- use PackageManager,
watch messages in LogCat, examine the source code -- but any of those
techniques may result in you creating something that will be unsupported
over time.

So, no, you do not necessarily need the source code, though it helps.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android Development Wiki:  http://wiki.andmob.org 

--~--~---------~--~----~------------~-------~--~----~



How to programatically launch an installed app?

by Yasser » Sat, 11 Jul 2009 07:40:44 GMT


 Thanks a lot Mark, that clarified my doubts.





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. mouse hover events

Hello,

Is there a implementation for Mouse Hover events in Android? I want
basically the CSS hover to work on my browser, since I am using the non
mobile platform. And further the views should receive the mouse enter and
mouse leave events.

For mouse cursor I applied the x-86 mouse support patch.

regards
-Nitin

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. ADT causing CDT to build all C projects on Android app launch??

Hey guys,

I doubt there are too many people who run CDT in eclipse for native
apps also with ADT installed for Android, but in the off-chance that
someone here knows anything about this, my problem is that any time I
run any android app, my C builder kicks in for projects totally
unrelated.  I have no idea why and have been digging through settings
on everything, unable to find out why.  All I can think is that the
ADT pre-launch process triggers it via a refresh or some kind of catch-
all type call in eclipse API land that I'm unaware of.

Does anyone know anything about this?  It's very annoying to have a C
builder run for a different project than the one you're working on
every time you launch the app.

-- 

3. Debugging power management - how to determine cpu state?

4. javalib.jar erro

5. Error when build Froyo for Emulator

6. Getting "A test that was a known failure actually passed. Please check. "

7. Getting "A test that was a known failure actually passed. Please check. "