1 00:00:00,390 --> 00:00:06,210 So, we have walked through both Android and iOS, but we have not shared any code. 2 00:00:07,440 --> 00:00:12,180 We wrote the same code in both platforms to calculate the number of pizzas. 3 00:00:12,180 --> 00:00:16,200 So let's start by creating a service to do the calculations. 4 00:00:16,200 --> 00:00:20,014 In the shared project, create a pizza calculation service, and 5 00:00:20,014 --> 00:00:21,481 add a Calculate method. 6 00:00:41,737 --> 00:00:48,080 The Calculate method uses a string as a parameter and returns a string. 7 00:00:48,080 --> 00:00:53,300 So we can move the int parsing calculation and response into this method. 8 00:00:53,300 --> 00:00:56,787 We could also modify it to return a more informative response. 9 00:01:43,686 --> 00:01:45,446 Now we'll go back to the Android project. 10 00:01:48,166 --> 00:01:52,314 In the main activity, new up a pizzaCalculatorService, and 11 00:01:52,314 --> 00:01:55,518 add the calculate to the click event delegate. 12 00:02:58,467 --> 00:03:02,714 In the iOS project, the ViewController has a similar event handler for 13 00:03:02,714 --> 00:03:07,551 TouchUpInside, which can also be changed to use the pizzaCalculatorService.