[Android Software Development] killersnowman:
so i understand that a Handler is better for these small tics of times but doing this project is a learning excersise. let me show you what i have so far.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tsb.gmailinboxtextcloud"
android:versionCode="1"
android:versionName="1.0">
<application android:label="GmailInboxTextCloud" android:icon="@drawable/gitc_icon">

<!-- Broadcast Receiver that will process AppWidget updates -->
<receiver android:name=".GITextCloud" android:label="@string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<!--
<intent-filter>
<action android:name="INCREMENT_COUNT_UPDATE" />
<action android:name="RESET_COUNT_UPDATE" />
<action android:name="PAUSE_COUNT_UPDATE"/>
</intent-filter>
-->
<meta-data android:name="android.appwidget.provider" android:resource="@xml/gitc_widget"/>
</receiver>
</application>

<service android:enabled="true" android:name=".AlarmService" />
</manifest>

my widget class

GITextCloud.java

package com.tsb.gmailinboxtextcloud;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;
import android.widget.Toast;

public class GITextCloud extends AppWidgetProvider {

private int count = 0;

@Override
public void onEnabled(Context context) {
//super.onEnabled(context);
count = 0;
context.startService(new Intent(context, AlarmService.class));
Toast.makeText(context, "onEnabled() finished", Toast.LENGTH_LONG).show();
}

@Override
public void onDisabled(Context context) {
//super.onDisabled(context);
count = 0;
context.stopService(new Intent(context, AlarmService.class));
Toast.makeText(context, "onDisabled() finished", Toast.LENGTH_LONG).show();
}

@Override
public void onReceive(Context context, Intent intent) {
//super.onReceive(context, intent);
RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.main);
rv.setTextViewText(R.id.widget_textview, "[" + count + "]");
AppWidgetManager manager = AppWidgetManager.getInstance(context);
ComponentName cName = new ComponentName(context, GITextCloud.class);
manager.updateAppWidget(cName, rv);
count++;
}

@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {

}
}

my service that runs an AlarmManager

AlarmService.java

package com.tsb.gmailinboxtextcloud;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.widget.Toast;

/**
* Created by IntelliJ IDEA.
* User: Tyler
* Date: 4/16/11
* Time: 6:34 PM
*/
public class AlarmService extends Service {

private AlarmManager am;
private PendingIntent pendingIntent;

// public static String INCREMENT_COUNT_UPDATE = "INCREMENT_COUNT_UPDATE";
// public static String RESET_COUNT_UPDATE = "RESET_COUNT_UPDATE";
// public static String PAUSE_COUNT_UPDATE = "PAUSE_COUNT_UPDATE";

@Override
public IBinder onBind(Intent intent) {
return null;
}

@Override
public void onCreate() {
Toast.makeText(this, "My Service Created", Toast.LENGTH_LONG).show();
am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
}

@Override
public void onDestroy() {
Toast.makeText(this, "My Service Stopped", Toast.LENGTH_LONG).show();
am.cancel(pendingIntent);
}

@Override
public void onStart(Intent intent, int startid) {
Toast.makeText(this, "My Service Started", Toast.LENGTH_LONG).show();
setRepeatingAlarm(GITextCloud.class);
}

public void setOneTimeAlarm(java.lang.Class<?> cls) {
Intent intent = new Intent(this, cls);
pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (5 * 1000), pendingIntent);
}

public void setRepeatingAlarm(java.lang.Class<?> cls) {
Intent intent = new Intent(this, cls);
pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), (5 * 1000), pendingIntent);
}
}

what ends up happening is that my widget just shows [0] in white and 60sp big. never changes. and my toasts in the service never show up on the screen. am i starting the service wrong?