3
\$\begingroup\$

I want to make an android application game that uses both android API like Location, even Google Maps API and also use libGDX framework as well. How is this possible?

I noticed there's an Android and a core folder created when making a libGDX project, where do all the classes go, but I'm very confused.

\$\endgroup\$
3
\$\begingroup\$

Anything Android specific should be in your -android project and anything general goes in the -core project.

Normally you'd have an interface in the -core project that is implemented by classes in your -android, -desktop or web project and in your platform specific launcher (for example in AndroidLauncher.java) you'd inject the platform specific implementation of the interface.

\$\endgroup\$
0
\$\begingroup\$

Android specific libraries may be added to the android module only in build.gradle for the overall project.

If your core module relies on android specific modules, you will need to use a different solution for the other modules.

Thus, if you want to use Google Maps API on both Android & Desktop, you will need to utilize a different library for your desktop module.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.