5

I'm trying to get an android app running on Google Glass to make a call. This is the code to call the intent:

String uri = "tel:+44....." ;
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(uri));
startActivity(intent);

And this throws the following exception.

09-26 21:57:05.880: E/AndroidRuntime(4995): FATAL EXCEPTION: main
09-26 21:57:05.880: E/AndroidRuntime(4995): android.content.ActivityNotFoundException: 
   No Activity found to handle Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxxxx }
09-26 21:57:05.880: E/AndroidRuntime(4995): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxxxx }

My Glass is bluetooth tethered to my phone, and I can get it to make calls with the "OK Glass, make call to...." command. Am I missing something, or is this Intent not currently supported on Glass ?

Kevin
  • 11,521
  • 22
  • 81
  • 103
  • I see the same issue when I try it. My guess is an apk containing the Call intent would need to be sideloaded in addition, via adb install (much like speech recognition libraries). Or there's a GDK-specific intent we're all not privy to yet... – Bill Sep 27 '13 at 06:07
  • In Mirror API it's called VOICE_CALL, you can try launching Intent with with "android.intent.action.VOICE_CALL" or something similar. – David Vávra Nov 20 '13 at 08:47

2 Answers2

4

It can be done this way for now:

Intent localIntent = new Intent();
localIntent.putExtra("com.google.glass.extra.PHONE_NUMBER", "123-123-123");
localIntent.setAction("com.google.glass.action.CALL_DIAL");
sendBroadcast(localIntent);
Aenterhy
  • 71
  • 1
  • 6
  • 1
    But doing so will freeze the "call" activity in case Glass is not connected to the device with calling capabilities. Is there any simple way to check for the Glass tethering status? (I have added comments to the GDK issue 209.) – joshis Mar 27 '14 at 09:00
1

This seems like a GDK related issue which hasn't yet launched, feel free to file a feature request on our issues tracker and we'll update the bug accordingly.

Alain
  • 6,044
  • 21
  • 27