Android Programming Tutorials

(Romina) #1

TUTORIAL 36


Asking Permission to Place a


Call


In this tutorial, we will add a bit of code that asks permission to place a call,


and we will add a phone number to our restaurant data model and detail


form. Then, we will actually place the call.


Step-By-Step Instructions........................................................................


First, you need to have completed the previous tutorial. If you are


beginning the tutorials here, or if you wish to not use your existing work,


you can download a ZIP file with all of the tutorial results, and you can copy


the 35-AdvAppWidget edition of LunchList to use as a starting point.


Step #1: Add a Phone Number to the Database Schema.................


Schema


If we want our phone numbers to stick around, we need to put them in the


database.


With that in mind, update RestaurantHelper to use the following


implementation of onCreate():


@Override
public void onCreate(SQLiteDatabase db) {

339
Free download pdf