Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Android Studio Stormy Project Question (In particular Step titled "Starting at the Center"

When I open up android and am following with the course, i notice that on the activity.main.xml page I don't have a phone in the center of the screen like the teacher does. Instead, for some reason I have a like a box that shows what my emulator is displaying but it doesn't show the hard shell of the phone. This is a issue because under my component tree I don't have a setting like the teacher does titled device screen and then the whole custom view support design widget coordinator layout. Does anyone know how I can set this up so I can follow this step in the course. Thank you for your help.

3 Answers

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Hey Shamil! Sometimes with new versions of Android Studio they make things look a little bit different. I think that's what's happened here. So don't worry too much if things look different! The important thing is that the underlying XML code is all the same.

Hey Ben,

Thanks for the message. However, the part of the course I'm stuck on is designing the UI and because what I have looks different from the instructor and since I'm still a bit of a beginner, it is hard to follow around. Is there a way I can show you an image of what I'm talking about in terms of what I see on my screen versus what is on his screen, and are there any ways to do the same thing that he is doing despite newer versions of android?

Thank you,

Ben Deitch
Ben Deitch
Treehouse Teacher

If you'd like to share a pic of something, you could take a screenshot of it and then upload the image to imgur or some other image host. After that you can just share a link to it :)

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

It looks like when you created the app you picked a 'Basic Activity' instead of an 'Empty Activity'. Here's the layout that gets generated for an 'Empty Activity'; you can just copy and paste this onto the 'Text' tab and you should be good to go.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"/>
</RelativeLayout>