![]() You can create these files by right-clicking on the folder and selecting New->File. Let’s create two new files in the common folder, game.c and game.h. You should now see a new folder in your project called common, linked to the folder that we created. Enter ‘common’ as the folder name and select Finish, then close the Properties window. ![]() ![]() Right-click the project again and select Build Path->Link Source…, select Variables…, select COMMON_SRC_LOC, and select OK.Once that’s done, click OK until the Properties window is closed. Now we can set the body of onCreate() as void onCreate(Bundle savedInstanceState) \.\common’ as the location. We’ll first add two member variables to the top of our activity class: With our project created, we can now edit the default activity and configure it to initialize OpenGL. This will create a new folder called jni in the project tree. When asked for the Library Name, enter ‘game’ and hit Finish, so that the library will be called libgame.so. Once the project has been created, right-click on the project in the Package Explorer, select Android Tools from the drop-down menu, then select Add Native Support…. Leaving the rest as defaults or filling out as you prefer, save this new project in a new folder called android, inside of the airhockey folder that we created in the previous step. To create a new project, select File->New->Android Application Project, and then create a new project called ‘AirHockey’, with the application name set to ‘Air Hockey’ and the package name set to ‘’. To learn more about how to use Git, see the Git documentation. Git is a source version control system that will help you keep track of changes to the source and to roll back changes if anything goes wrong. The first thing to do is create a new Android project in Eclipse, with support for the NDK. You can follow along all of the code at the GitHub project.īefore creating the new project, create a new folder called airhockey, and then create a new Git repository in that folder. To prepare and test the code for this article, I used revision 22.0.1 of the ADT plugin and SDK tools, and revision 17 of the platform and build tools, along with revision 8e of the NDK and Eclipse Juno Service Pack 2. An emulator or a device supporting OpenGL ES 2.0.The Android SDK
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |