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 Build a Simple Android App (2014) Creating the Screen Layout Changing Text Size

rameez j
rameez j
1,487 Points

Can Android App UI be design using HTML and CSS?

I'm bit surprised to know the way we design android app UI using xml layouts, just curious to know if it can be possible using simple HTML, CSS?

activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent" >

  <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:text="Treehouse loves me!"
    android:textSize="16sp" />

</RelativeLayout>

1 Answer

Not really, if you are developing a native Android application that uses Android's UI elements. HTML and CSS are for the DOM, which is... different. You can however make Android applications using web technology stack by using something like Apache Cordova - it will be written in JavaScript and won't have the native look, however.

rameez j
rameez j
1,487 Points

Thanks for your reply. Good to know native app concept. I also just came to know about phonegap which similar to Apache Cordova i guess. But if you want your app to be multi-platform like iOS as well then instead of developing for both separately and managing them it would be much easier to go with frameworks like this.