Jump to content

  • Log In with Google      Sign In   
  • Create Account


Developing different views for different android devices?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 jblevins1991   Members   -  Reputation: 99

Like
0Likes
Like

Posted 08 April 2012 - 03:21 PM

I have my main.xml page designed for tablets becuase they have more screen space. I made a second xml file named phone.xml and i was wondering if anybody knows how to make the app check what device is using the app and automatically change depending on if it is a tablet or smartphone.

So if it's a tablet it will use main.xml and if its a smart phone it will use phone,xml for the menu.

Sponsor:

#2 Bruce Sutherland   Members   -  Reputation: 126

Like
0Likes
Like

Posted 08 April 2012 - 08:43 PM

I think what you're looking for is a concept in the Android SDK known as Fragments.

You can find a full explanation of these here:

http://developer.android.com/guide/topics/fundamentals/fragments.html

#3 Zael   Members   -  Reputation: 154

Like
0Likes
Like

Posted 10 April 2012 - 11:05 AM

You may want to look into providing alternative resources from the sdk documentation

#4 TechnoGoth   Crossbones+   -  Reputation: 2649

Like
0Likes
Like

Posted 24 April 2012 - 05:58 AM

You may want to look into providing alternative resources from the sdk documentation


This is the easiest way to go for what you are looking to do. Its actually one of androids most powerful features.

Essentially you create two layout folders
layout
layout-xlarge

you place all your tablet specific layouts in the layout-xlarge and they will automatically be used on those devices. You don't need double up either so if you have the same layout on both the phone and tablet you just place it in the layout folder and it will be used everywhere.

You can do all sort of complicate layout changes using this method like:
layout-land and layout-xlarge-land if you want to use a different layout when the phone is in landscape mode.

Writing Blog: The Aspiring Writer

 

Novels:
Legacy - Black Prince Saga Book One - By Alexander Ballard

Current Projects: Rags to Riches -prototype increment game - Design V1

Android Apps:





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS