Android Phone Call Tutorial using Basic4Android
Submitted by donbermoy on Thursday, January 30, 2014 - 11:03.
In this tutorial, i will introduce another kind of application in which it can dial the number you wanted to call. I call this Phone Call Application. P.S This project is developed in Basic4Android 2.47, and tested with Android 4.0.1.
On this, you need to create one button and named it as "Call". Next, named your abstract design as "main". Your abstract designer will be like this one below:
Declare your variable in the Sub_Global like this:
Now your activity when run will look like this:
Next, type the following code below. That code means to call a phone number when our Button Call will click.
When clicking this button it will have this image:
The MakeCall here is the method used to dial a number and then call. LoadBitmap(File.DirAssets,"call.png") this syntax refers to adding of image in the phone call.
Here's the full code of this tutorial:
When dialing the number and click the button call. This will display this image:
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware
- Sub Globals
- 'These global variables will be redeclared each time the activity is created.
- 'These variables can only be accessed from this module.
- Dim ph As ICOSPhone
- Dim Call As Button
- End Sub
Dim ph As ICOSPhone
- ph here is our variable for ICOSPhone in which it has all the necessary libraries in using phone utilities.
Dim Call As Button
- we use a button to make a call from the phone.
Now create a new activity. It should look like this:
- Sub Activity_Create(FirstTime As Boolean)
- 'Do not forget to load the layout file created with the visual designer. For example:
- Activity.LoadLayout("main")
- End Sub
- Sub Call_Click
- ph.MakeCall(LoadBitmap(File.DirAssets,"call.png"))
- End Sub
- Sub Process_Globals
- 'These global variables will be declared once when the application starts.
- 'These variables can be accessed from all modules.
- End Sub
- Sub Globals
- 'These global variables will be redeclared each time the activity is created.
- 'These variables can only be accessed from this module.
- Dim ph As ICOSPhone
- Dim Call As Button
- End Sub
- Sub Activity_Create(FirstTime As Boolean)
- 'Do not forget to load the layout file created with the visual designer. For example:
- Activity.LoadLayout("main")
- End Sub
- Sub Activity_Resume
- End Sub
- Sub Activity_Pause (UserClosed As Boolean)
- End Sub
- Sub Call_Click
- ph.MakeCall(LoadBitmap(File.DirAssets,"call.png"))
- End Sub
Add new comment
- 269 views