Any Suggestion ?
Sorry for my orribile English..
How can you tell it is the locator causing the problem?
Are you using "GPS" or "Network" or both?
Do you get this problem if you run the sample app
"Location - Use GPS and/or network to find location" from the DroidScript samples?
Are you using custom firmware such as CyanogenMod?
function StartLocator ()
{
loc = app.CreateLocator("GPS,Network");
loc.SetOnChange(loc_OnChange);
loc.Start();
}
function loc_OnChange(pos)
{
//alert(pos.latitude+ " "+ pos.longitude);
lat = pos.latitude;
lng = pos.longitude;
if(pos!=null) {
//app.HideProgress();
loc.Stop();
}
// GetGPSCoords(lat, lng);
}
function esegui_funzione( title, body, type, index )
{
if (title == "Make a Picture" )
{
takeAPicture(create_picture_name(getTimestamp()));
// isPic = true;
}
if (title == "Get GPS Coords")
{
StartLocator(); // StartLocator() is the function forum ti call GPS pos.
// isGps = true;
}
if (title == "Write a Note")
{
WriteANote();
}
}
Are you using exactly the same apk to test on the 6.0 device and the 6.0.1 phone?
Have you tried making an apk from the sample app
"Location - Use GPS and/or network to find location" from the DroidScript samples and installing it on your wife's phone?
Are we able to rule out a fault on the 6.0.1 phone? Does your wife use the GPS on her phone for anything else?
loc.SetOnChange(loc_OnChange);
loc.Start();
}
maybe a bug droidscrip api.
I know you think you know what is happening but the limited code you posted leaves all sorts of possibilities.
The locator certainly works on the only 6.0.1 device I have.
If I was seeing the problem you are, I would try to narrow down the exact point at which the code starts working.
I would start by making an apk of the code below and try running it on the Asus to see when it stops.
var counter = 0;
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
txt = app.CreateText( "",1,0.8, "log");
lay.AddChild( txt );
btn = app.CreateButton( "Test" );
btn.SetOnTouch( btn_OnTouch );
lay.AddChild( btn );
app.AddLayout( lay );
}
function btn_OnTouch()
{
txt.Log( "Button pressed" );
this.SetEnabled( false );
//Create and start location sensor.
//(Achievable update rate is hardware specific)
loc = app.CreateLocator( "GPS" );
loc.SetOnChange( loc_OnChange );
loc.SetRate( 2); //10 seconds.
txt.Log("Starting");
loc.Start();
txt.Log("Started");
int = setInterval(running,500)
}
function loc_OnChange(data)
{
clearInterval(int);
txt.Log("OnChange");
loc.Stop();
app.Alert(JSON.stringify(data,null,1),null,"noDim");
// btn.SetEnabled( true );
}
function running()
{
txt.Log(++counter);
}