How to import source code into Android Studio?

Forum for the book "Beginning Android Games", see http://www.apress.com/9781430230427

How to import source code into Android Studio?

Postby smith » Tue Jul 09, 2019 11:08 pm

I'm using Android Studio 3.4.1, and so far, I'm unable to import the source code.

I downloaded the zip file and unzipped all of the files.

From Studio, I select import project, select the Ch 6 Mr Nom folder, but it's unable to import it.
I've tried a number of different options, but all end in an error of some sort (eg: no android module found, or "This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.")

Has anyone else imported the code successfully?

Very bad assumption on my part, thinking this book I just bought (latest version) would use Android Studio. Very bad.
smith
 
Posts: 2
Joined: Tue Jul 09, 2019 10:57 pm

Re: How to import source code into Android Studio?

Postby smith » Thu Jul 11, 2019 9:31 pm

Nobody?

I was really hoping that one of the "Beginning Android Games" authors, ie. Zechner, DiMarzio or Green would be hanging around here.

Their book says to use this forum to contact them, and that it's their preferred method.

It also says "For each chapter that contains code, there's and equivalent Android Studio project." (Introduction, page xxvi)

Sadly, it doesn't say where to get those project files.

Anyone know where those are? The link in the book takes me to the eclipse project files on github.
smith
 
Posts: 2
Joined: Tue Jul 09, 2019 10:57 pm

Re: How to import source code into Android Studio?

Postby evilentity » Fri Jul 12, 2019 11:40 am

Latest does not mean recent.
This seems to be somewhat recent code for this book
https://github.com/Apress/beg-android-games-3ed
looks like ch6 is missing some gradle files, you should be able to simply copy the source from it into one of the other chapters. Might need to change main class as well in that case.
Looking for a freelancer? PM me!
Check out libgdx discord server!
evilentity
 
Posts: 4866
Joined: Wed Aug 24, 2011 11:37 am

Re: How to import source code into Android Studio?

Postby prasadab » Sun Dec 29, 2019 5:44 am

Import to Android Studio

1. In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
Click Import Project.
2. Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.
3. In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)
4. That's all you need to do.
prasadab
 
Posts: 1
Joined: Sun Dec 29, 2019 5:40 am


Return to Beginning Android Games

Who is online

Users browsing this forum: No registered users and 1 guest