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 6872845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:58:52+00:00 2026-05-27T03:58:52+00:00

I have struggled with creating Android layouts and I’m still looking for a really

  • 0

I have struggled with creating Android layouts and I’m still looking for a really solid tutorial that provides useful examples.

Currently, I am trying to create a Widget to be similar to many of the existing Android widgets on the market. For example, the simple weather widget that contains the temperature on the right side of the widget (next to an image) and general text on the right of the widget that includes more information such as the forecast. I have the following code and my image fails to load correctly. The text fails to load on the widget also. Can someone help to guide me so that I can at least see the image and some of the text:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/widget"
    android:layout_width="fill_parent"
    android:orientation="horizontal"
    android:background="@drawable/appwidget_bg" 
    android:layout_height="fill_parent">

    <ImageButton 
    android:id="@+id/message_button"
    android:layout_width="100px"
    android:layout_height="wrap_content"
    android:src="@drawable/messages"
    android:scaleType="fitXY"
    />

   <ImageView
       android:id="@+id/divider"
       android:layout_width="1dip"
       android:layout_height="match_parent"
       android:background="@drawable/appwidget_divider"
       android:layout_alignRight="@+id/message_button"
       />    
   <TextView 
        android:id="@+id/current_kw"
        android:layout_toRightOf="@+id/divider"
        android:layout_width="80px"
        android:layout_height="wrap_content"
        android:textSize="18dp"
        android:textColor="#ffffff"
        android:typeface="sans"
        android:text="TBD"
        android:gravity="center_horizontal|center_vertical"
    />  

    <ImageView
       android:id="@+id/divider2"
       android:layout_width="1dip"
       android:layout_height="match_parent"
       android:background="@drawable/appwidget_divider"
       android:layout_alignRight="@+id/current_kw"
       />       

    <TextView 
          android:id="@+id/temp"
          android:layout_toRightOf="@+id/divider2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center_horizontal"
          android:textSize="10sp"
          android:textColor="#ffffff"
          android:paddingLeft="1dp"
          android:fadingEdgeLength="2dip"
          android:text="Temperature"
         />    

        <TextView 
            android:id="@+id/estimate_cost"
            android:layout_toRightOf="@+id/current_kw"
            android:layout_below="@+id/temp"
            android:paddingLeft="1dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Your estimated cost:"
            android:textSize="10sp"
            android:gravity="center_horizontal"
            android:layout_weight="1.0"
           />

        <TextView
         android:id="@+id/communitysize"
         android:layout_toRightOf="@+id/current_kw"
         android:layout_below="@+id/estimate_cost"
         android:text="Size of the community: "
         android:textSize="10sp"
         android:paddingTop="1dp"
         android:layout_width="wrap_content"
         android:gravity="center_horizontal"
         android:layout_height="wrap_content" /> 

</RelativeLayout>
  • 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-27T03:58:54+00:00Added an answer on May 27, 2026 at 3:58 am

    Try This tutorial

         <?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:background="@drawable/icon"
        android:orientation="horizontal" >
    
        <ImageButton 
        android:id="@+id/message_button"
        android:layout_centerVertical="true"
        android:layout_width="0dip"
        android:layout_height="75dip"
        android:layout_weight="1.0"
        android:src="@drawable/icon"
        android:scaleType="center"
        />
    <LinearLayout
        android:id="@+id/linearLayout2" 
        android:layout_width="0dip"
        android:layout_weight="2"
        android:layout_height="fill_parent" 
        android:orientation="vertical"
        android:layout_gravity="center_vertical"
        android:paddingLeft="18dip"
        android:paddingRight="8dip"
       >
       <ImageView
           android:layout_width="1dip"
           android:layout_height="wrap_content"
           android:background="@drawable/icon"
           />    
    
        <TextView 
              android:id="@+id/temp"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="12sp"
              android:textColor="#000000"
              android:singleLine="true"
              android:fadingEdge="horizontal"
              android:fadingEdgeLength="2dip"
              android:text="TBD"
              android:ellipsize="none"
             />    
             <TextView 
                android:id="@+id/communitystatus"
                android:textSize="12sp"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:lines="1"
                android:ellipsize="marquee"
                android:fadingEdge="horizontal"
                android:marqueeRepeatLimit="marquee_forever"
                android:scrollHorizontally="true"
    
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:textColor="#000000"
                android:text="Simple application that shows how to use marquee, with a long text"
             />
            <TextView
             android:id="@+id/communitysize"
             android:text="Size of the community: "
             android:textSize="12sp"
             android:layout_below="@+id/CommunityStatusHeader"
             android:paddingTop="5dp"
             android:layout_width="wrap_content"
             android:gravity="center_horizontal"
             android:layout_height="wrap_content" android:textColor="#000000"/> 
            <TextView 
                android:id="@+id/estimate_cost"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Your estimated cost:"
                android:textSize="12sp"
                android:layout_weight="1.0"
                android:typeface="sans" 
                android:gravity="center_horizontal" 
                android:textColor="#000000"/>
    </LinearLayout>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem that i've struggled with for a long time. This problem
I have an Android Maven project, which uses pure Java libs, I've struggled with
I have struggled with this since day 1. It probably doesn't help that I've
I have a question that really applies to any MVC framework, I'm using the
I'm pretty new to iPhone development and have struggled to find what I consider
This is a very lame question, but I have struggled with it far too
I have struggled converting this SQL statement to LINQ to SQL VB.Net 9.0. I
I have struggled every step of the way with the process of submitting to
I know that this is quite subjective, but is it something that I have
I have struggled with this for a long time, and I did get a

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.