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. OOT : Seminar Android vs iPhone

Maaf posting perdana tentang promosi Semianr Android vs iPhone.
Seminar ini tidak ada maksud untuk saling menghantam namun memberikan
wacana dan kebebasan para pengguna smartphone maupun calon pengguna
smartphone.

Seminar ini akan diselenggarakan tgl 24 Juli 2010 di Jogja.
Informasi lebih lanjut 
http://mti.ugm.ac.id/new/?type=news&submenu=news&main_id=25&id=101.
Perbandingan Froyo dan iOS4, 
http://milisdad.blogspot.com/2010/07/android-22-dan-ios4.html

Trims.

-- 
"Indonesian Android Community [id-android]" 

2. Pick a contact - only with phone, email ...

Hi,

I use this code to start the contact app and pick a contact in my app

Intent contactintent = new Intent (Intent.ACTION_PICK);
contactintent.setType(ContactsContract.Contacts.CONTENT_TYPE);
startActivityForResult(contactintent,PICKCONTACT);

and then working with the result in onActivityResult.

But is there a way to tell the contact activity only to show contacts
which have a phone number or an email-adress?

Andreas

-- 

3. Disabling TabWidget

4. Remove me from adroid group

5. How to use libnetfilter_queue in android

6. how to get the actual data of GPS?

7. who can help me