== Installing the Google Play Billing Library ==
 
== Installing the Google Play Billing Library ==
   −
A prerequisite to implementing Google Play In-app Billing is that the Google Play Billing Library be installed on the development system. Check whether or not the library is installed by launching the Android SDK Manager by selecting Configure -> SDK Manager from the Android Studio welcome screen, or via the Tools -> Android -> SDK Manager menu of the main window. Once the SDK Manager has loaded, scroll down to the Extras section and check the Status column next to the Google Play Billing Library entry as shown in Figure 53-1:
+
A prerequisite to implementing Google Play In-app Billing is that the Google Play Billing Library be installed on the development system. Check whether or not the library is installed by launching the Android SDK Manager by selecting Configure -> SDK Manager from the Android Studio welcome screen, or via the Tools -> Android -> SDK Manager menu of the main window. Once the SDK Manager has loaded, scroll down to the Extras section and check the Status column next to the Google Play Billing Library entry as shown in Figure 55-1:
       
[[Image:android_studio_install_billing_library.png|Adding the Google Play Billing library to Android Studio]]
 
[[Image:android_studio_install_billing_library.png|Adding the Google Play Billing library to Android Studio]]
 
   
 
   
Figure 53-1
+
Figure 55-1
       
The objective of this tutorial is to create a simple application that uses the Google in-app billing system to allow consumable purchases to be made. The application will consist of two buttons, one of which will be disabled by default. In order to enable the button so that it can be clicked, the user must purchase a “button click” item by clicking on the second button and completing a purchase. The first button will then be enabled for a single click before being disabled again until the user makes another purchase.
 
The objective of this tutorial is to create a simple application that uses the Google in-app billing system to allow consumable purchases to be made. The application will consist of two buttons, one of which will be disabled by default. In order to enable the button so that it can be clicked, the user must purchase a “button click” item by clicking on the second button and completing a purchase. The first button will then be enabled for a single click before being disabled again until the user makes another purchase.
   Exception encountered, of type "Error"
[1fd28493] /index.php?title=An_Android_Studio_Google_Play_In-app_Billing_Tutorial&diff=17237&oldid=17033 Error from line 434 of /home/techotopia/includes/diff/DairikiDiff.php: Call to undefined function each()
Backtrace:
#0 /home/techotopia/includes/diff/DairikiDiff.php(544): DiffEngine->diag()
#1 /home/techotopia/includes/diff/DairikiDiff.php(344): DiffEngine->compareSeq()
#2 /home/techotopia/includes/diff/DairikiDiff.php(227): DiffEngine->diffLocal()
#3 /home/techotopia/includes/diff/DairikiDiff.php(721): DiffEngine->diff()
#4 /home/techotopia/includes/diff/DairikiDiff.php(859): Diff->__construct()
#5 /home/techotopia/includes/diff/DairikiDiff.php(980): MappedDiff->__construct()
#6 /home/techotopia/includes/diff/TableDiffFormatter.php(194): WordLevelDiff->__construct()
#7 /home/techotopia/includes/diff/DiffFormatter.php(140): TableDiffFormatter->changed()
#8 /home/techotopia/includes/diff/DiffFormatter.php(82): DiffFormatter->block()
#9 /home/techotopia/includes/diff/DifferenceEngine.php(881): DiffFormatter->format()
#10 /home/techotopia/includes/diff/DifferenceEngine.php(797): DifferenceEngine->generateTextDiffBody()
#11 /home/techotopia/includes/diff/DifferenceEngine.php(728): DifferenceEngine->generateContentDiffBody()
#12 /home/techotopia/includes/diff/DifferenceEngine.php(662): DifferenceEngine->getDiffBody()
#13 /home/techotopia/includes/diff/DifferenceEngine.php(632): DifferenceEngine->getDiff()
#14 /home/techotopia/includes/diff/DifferenceEngine.php(453): DifferenceEngine->showDiff()
#15 /home/techotopia/includes/page/Article.php(797): DifferenceEngine->showDiffPage()
#16 /home/techotopia/includes/page/Article.php(508): Article->showDiffPage()
#17 /home/techotopia/includes/actions/ViewAction.php(44): Article->view()
#18 /home/techotopia/includes/MediaWiki.php(490): ViewAction->show()
#19 /home/techotopia/includes/MediaWiki.php(287): MediaWiki->performAction()
#20 /home/techotopia/includes/MediaWiki.php(714): MediaWiki->performRequest()
#21 /home/techotopia/includes/MediaWiki.php(508): MediaWiki->main()
#22 /home/techotopia/index.php(41): MediaWiki->run()
#23 {main}