How to make a phone call

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

How to make a phone call

Postby s.semeria » Fri Apr 04, 2008 9:34 am

Hi all,

Can you provide some example of how to make a phone call given a phone number?
I think I should fire an Intent in some way using a CALL_ACTION but which URI should I use for phone number?

By the way, How should I send an SMS???

Sorry for these dumb questions :oops: ?
Thanks a lot

Regards,

s.semeria
s.semeria
Junior Developer
Junior Developer
 
Posts: 23
Joined: Mon Jan 28, 2008 10:18 am
Location: Italy

Top

Postby sxjthefirst » Fri Apr 04, 2008 10:06 am

This is the code to make call using the default dialer app in Android.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. IPhone phoneService = null;
  5.  
  6.                 try {
  7.  
  8.                         IServiceManager sm = ServiceManagerNative.getDefault();
  9.  
  10.                         phoneService = IPhone.Stub.asInterface(sm.getService("phone"));
  11.  
  12.                 } catch (Exception e) {
  13.  
  14.                 }
  15.  
  16.                 ;
  17.  
  18.                
  19.  
  20.                 try {
  21.  
  22.                         phoneService.call(number);
  23.  
  24.                 } catch (Exception e) {
  25.  
  26.                 }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


Where number is a string variable which I had set already.
sxjthefirst
Developer
Developer
 
Posts: 36
Joined: Wed Mar 12, 2008 7:24 pm

Postby kali » Fri May 01, 2009 11:35 am

hai i got an errors near
iphone phoneservice=null

ieservicemanager
kali
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 27, 2009 1:31 pm

Postby alpesh_harsoda » Fri May 01, 2009 2:39 pm

kali wrote:hai i got an errors near
iphone phoneservice=null

ieservicemanager


can u describe it?
Regards,
Alpesh Patel,
Logistic Infotech
http://www.logisticinfotech.com
User avatar
alpesh_harsoda
Senior Developer
Senior Developer
 
Posts: 106
Joined: Sat Sep 20, 2008 12:35 pm
Location: Rajkot,Gujarat(India)

Postby kali » Sat May 02, 2009 9:15 am

thanks for reply
IPhone cannot be resolved to a type
and
IServiceManager cannot be resolved to a type
an error near to IServiceManager
kali
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 27, 2009 1:31 pm

Top

Return to General

Who is online

Users browsing this forum: No registered users and 3 guests