Android-World Clock Widget analog <p>I am planning to create a world clock widget in android. The clock should show the selected country's time as an analog clock widget. But I'm feeling difficulties as I'm a beginner in android. </p> <p>My widget.xml file contains the following:-</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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" &gt; &lt;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"/&gt; </code></pre> <h2> </h2> <p>I am using the following configuration activity for my widget:- (To display the city list) package nEx.Software.Tutorials.Widgets.AnalogClock;</p> <pre><code>import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Calendar; import android.app.Activity; import android.app.PendingIntent; import android.app.ProgressDialog; import android.appwidget.AppWidgetManager; import android.content.Intent; import android.os.Bundle; import android.content.Context; import android.content.SharedPreferences; import android.util.Log; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.AdapterView; import android.widget.AnalogClock; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.RemoteViews; import android.widget.TextView; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class ConfigureApp extends Activity { DateFormat df; private ListView cityList; public static String[][] citylist = new String[1242][10]; String[] cities = new String[1242]; String field[] = new String[20]; String list[][] = new String[1242][10]; String country = ""; String line = null; int row = 0; int col = 0; // Variables for list view population String city = ""; int position = 0; public int[] listArray = new int[1242]; public static int len = 0; public String[][] adapterCityList = new String[1242][3]; // Variables for passing intent data public static final String citieslist = "com.world.citieslist"; AppWidgetManager awm; Context c; int awID; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); // Set the result to CANCELED. This will cause the widget host to cancel // out of the widget placement if they press the back button. setResult(RESULT_CANCELED); try { citylist = getCityList(); } catch (IOException e) { Log.e("Loading CityList", e.getMessage()); } for (int i = 0; i &lt; 1242; i++) { cities[i] = citylist[i][0]; } // Set the view layout resource to use. setContentView(R.layout.configure); c = ConfigureApp.this; Intent intent = getIntent(); Bundle extras = intent.getExtras(); if (extras != null) { awID = extras.getInt( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); } else{ finish(); } awm = AppWidgetManager.getInstance(c); cityList=(ListView)findViewById(R.id.CityList); // By using setAdpater method in listview we an add string array in list. cityList.setAdapter(new ArrayAdapter&lt;String&gt; (this,android.R.layout.simple_list_item_1, cities)); // cityList.setOnItemClickListener(cityListListener); cityList.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; av, View v, int pos, long id) { df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String str = ((TextView) v).getText().toString(); RemoteViews remoteViews = new RemoteViews(c.getPackageName(), R.layout.widget); remoteViews.setTextViewText(R.id.mytext, str); remoteViews.setTextViewText(R.id.date, df.format(new Date())); Intent in = new Intent(c,clock.class); PendingIntent pi = PendingIntent.getActivity(c, 0, in, 0); remoteViews.setOnClickPendingIntent(R.id.Widget, pi); awm.updateAppWidget(awID, remoteViews); Intent result = new Intent(); result.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,awID); setResult(RESULT_OK, result); finish(); } }); } private String[][] getCityList() throws IOException { Context context = getApplicationContext(); InputStream instream = context.getResources().openRawResource(R.raw.cities_final); // if file the available for reading if (instream != null) { // prepare the file for reading InputStreamReader inputreader = new InputStreamReader(instream); BufferedReader buffreader = new BufferedReader(inputreader); while ((line = buffreader.readLine()) != null) { field = line.split(","); for (String x : field) { list[row][col] = x; col++; if (x != null) { country = x; } } list[row][2] = country; row++; col = 0; } for (int i = 0; (i &lt; list.length); i++) { for (int j = 0; (j &lt; 3); j++) { if (j == 1) { list[i][j] = list[i][j].substring(0, 6); } } } } return list; } </code></pre> <p>}</p> <p>Can I use my own custom view in the widget, apart from analog clock? Or is there any other way to show the clock? like use the Imageview as the clock face and to draw the dial according to the time? </p> <p>Please help me regarding this.!!!:(</p>