2

I have to create an android world clock widget. It should show the selected country's time as an analog clock widget.

But I don't know how to update the time in the widget view.

I tried using the widget configuration activity. But it was not successful. Please give me some ideas for doing it

My widget.xml file contains the following:-

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

  android:id="@+id/Widget"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_margin="8dip"
  android:background="@drawable/myshape" >
<AnalogClock android:id="@+id/AnalogClock"
 android:layout_width="wrap_content" 
 android:layout_height="wrap_content"
 android:dial="@drawable/widgetdial" 
 android:hand_hour="@drawable/widgethour"
 android:hand_minute="@drawable/widgetminute"/>
</LinearLayout>

1 Answers1

0

You can look at my code on bitbucket: https://bitbucket.org/EmilYo/another_clock_widget It's a digital clock widget for android (https://market.android.com/details?id=com.omgbutton.anotherclockwidget).

  • Thanks for your kind help! :) But I'm afraid this is not actually what I needed. I need an analog clock to display as the widget and the time that shows should be of a different time zone's, which we selects. Can I do that?? – Jihana Maharooft Dec 06 '11 at 15:29
  • Please anyone help!! I saw a link (http://stackoverflow.com/questions/4630490/how-do-i-set-the-time-on-an-android-analogue-clock) that its not possible to change the time of the predefined clock. As it shows the current time only. How to create our own view?? – Jihana Maharooft Dec 07 '11 at 06:34
  • I set time in this widget by java code. So you can add or take something from hour value and you get other hour. Did you read this code? – Kamil Powałowski Dec 08 '11 at 15:01