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

  • SEARCH
  • Home
  • 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 9181575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:20:57+00:00 2026-06-17T18:20:57+00:00

I’m creating a basic widget that does nothing except display some static information (this

  • 0

I’m creating a basic widget that does nothing except display some static information (this is a tutorial demo exercise for me).

My widget provider XML looks like:

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:initialKeyguardLayout="@layout/widget"
    android:initialLayout="@layout/widget"
    android:minHeight="72dp"
    android:minWidth="294dp"
    android:updatePeriodMillis="60000" >

    <!-- NOTE 1: -->
    <!-- Widget sizing is done in terms of "blocks" on the screen. -->
    <!-- Each block is 74dp square. -->

    <!-- NOTE 2: -->
    <!-- OLD & WRONG FORMULA used to be: size = (n*74) - 2 -->

    <!-- NOTE 3: -->
    <!-- NEW FORMULA has been UPDATED: size = (n*70) - 30 -->
    <!-- Based on new formula, the size should be 40dp. -->

</appwidget-provider>

I want a widget that is 4×1. i.e. 1 row high.

Following the formula I’ve seen on many posts, height = (rows x 74) -2, I get a minHeight figure of 72dp which should provide me with a widget height of 1 row / block.

Installed on 4.1.1 gives me a widget that is 4×2.


Following from that, I thought maybe my layout was forcing the widget to be bigger than expected. So I removed everything from my layout file:

<?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:layout_width="match_parent"
    android:layout_height="match_parent" >

</RelativeLayout>

Still 4×2 – 2 blocks high.

  • 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-06-17T18:20:58+00:00Added an answer on June 17, 2026 at 6:20 pm

    The correct height to use (for 1 row / block) is:

    android:minHeight="40dp"
    

    Similarly, the correct width (for 4 columns / blocks) is:

    android:minWidth="250dp"
    

    I found the answer based on these 3 questions (which I should have checked first…)

    • Widget margins not applied on ICS phone with TouchWiz launcher?

    • Android 4×1 widget size

    • How to make 4×1 size widget on Android homescreen?


    The reason is given by Artiom Chilaru in this answer

    • the formula has changed to size = (n*70) – 30

    He gives a link to the App Widget Design Guidelines.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,

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.