0

Is it possible to launch any third party application from my application on Android Auto I couldn't find anything mentioned on this anywhere.

Note: Please note "Android Auto" (Car) words here. I am not asking for android mobile application.

Shog9
  • 156,901
  • 35
  • 231
  • 235
Ankur
  • 602
  • 8
  • 24
  • To do this you have to open intent of that application for eg:final ComponentName name = new ComponentName("com.whatsapp", "com.whatsapp.ContactPicker"); Intent oShareIntent = new Intent(); oShareIntent.setComponent(name); oShareIntent.setType("text/plain"); oShareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Your Message"); startActivity(oShareIntent); – Key_coder Jan 07 '15 at 10:27
  • @shkschneider I have not yet started developing app for android auto. Before I start on it, just wanted to confirm if it's possible. I saw 2 examples available with android sdk & noticed that all the tasks are accomplished by using services or receivers; and very limited functionality is available with only 2 types of applications (messaging or audio), so wondering if it would be possible to launch one android auto app from another using startActivity() call. – Ankur Jan 07 '15 at 10:29
  • @ManuZi Link you gave is for launching other app on android mobile & not on android auto. – Ankur Jan 07 '15 at 10:32
  • @Gaurav I know how to accomplish this task for normal android app. But if anybody has already tried, will the same code launch third party app in android car as well? – Ankur Jan 07 '15 at 10:36
  • @Ankur I think it should work like same but I'm not sure as android auto is still under development – Key_coder Jan 07 '15 at 10:44

2 Answers2

2

Idea of android auto is completely different from what you are trying to do.

Android auto provides a platform where it has done the basic things with a good user interface making sure not to distract user much.

All that you need to do is provide services which this platform can use. As of now you can provide Music and Messaging services which are compatible with android auto.

Aun
  • 1,883
  • 1
  • 17
  • 26
-1

You can launch applications code something like

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.example.youpackage", "com.example.LauchActivity");
startActivity(intent);

And if you want get all possible application list for launch.code :

Declare you intent and add value you want pass

PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0);
boolean isIntentSafe = activities.size() > 0;
if (isIntentSafe) {
    startActivity(mapIntent);
}

And another way to start you specific application

PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("com.example.package");
startActivity(intent);
Rajith Rajan
  • 121
  • 7
  • Have you experimented similar code on Android Car app? My question is for car app (Android Auto) & not the normal android mobile app. Please check the comments above following the question. – Ankur Jan 07 '15 at 11:20
  • Oh sorry ..Accidentally posted – Rajith Rajan Jan 07 '15 at 11:34