Can you tell me how to make a phone call with onClick function or onEnterFieldOfView ? I can't find the answer in the documentation.
Thanks.
W
Wolfgang Damm
said
over 10 years ago
this is not directly supported in our SDK, as it focuses on the Augmented Reality part. However you can easily achieve that in your own application, by calling a url that starts with architectsdk:// . Please have a look at the SDK documentation on how you can react on these urls from inside your native application.
// getting the values of the contained GET-parameters
for ( NameValuePair pair : queryParams )
{
if ( pair.getName().equals( "id" ) )
{
id = pair.getValue();
}
}
if(id.equals(makeACallCommand))
{
NameValuePair p = queryParams.get(1);
String number = p.getValue();
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:+" + number));
startActivity(intent);
res = true;
}
return res;
}
Olivier.
A
Agustin
said
about 10 years ago
Hello,
does not work, I get the following message: "Page not available".
I'm trying the sample html. Any solutions?
regards
W
Wolfgang Damm
said
about 10 years ago
have you tried what Olivier suggested, which sums it up very good.
If the problem persists after rechecking with the above sample. Please provide your source code and/or a minimal sample that reproduces your problem.
A
Agustin
said
about 10 years ago
Hi I tried that code Olivier, when I click I get an error "page not available, it is possible that the web page architectsdk:/ /handleCommand?id=3&number=+123456789 service is outside". some solution?
W
Wolfgang Damm
said
about 10 years ago
is the url you posted exactly the same url output in the error?
If so, the error is in the URL. It should not contain any space between the slashes.
architectsdk:/ /handle... //should be architectsdk://handle...
A
Agustin
said
about 10 years ago
sorry to be a mistake to write, if the URL has no spaces, that's no problem
A
Andreas Fötschl
said
about 10 years ago
Hi Agustin,
Please have a look at the SimpleARBrowser sample provided in the SDK bundle - It also uses the same mechanism. Also ensure you register the UrlListener properly right after creating the ARchitectView and escape invalid characters when setting document.location value.
Olivier Hugues