How to programatically launch an installed app?

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

Sponsored Links

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?


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)  | 

Need help for your Android OSS project? 


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)  | 

Android Development Wiki: 


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. Query in Android Application development

Hi to all!!

         I am Raghav Rajagopalan from Chennai, India. I am a Android
application developer. I am new to this domain. I am working on building a
application. I have few queries. I hope you can help me out in solving my

My requirements are:

1. I have a Login Screen created. I need to create a SqLite DB to check if
user is a valid one or not.
2. If valid user navigate to my web site.
3. If new user he needs to register first.
3a. To register he needs click on the Register now button in Login screen,
Which will navigate user to my website for registration.
3b. After registeration i need to come back to login screen using a back
button in the Registeration screen(website).

I have designed the layout.

This is my task. I have tried many ways in developing this issue. But hardly
never worked fine for me.

Its my kind request to you to help me out in this issue.

Thanks in advance.

Raghav Rajagopalan


2. [WTA] Restore backup gagal

Dear RR,

niubi mo nanya dan minta saran suhu2 dan senior2 di sini mengenai restore
backup an data (nandroid)...mohon bantuan nya yaq..

jadi gini, kemaren pas iseng2 mau coba rom baru, wa backup rom dulu dari
recovery cwm..setelah selesai, wa boot lagi seperti biasa..karena kapasitas
sdcard masih kecil (2gb, belum sempet beli yg gedean), wa pikir untuk
menghemat space nya, wa copy file backup an nya itu, yg di
/clockworkmod/backup ... ada satu folder sesuai nama file yg wa kasih (sebut
saja backup1)..nah, kemudian folder backup1 itu wa copy semua dan paste ke
harddisk komputer..semua berjalan lancar..

kemudian, setelah puas coba2 rom baru, wa memutuskan ingin kembali saja ke
rom yg sebelum nya..cara yg di tempuh, wa copas lagi 1 folder semua itu
(backup1) ke folder semua ( /clockworkmod/backup/ ) ... kemudia boot ke
recovery..pilih yang 'backup and restroe', kemudian pilih 'restore'.. nah,
cuma ada satu pilihan disana : backup1/ ....

tapi masalah nya setelah pilih restore file itu, muncul error message :

Checking MD5 sums....

MD5 mismatch!!

kira2 masalah nya di mana ya? apa ada file yg hilang atau langkah2 yg

mohon saran dan pencerahan dari rekan2 sekalian...

makasih sebelum nya...


3. [WTI] Penyerahan Dana Partisipasi id-android untuk Bro Rheza Christian.

4. Bluetooth killer availabled in Android ? - WiFi Direct

5. Penyerahan Dana Partisipasi id-android untuk BroRheza Christian.

6. WTPamer : Livehome di juned

7. Finding the ID of the current layout