I need to adjust relative layout to 480 x 800 screen












0















i have design an calculator app
in nexus 6 resolution but when i play the app in 400 x 800 hdpi it all break
mean app don't look same one button on other corner and one on other hope you got it i want my application to work on all screen sizes my app is design in relative layout i don't want to change
help thanks



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/minus"
android:layout_marginEnd="-103dp"
android:layout_toStartOf="@+id/minus"
android:text="+" />
<Button
android:id="@+id/Relative_Number"
android:layout_width="163dp"
android:layout_height="59dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="241dp"
android:text="Click Me" />
<Button
android:id="@+id/divide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/plus"
android:layout_marginEnd="116dp"
android:text="/" />
<Button
android:id="@+id/minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="107dp"
android:layout_marginTop="285dp"
android:text="-" />
<Button
android:id="@+id/multiply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/textView"
android:layout_alignTop="@+id/plus"
android:text="*" />
<TextView
android:id="@+id/textView"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="168dp" />
<TextView
android:id="@+id/result"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="23dp"
/>
<EditText
android:id="@+id/num1"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="106dp"
android:hint="Please Enter Your First Number"
android:inputType="number" />
<EditText
android:id="@+id/num2"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="187dp"
android:hint="Please Enter Your 2nd Number"
android:inputType="number" />
</RelativeLayout>









share|improve this question

























  • Much of your design uses de-facto absolute positioning. Try to position elements relative to each other. Only if this is not possible for some reason, use dimensions that depend on the screen size.

    – Henry
    Nov 20 '18 at 6:43











  • @Jasir ali - you need to practice with all layout

    – AD 10
    Nov 20 '18 at 6:51











  • and dont put static size use SDP for all predefine devices- github.com/intuit/sdp

    – AD 10
    Nov 20 '18 at 6:52











  • RelativeLayout is only not a good or proper way to achieve your task

    – AD 10
    Nov 20 '18 at 6:53











  • can any one provide me solution or code

    – Jasir Ali
    Nov 20 '18 at 7:44
















0















i have design an calculator app
in nexus 6 resolution but when i play the app in 400 x 800 hdpi it all break
mean app don't look same one button on other corner and one on other hope you got it i want my application to work on all screen sizes my app is design in relative layout i don't want to change
help thanks



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/minus"
android:layout_marginEnd="-103dp"
android:layout_toStartOf="@+id/minus"
android:text="+" />
<Button
android:id="@+id/Relative_Number"
android:layout_width="163dp"
android:layout_height="59dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="241dp"
android:text="Click Me" />
<Button
android:id="@+id/divide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/plus"
android:layout_marginEnd="116dp"
android:text="/" />
<Button
android:id="@+id/minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="107dp"
android:layout_marginTop="285dp"
android:text="-" />
<Button
android:id="@+id/multiply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/textView"
android:layout_alignTop="@+id/plus"
android:text="*" />
<TextView
android:id="@+id/textView"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="168dp" />
<TextView
android:id="@+id/result"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="23dp"
/>
<EditText
android:id="@+id/num1"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="106dp"
android:hint="Please Enter Your First Number"
android:inputType="number" />
<EditText
android:id="@+id/num2"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="187dp"
android:hint="Please Enter Your 2nd Number"
android:inputType="number" />
</RelativeLayout>









share|improve this question

























  • Much of your design uses de-facto absolute positioning. Try to position elements relative to each other. Only if this is not possible for some reason, use dimensions that depend on the screen size.

    – Henry
    Nov 20 '18 at 6:43











  • @Jasir ali - you need to practice with all layout

    – AD 10
    Nov 20 '18 at 6:51











  • and dont put static size use SDP for all predefine devices- github.com/intuit/sdp

    – AD 10
    Nov 20 '18 at 6:52











  • RelativeLayout is only not a good or proper way to achieve your task

    – AD 10
    Nov 20 '18 at 6:53











  • can any one provide me solution or code

    – Jasir Ali
    Nov 20 '18 at 7:44














0












0








0








i have design an calculator app
in nexus 6 resolution but when i play the app in 400 x 800 hdpi it all break
mean app don't look same one button on other corner and one on other hope you got it i want my application to work on all screen sizes my app is design in relative layout i don't want to change
help thanks



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/minus"
android:layout_marginEnd="-103dp"
android:layout_toStartOf="@+id/minus"
android:text="+" />
<Button
android:id="@+id/Relative_Number"
android:layout_width="163dp"
android:layout_height="59dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="241dp"
android:text="Click Me" />
<Button
android:id="@+id/divide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/plus"
android:layout_marginEnd="116dp"
android:text="/" />
<Button
android:id="@+id/minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="107dp"
android:layout_marginTop="285dp"
android:text="-" />
<Button
android:id="@+id/multiply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/textView"
android:layout_alignTop="@+id/plus"
android:text="*" />
<TextView
android:id="@+id/textView"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="168dp" />
<TextView
android:id="@+id/result"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="23dp"
/>
<EditText
android:id="@+id/num1"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="106dp"
android:hint="Please Enter Your First Number"
android:inputType="number" />
<EditText
android:id="@+id/num2"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="187dp"
android:hint="Please Enter Your 2nd Number"
android:inputType="number" />
</RelativeLayout>









