I used the Create Mobile Map geoprocessing tool in ArcGIS 10's toolbox to generate a mobile map from an MXD. The MXD has one layer which featureclass is:
1) in a geodatabase
2) registered as versioned and
3) has a globalid
all the ridiculous requirements for generating a mobile cache just to take advantage of ArcGIS Mobile's mapping capabilities (like I couldn't send my edits back to my own webservice and manage edits my own way).
I then took the MapSchema.bin file and dropped it in a folder on my Windows Mobile device. I wrote a small test Smart Device application in Visual Studio that has this code:
using (MobileCache cache = new MobileCache(mobileCachePath))
{
cache.Open();
FeatureLayer layer = cache.Layers[0] as FeatureLayer;
FeatureDataTable table = layer.GetDataTable();
FeatureDataRow row = table.NewRow();
row["area_id"] = 1;
table.Rows.Add(row);
int recordsAffected = table.SaveInFeatureLayer();
//recordsAffected is always 0
using(FeatureDataReader reader=layer.GetDataReader(null,null))
while (reader.Read())
{
//never reaches here
}
table = layer.GetDataTable(new QueryFilter("area_id="+1));
int foundRows = table.Rows.Count;
//foundRows is always 0
cache.Close();
}
As you can tell from the comments in the code, I can't find my new records anywhere. I open the MobileCache.db file in a Sqlite browser and the tables are empty. I read that I could use the MobileCache in a headless fashion, is this not what ESRI meant? Can anyone fill me in on what I'm missing? OR EVEN BETTER does anyone know another mobile mapping API that is SIMPLE (just plot stuff on a map already for crying out loud), works with locally stored maps and stores geometry in some open format?