AppWidget

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

AppWidget

Postby microhome » Mon May 18, 2009 12:05 am

Hi,
can anybody tell me, how I can create a simple Android Widget? Creating an application is not so complicated for me, but I have no idea about adding a widget to my app. Could you help me please, step by step?

What I have to add to the AndroidManifest.xml file, how can I react on button clicks and something like that?!
For me the official Dev Guide and Blog entry is to complicated, sorry.


Thank you very much and waiting for yours response.
microhome
Junior Developer
Junior Developer
 
Posts: 11
Joined: Sun May 10, 2009 8:49 pm
Location: Berlin, Germany

Top

Postby microhome » Mon May 18, 2009 2:46 pm

I solved it, but now, I have a question about EditText objects in Widgets. Is that possible? I tried the following one, but got "Problem loading Widget". If I use a TextView object it works fine. Any idea?!

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3.  
  4.  
  5. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  6.  
  7.    android:id="@+id/widget"
  8.  
  9.    android:layout_width="fill_parent"
  10.  
  11.    android:layout_height="wrap_content"
  12.  
  13.    android:orientation="vertical"
  14.  
  15.    style="@style/WidgetBackground">
  16.  
  17.        
  18.  
  19.         <EditText android:id="@+id/user"
  20.  
  21.                 android:layout_width="70px"
  22.  
  23.                 android:layout_height="40px"
  24.  
  25.                 android:textSize="10sp"
  26.  
  27.                 android:layout_marginTop="30px"
  28.  
  29.                 android:layout_marginLeft="20px"
  30.  
  31.                 android:padding="10px" />
  32.  
  33.                      
  34.  
  35. </RelativeLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
microhome
Junior Developer
Junior Developer
 
Posts: 11
Joined: Sun May 10, 2009 8:49 pm
Location: Berlin, Germany

Postby The Spirit » Wed May 20, 2009 7:30 am

hi.
if you found out how to make widget, can you please tell us how to do so?
i think a lot of us will be interested in doing widgets themselfes
The Spirit
Developer
Developer
 
Posts: 48
Joined: Fri Jan 02, 2009 1:59 pm
Location: Germany

Postby microhome » Wed May 20, 2009 8:28 am

Hi Spirit, I will write a tutorial next week, so that everybody will be able in widget creation.
microhome
Junior Developer
Junior Developer
 
Posts: 11
Joined: Sun May 10, 2009 8:49 pm
Location: Berlin, Germany

Postby clybe » Sun May 31, 2009 4:30 am

Hi microhome, hava you solved the problem when using EditText objects in AppWidgets?
I met the same at present --!
clybe
Once Poster
Once Poster
 
Posts: 1
Joined: Sun May 31, 2009 4:09 am

Postby microhome » Sun May 31, 2009 11:38 am

Hi clybe, currently it is not possible to use a EditText object in Widgets, sorry.
I hope it will be possible with the next SDK.


Best regards.
microhome
Junior Developer
Junior Developer
 
Posts: 11
Joined: Sun May 10, 2009 8:49 pm
Location: Berlin, Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests