Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7610709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:28:59+00:00 2026-05-31T01:28:59+00:00

I have a problem with my Android application. When I’m using my hp touchpad,

  • 0

I have a problem with my Android application. When I’m using my hp touchpad, which has a resolution of 1024×768 everything looks ok. However when I tested it on a 800×480 (Desire HD) this happened:
enter image description here

Here is my XML file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/linearLayoutH1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight=".25"
        android:orientation="vertical"
        android:weightSum="1" >
        <EditText
            android:id="@+id/result"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:editable="false"
            android:layout_weight=".50"
             />
        <EditText
            android:id="@+id/entry"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:editable="false"
            android:layout_weight=".50"
            />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutH3"
        android:layout_width="fill_parent"
        android:layout_height="100sp"

        android:orientation="horizontal"
        android:weightSum="1.0" >

        <Button
            android:id="@+id/buttonClear"
            style="@style/ButtonText"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:background="@drawable/custombuttonred"
            android:text="@string/clear"
            android:layout_weight=".40"
            android:textSize="50sp" />

          <ImageButton
            style="@style/ButtonText"
            android:id="@+id/c101_image"
            android:layout_width="40sp"
            android:layout_height="100sp"
            android:scaleType="centerInside"
            android:background="@drawable/cloud101"
            android:layout_weight=".20" />


         <Button
            android:id="@+id/buttonBackspace"
            style="@style/ButtonText"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:background="@drawable/custombuttonred"
            android:text="@string/backspace"
            android:layout_weight=".40"
            android:textSize="30sp" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutH2"
        android:layout_width="fill_parent"
        android:layout_height="50sp"
        android:layout_weight=".25"
        android:orientation="horizontal"
        android:weightSum="1.0" >

        <Button
            android:id="@+id/button1"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="@string/b1"
            android:textSize="110sp" />

        <Button
            android:id="@+id/button2"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="2"
            android:textSize="110sp" />

        <Button
            android:id="@+id/button3"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="3"
            android:textSize="110sp" />

        <Button
            android:id="@+id/buttonDevide"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombuttonblue"
            android:text="/"
            android:textSize="110sp" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutH3"
        android:layout_width="fill_parent"
        android:layout_height="50sp"
        android:layout_weight=".25"
        android:orientation="horizontal"
        android:weightSum="1.0" >

        <Button
            android:id="@+id/button4"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="4"
            android:textSize="110sp" />

        <Button
            android:id="@+id/button5"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="5"
            android:textSize="110sp" />

        <Button
            android:id="@+id/button6"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="6"
            android:textSize="110sp" />

        <Button
            android:id="@+id/buttonMult"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombuttonblue"
            android:text="X"
            android:textSize="110sp" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutH4"
        android:layout_width="fill_parent"
        android:layout_height="50sp"
        android:layout_weight=".25"
        android:orientation="horizontal"
        android:weightSum="1.0" >

        <Button
            android:id="@+id/button7"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="7"
            android:textSize="110sp" />

        <Button
            android:id="@+id/button8"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="8"
            android:textSize="110sp" />

        <Button
            android:id="@+id/button9"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="9"
            android:textSize="110sp" />

        <Button
            android:id="@+id/buttonMinus"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombuttonblue"
            android:text="-"
            android:textSize="110sp" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutH5"
        android:layout_width="fill_parent"
        android:layout_height="50sp"
        android:layout_weight=".25"
        android:orientation="horizontal"
        android:weightSum="1.0" >

        <Button
            android:id="@+id/button0"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombutton"
            android:text="0"
            android:textSize="110sp" />

        <Button
            android:id="@+id/buttonDot"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombuttonblue"
            android:text="."
            android:textSize="110sp" />

        <Button
            android:id="@+id/buttonEq"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombuttongreen"
            android:text="="
            android:textSize="110sp" />

        <Button
            android:id="@+id/buttonPlus"
            style="@style/ButtonText"
            android:layout_width="50sp"
            android:layout_height="fill_parent"
            android:layout_weight=".25"
            android:background="@drawable/custombuttonblue"
            android:text="+"
            android:textSize="110sp" />
    </LinearLayout>

</LinearLayout>

I’ve read about the problems of different screen sizes, but no matter if I use sp or dp, it still looks bad on the 800×480 screen. What should I do to get the font display correctly and the picture be nicely centered and not being closed in too tight ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T01:29:00+00:00Added an answer on May 31, 2026 at 1:29 am

    First: You shouldn’t user sp for views dimensions. User dp for dimensions of the views, and sp for text size.
    Second: if you use weightsum and layout_weight, you don’t need dimensions for views width, you give them 0dp value, and they will be drawn ok.

    For example if you use this configuration:

     <ImageButton
           style="@style/ButtonText"
           android:id="@+id/c101_image"
           android:layout_width="0dp"
           android:layout_height="fill_parent"
           android:scaleType="centerInside"
           android:background="@drawable/cloud101"
           android:layout_weight=".20" />
    

    your imageButton should be displayed correctly on all screens.
    Use the same technique for all your views and it should solve your problem.

    Note: Use a smaller font for your text 🙂

    Good luck,
    Arkde

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with my android application. That application which uses the kSOAP
I have a problem with my android application which should connect to java tcp
i have problem using camera in my Android application i have a form for
I have a weird problem in the setup of my Android application which is
I have a little problem... I have made an Android application which extends the
i have a problem with my Android Application. The Error occures when i want
I have an interesting problem being reported to me from an android application I
I have a problem regarding Android App. I have created an application that download
I wrote an application about NFC in android,but I have a problem. When I
I have found a minor problem when i install my application on real android

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.