It has been a long way till here. You are now about to generate an Android Application PacKage (apk) file for your own game. Fortunately, the hardest part is done and creating it is quite easy.
You will also discover some features to explore that Google provides to enrich your game experience as much to players as to developers.
All you need to go further on this recipe is a Libgdx Android project, for instance, samples-android
along with the core one, such as samples-core
. Make sure you have the
Android Development Tools (ADT) plugin installed in your Eclipse IDE. It is available at http://developer.android.com/sdk/installing/installing-adt.html.
Once the environment is properly set up, the process is quite simple:
Enter a system path to store it along with a filename and a password. Click on Next.
In order to create a private key for our keystore, enter an alias (it will just be useful to identify that key), password, validity (in years), and some personal data (first and last name or organization is enough). Click on Next.
.apk
file and click on Finish.Your file is now ready to be uploaded to Google Play. All you have to do is link your Google account to your developer console. You can get access to such a console from https://play.google.com/apps/publish/.
It has cost of $25 that you just have to pay once.
Once inside, you will have a control panel to manage your app's life cycle: uploading, updating, maintaining, and removing.
Note that you can also distribute your application out of the market by enabling Unknown sources (Settings | Security) installations in the device.
It is important to point out that Libgdx 1.0.0 and above can officially export to Android 2.2 or higher because it removes the support for OpenGL ES 1.x while preliminarily adding it for OpenGL ES, 3.0 although it is not stable yet. If you are interested in deploying for earlier Android versions, please use Libgdx 0.9.9. Be aware that incompatible features with the final device will just do nothing.
Google Play Developer Console also provides you with a Game services option. You can find it within the touchpad tab:
After accepting different Google Terms of Service, you will be allowed to add new games to your space. In this way, you will enable support for leaderboards, saved games, quests, rewards, and multiplayer. You can learn more about that at https://developers.google.com/games/services/.
The first step to integrate the service with your code is by installing Google Play Games Services within your Android SDK. Then, import as a library a copy of the project placed at <android-sdk>/extras/google/google_play_services/libgproject/google-play-services-lib/
. Then, make your project depend on it and add the following lines to your manifest:
<meta-data android:name="com.google.android.gms.version"android:value="@integer/google_play_services_version" />
Finally, import the BaseGameUtils
project that you can find within the Google Play Game Services GitHub space at https://github.com/playgameservices/android-basic-samples/tree/master/BasicSamples/libraries/BaseGameUtils.
18.221.254.61