share|improve this question
















i have design an calculator app
in nexus 6 resolution but when i play the app in 400 x 800 hdpi it all break
mean app don't look same one button on other corner and one on other hope you got it i want my application to work on all screen sizes my app is design in relative layout i don't want to change
help thanks



<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/plus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/minus"
android:layout_marginEnd="-103dp"
android:layout_toStartOf="@+id/minus"
android:text="+" />
<Button
android:id="@+id/Relative_Number"
android:layout_width="163dp"
android:layout_height="59dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="241dp"
android:text="Click Me" />
<Button
android:id="@+id/divide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/plus"
android:layout_marginEnd="116dp"
android:text="/" />
<Button
android:id="@+id/minus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="107dp"
android:layout_marginTop="285dp"
android:text="-" />
<Button
android:id="@+id/multiply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/textView"
android:layout_alignTop="@+id/plus"
android:text="*" />
<TextView
android:id="@+id/textView"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="168dp" />
<TextView
android:id="@+id/result"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="23dp"
/>
<EditText
android:id="@+id/num1"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="106dp"
android:hint="Please Enter Your First Number"
android:inputType="number" />
<EditText
android:id="@+id/num2"
android:layout_width="381dp"
android:layout_height="63dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="187dp"
android:hint="Please Enter Your 2nd Number"
android:inputType="number" />
</RelativeLayout>






android android-relativelayout






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 30 '18 at 8:59









Onik

11.3k104063




11.3k104063










asked Nov 20 '18 at 6:35









Jasir AliJasir Ali

34




34













  • Much of your design uses de-facto absolute positioning. Try to position elements relative to each other. Only if this is not possible for some reason, use dimensions that depend on the screen size.

    – Henry
    Nov 20 '18 at 6:43











  • @Jasir ali - you need to practice with all layout

    – AD 10
    Nov 20 '18 at 6:51











  • and dont put static size use SDP for all predefine devices- github.com/intuit/sdp

    – AD 10
    Nov 20 '18 at 6:52











  • RelativeLayout is only not a good or proper way to achieve your task

    – AD 10
    Nov 20 '18 at 6:53











  • can any one provide me solution or code

    – Jasir Ali
    Nov 20 '18 at 7:44



















  • Much of your design uses de-facto absolute positioning. Try to position elements relative to each other. Only if this is not possible for some reason, use dimensions that depend on the screen size.

    – Henry
    Nov 20 '18 at 6:43











  • @Jasir ali - you need to practice with all layout

    – AD 10
    Nov 20 '18 at 6:51











  • and dont put static size use SDP for all predefine devices- github.com/intuit/sdp

    – AD 10
    Nov 20 '18 at 6:52











  • RelativeLayout is only not a good or proper way to achieve your task

    – AD 10
    Nov 20 '18 at 6:53











  • can any one provide me solution or code

    – Jasir Ali
    Nov 20 '18 at 7:44

















Much of your design uses de-facto absolute positioning. Try to position elements relative to each other. Only if this is not possible for some reason, use dimensions that depend on the screen size.

– Henry
Nov 20 '18 at 6:43





Much of your design uses de-facto absolute positioning. Try to position elements relative to each other. Only if this is not possible for some reason, use dimensions that depend on the screen size.

– Henry
Nov 20 '18 at 6:43













@Jasir ali - you need to practice with all layout

– AD 10
Nov 20 '18 at 6:51





@Jasir ali - you need to practice with all layout

– AD 10
Nov 20 '18 at 6:51













and dont put static size use SDP for all predefine devices- github.com/intuit/sdp

– AD 10
Nov 20 '18 at 6:52





and dont put static size use SDP for all predefine devices- github.com/intuit/sdp

– AD 10
Nov 20 '18 at 6:52













RelativeLayout is only not a good or proper way to achieve your task

– AD 10
Nov 20 '18 at 6:53





RelativeLayout is only not a good or proper way to achieve your task

– AD 10
Nov 20 '18 at 6:53













can any one provide me solution or code

– Jasir Ali
Nov 20 '18 at 7:44





can any one provide me solution or code

– Jasir Ali
Nov 20 '18 at 7:44












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387506%2fi-need-to-adjust-relative-layout-to-480-x-800-screen%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387506%2fi-need-to-adjust-relative-layout-to-480-x-800-screen%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Guess what letter conforming each word

Run scheduled task as local user group (not BUILTIN)

Port of Spain