[Windows Mobile Development and Hacking General] the_StruiS:
Hello,

I just started with developing in csharp for my mobile phone. The first project i'm working on is creating a GPS tracker program that will safe the current GPS location to a text file. This file i'll load to a website from where people can download an google earth file (i prefer php programming :))

But to get to the point. The program worked fine untill i added some extra functionality (SystemIdleTimerReset and the date in the name of the datafile)

After adding this the program starts in the emulator, however after 30 seconds (when the trigger start for the first time) it comes with the exception (at the red comment):

Exception was unhandeld

The method or operation is not implemented

My code (i added everything from the main form, since i don't know where the error is)

using System;
using System.Collections;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Microsoft.WindowsMobile.Samples.Location;

namespace GPS_Tracker
{
public partial class mainform : Form
{
GpsDeviceState device = null;
GpsPosition position = null;

Gps gps = new Gps();
int iTicker = 0;
int iCounter = 0;
string fileName;

private EventHandler updateDataHandler;
private EventHandler timerTicker;

DateTime currentTime = DateTime.Now;

public mainform()
{
InitializeComponent();
}

private void menuExit_Click(object sender, EventArgs e)
{
if (gps.Opened)
{
gps.Close();
}

Close();
}

private void menuStart_Click(object sender, EventArgs e)
{
if (!gps.Opened)
{
gps.Open();
}

menuStart.Enabled = false;
menuStop.Enabled = true;
}

private void menuStop_Click(object sender, EventArgs e)
{
if (gps.Opened)
{
gps.Close();
}

menuStart.Enabled = true;
menuStop.Enabled = false;
}

private void mainform_Load(object sender, EventArgs e)
{
timerTicker = new EventHandler(timerCheck);
updateDataHandler = new EventHandler(UpdateData);

gps.DeviceStateChanged += new DeviceStateChangedEventHandler(gps_DeviceStateChanged);
gps.LocationChanged += new LocationChangedEventHandler(gps_LocationChanged);

Status.Text = "";
}

protected void gps_LocationChanged(object sender, LocationChangedEventArgs args)
{
position = args.Position;

// call the UpdateData method via the updateDataHandler so that we
// update the UI on the UI thread

Invoke(timerTicker);
}

void gps_DeviceStateChanged(object sender, DeviceStateChangedEventArgs args)
{
device = args.DeviceState;

// call the UpdateData method via the updateDataHandler so that we
// update the UI on the UI thread

Invoke(timerTicker);[COLOR="Red"]// place where error comes[/COLOR]
}

void timerCheck(object sender, System.EventArgs args)
{
Invoke(updateDataHandler);
}

void UpdateData(object sender, System.EventArgs args)
{

if (iTicker == 1)
{
SystemIdleTimerReset();
if (gps.Opened)
{
string str = "";
if (device != null)
{
str = device.FriendlyName + " " + device.ServiceState + ", " + device.DeviceState + "\n";
}

if (position != null)
{

iCounter++;
if (position.SeaLevelAltitudeValid &&
position.EllipsoidAltitudeValid &&
position.SpeedValid &&
position.LatitudeValid &&
position.LongitudeValid &&
position.SatellitesInSolutionValid &&
position.SatellitesInViewValid &&
position.SatelliteCountValid &&
position.TimeValid)
{
fileName = "data_" + currentTime.ToString("yyyyMMdd") + ".txt";
StreamWriter output;
output = File.AppendText(fileName);
output.WriteLine(position.SeaLevelAltitude + ";" +
position.EllipsoidAltitude + ";" +
position.SpeedKmh + ";" +
position.Longitude + ";" +
position.Latitude + ";" +
position.GetSatellitesInSolution().Length + "/" +
position.GetSatellitesInView().Length + " (" +
position.SatelliteCount + ";" +
position.Time.ToString());
output.Close();
str += "Saving data to File \nEntry: " + iCounter + "\n";
str += "Current speed: " + position.SpeedKmh + "\n";
str += "Current height: " + position.SeaLevelAltitude + "\n";
}

}

Status.Text = str;

}
iTicker = 0;
}
}

private void SystemIdleTimerReset()
{
throw new Exception("The method or operation is not implemented.");
}

private void Ticker_Tick(object sender, EventArgs e)
{
iTicker = 1;
}

}
}

the error details:

I hope anybody can help me.

Thanks in advance :D

StruiS