How to open one application from another one?

Put your problem here if it does not fit any of the other categories.

How to open one application from another one?

Postby prajkti.khadse » Mon Apr 06, 2009 6:07 am

Hi all

i want to open another Android application from my application.

for example, when i click on a button, it should open the Messaging application for me, so that i can send SMS.

can anybody please help me... ???!!! :roll:
prajkti.khadse
Developer
Developer
 
Posts: 32
Joined: Thu Mar 19, 2009 1:01 pm
Location: Bangalore

Top

Postby WarrenFaith » Tue Apr 07, 2009 7:57 am

The keyword for you is "Intend" :arrow: http://developer.android.com/guide/topi ... lters.html
Look for ACTION_VIEW as an example...
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby prajkti.khadse » Tue Apr 07, 2009 9:41 am

Thanks WarrenFaith...

but what i actually want is to open an Android's Camera Application or Messaging application (which obviously i haven't written...) through my Application when i click on some Button....

Ssooo, how would i know which activity to start...??? :?:

Can you please help...
prajkti.khadse
Developer
Developer
 
Posts: 32
Joined: Thu Mar 19, 2009 1:01 pm
Location: Bangalore

Postby WarrenFaith » Tue Apr 07, 2009 10:05 am

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent intent = new Intent(Intent.ACTION_VIEW);
  2.  
  3.         Cursor cursor = (Cursor) myAdapter.getItem(position);
  4.  
  5.         long phoneId = cursor.getLong(cursor.getColumnIndex(People.PRIMARY_PHONE_ID));
  6.  
  7.         intent.setData(ContentUris.withAppendedId(Phones.CONTENT_URI, phoneId));
  8.  
  9.  
  10.  
  11.         startActivity(intent);
  12.  
  13.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

This simple example shows you, how you could use the default Contact View.

I think you have problems to understand, that there is no "application", there are simply activities, which are called.
Thats a design pattern of android. You call an activity of whatever you want. Find the entry activity and call the intent for this activity.
Just check Intent.ACTION_**** and you will find what you need.
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Postby prajkti.khadse » Tue Apr 07, 2009 2:33 pm

Thank you ssooo much WarrenFaith for your reply...

actually m very new to Android and tht's why my Understanding for the same is very less....!!!!
prajkti.khadse
Developer
Developer
 
Posts: 32
Joined: Thu Mar 19, 2009 1:01 pm
Location: Bangalore

Postby WarrenFaith » Tue Apr 07, 2009 3:08 pm

Your welcome.
I started a month ago :)
WarrenFaith
Moderator
Moderator
 
Posts: 227
Joined: Fri Mar 13, 2009 10:59 am
Location: Berlin, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 13 guests