Executing demo project for Android
Well the last section was about executing the project in Windows but this section is far more exciting then last one as in this section we will focus on how to execute the demo project in your own Android phone or in a AVD . AVD stands for Android Virtual Device which means if you dont want to test the application on your real android device for any reason you can test on this virtual device . Follow the steps ahead
- For my case I need to run versionpb-android .Right click versionpb-android in Eclipse , Select Run As and select Android Application
- Doing that Android device chooser will open up as screen below
The Upper Section is for a running android device i.e. a real android device connected to your laptop/machine with USB and with USB debugging enabled . Lets enable developer options in the mobile phone .
I am using Samsung Galaxy S3 whose developer options are found in Settings -- > More . by default developer options are hidden . To know how to un hide it , read this blog .
Once developer options are visible , turn USB debugging on and connect device with your laptop/machine . You will see a message on my mobile stating Allow USB debugging ?
Click OK and you will see your device as in Online State in Android device Chooser . See screenshot below :
Select this device in Android device chooser and click OK . Doing that Demo app will open up in your mobile device .
You may get an error stating unfortunately the android has stopped i.e. your android app may crash as It happened with me as well .
To fix this :
- right click your android project
- Select properties
- Select Java Build path
- it will be something like below :
- Check all the unchecked values and click OK .
- Remove your device from your laptop USB .
- Clean and build your project by Clicking Clean as below :
- Add your device back to USB with machine . Allow USB Debugging and run the android project again .
- This time you will see demo app running on your mobile .
To run this on a virtual device you need to create a virtual device .Read following to know How to create a virtual device .
Once your Android Virtual Device i.e. AVD is seen in the list of AVDs , Select the AVD and click OK and you will see demo project running on your AVD as per screenshot below :
Table of Contents
- Overview of libGDX
- Environment SetUp
- Creating Project in libGDX
- Importing Projects in Eclipse
- Executing demo project for Windows
- Executing demo project for Android
- Executing demo project for HTML5
- Developing a real flappy bird game remake game using libGDX from scratch
- Environment Set Up for Game
- Understand basics of Game
- Exploring States and Game State Manager
- Create Play State and Make Bird Fly
- Building Obstacles and flying through them
- Collision and sound effect
- Porting the Game in Android Device
- libGDX More possibilities to Brisky Demo