Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

Where is Fun Facts Project, I need to import into Android Studio?

Where is (Fun Facts Project), I need to import into Android Studio?

Hi Cecilia,

What is it you need here? The project files are usually downloadable from the bottom of the screen where the video is located. But, generally, you write the code yourself rather than relying on these projects files - they are more for when things go very wrong!

Sorry if I have misunderstood your question.

Steve.

5 Answers

I am taking Android Development for Beginners... The instructor mentioned the Project "Fun Facts"... and said after I downloaded Android Studio "Set up" that our project should look like his project... So now I am totally lost (I have not learned enough about programming to program it ourselves),,, because my project (xml file/design) looks nothing like the teacher's example of "Fun Facts Project"... So I assume there is a -IMPORT- for "Fun Facts" that goes along with this lesson, but I am unable to find it...

OK - let me try to assist. In the beginning of this course, you start with "Getting Started with Android" - that does some intro work, then goes into a bit of Java stuff, intros the Android Studio then theres a segment called "Creating the Fun Facts Project". Is that where you are up to?

yes..

I'm following this video now to see what I get faced with when the project builds.

In the video, the projects lands in the xml view of activity_fun_facts.xml - I'm not sure if that is normal behaviour so I'll see for myself and get back to you. (It's running a load of Gradle stuff right now).

I'll be back with you as soon as it's finished indexing and whatever else it wants to do!

What have you got on your screen? Are you using Windows or Mac?

I am using mac... and the teacher has (only) activity xml... I have activity & content xml... and what the teacher has on (his) activity xml... is on (my) content xml...

Hi Cecilia,

Apologies for the delay - I had to go out. Back now for a little while.

I see your problem, yes. I have copied the contents of "content.xml" and replaced the content of activity.xml with that copy, ith the exclusion of the first line. So, I retained the first line of activity (that is about xml version encoding).

Then I have deleted content.xml.

Inside what is now activity.xml, there is a reference to showIn - I have deleted that too.

Now, inside the java code, in FunFactsActivity.java I have deleted a whole chunk of code. That may have ramifications later on - I don't know. But if you find open the Java folder on the left in the Project Explorer, find that file you will see a section of code that starts with protected void onCreate. Delete all but the first two lines.

Leave this:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fun_facts);
// I DELETED A LOT OF CODE HERE!! 
    } 

  @Override
.
.

I think that leaves you in the same position as Ben Jakuben starts this project.

Shout if you need more help - I am around some of this evening and all day tomorrow. (I'm on UK time - nearly 7pm here now).

Steve.

Sorry it took so long to get back to you...but what you said really helped... Again...Many Thanks...

Hey, no problem! As long as you got sorted, that's great.

Steve.

What are the best practices for what dependencies to set in android studio (library)

I'm not best placed to answer that as I'm no expert. However, I'd say that there are some good tips to follow to ensure your project behaves as expected.

  1. Only import a dependency if it is needed
  2. Use explicit versioning so use compile "alibrary :12.3.2" rather than compile "alibrary : 12.+" That helps with consistent performance
  3. Select remote dependencies over local ones - this keeps your app nimble

There will be lots of different opinions out there, I am sure and many that I wouldn't be able to agree or disagree with through lack of knowledge!