Execute Native Android Application

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

Execute Native Android Application

Postby renegade » Wed May 14, 2008 10:25 am

Hey men,

Do anyone knows, how to execute TelephonyProvider.apk or Maps.apk application from my code??

Thanks for help.
Regards.
User avatar
renegade
Freshman
Freshman
 
Posts: 8
Joined: Thu Mar 27, 2008 10:39 am
Location: Bury Technologies

Top

Postby plusminus » Fri May 16, 2008 10:45 am

Hello renegade,

this is done using Intents, like the following code will open the Browser:

(Following syntax works only for old sdk version, but new is very similar)
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. myIntent = new Intent("android.intent.action.VIEW",
  2.  
  3.                     new ContentURI("http://anddev.org/search.php?mode=results&search_keywords='"
  4.  
  5.                               + keyword + "'"));
  6.  
  7. startActivity(myIntent);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Execute Native Android Application

Postby renegade » Fri May 16, 2008 1:40 pm

Ok, but you replied on the spimpliest part of the issue. Browsing website in default application is quite easy.
What about running Maps application, or application made by me installed on system (/data/app/*.apk, /system/app/*.apk)?
Is there any chance to run application indicated by path, for example "/system/app/ContactsProvider.apk".

Regards.
User avatar
renegade
Freshman
Freshman
 
Posts: 8
Joined: Thu Mar 27, 2008 10:39 am
Location: Bury Technologies

Postby plusminus » Fri May 16, 2008 2:50 pm

Hello renegade,

the path/name of the *.apk should not matter at all. Intents are a very basic Android-concept. Opening maps works almost the same, simply use something like "geo:lat,lng" as the Uri.

Anyway I don't know the answer to your main problem, as I was never doing such things.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 17 guests