what should I do so that gsm location is automaticallically detected and write function is called?
<p>I simply want to do if the gsm location is updated, write  <code>cellid</code>  to the database. For this wish, I have tried to implement service class, as you can see at below. The question what should I do so that gsm location is automaticallically detected and write function namely C(), job is write cellid to the database is called ?</p>

<p>My start work ;</p>

<pre><code>public class GpsCell extends Service{
TelephonyManager tel;

@Override
public void onCreate() {
    super.onCreate();

    tel = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
    GsmCellLocation location = (GsmCellLocation)telephonyManager.getCellLocation();

}


@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    Toast.makeText(this, "service starting", Toast.LENGTH_SHORT).show();
    return super.onStartCommand(intent, flags, startId);        
}
</code></pre>
