Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10309] Android: Ti.Geolocation.forwardGeocoder() callback is not called for a bad address

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-14T18:23:04.000+0000
Affected Version/sRelease 2.1.1
Fix Version/sSprint 2012-16 API, Release 2.1.2, Release 3.0.0
ComponentsAndroid
LabelsSupportTeam, api, module_geolocation, parity, qe-manualtest
ReporterVarun Joshi
AssigneePing Wang
Created2012-08-03T11:55:29.000+0000
Updated2014-08-14T18:23:04.000+0000

Description

Issue

When an address is passed into Ti.Geolocation.forwardGeocoder() the callback function is not called and it gets stuck in an infinite loop. It should behave just like it does on iOS where the callback is called upon success/failure. The sample code is attached. On iOS we receive both alerts that the callback was successful and the finished alert. On Android we do not see the alert that the callback was successful just that we started the fowardGeocoder().

Sample Code

{noformat} var win = Ti.UI.createWindow({ backgroundColor : 'white' }); //create object instance, a parasitic subclass of Observable var self = Ti.UI.createView(); win.add(self); win.open(); var addr = '94302'; setTimeout(function() { alert('Start forwardGeocoder for: ' + addr); try { Ti.Geolocation.forwardGeocoder(addr, function(evt) { alert('Foward Geocoder Callback for 94302 Successful'); }); } catch(err) { alert("Error"); } }, 2000); setTimeout(function() { addr = 'hhhhhhgggggg'; alert('Start forwardGeocoder for: ' + addr); try { Ti.Geolocation.forwardGeocoder(addr, function(evt) { alert('Foward Geocoder Callback for ' + addr + ' Successful'); setTimeout(function() { alert('finished'); }, 2000); }); } catch(err) { alert("Error 2"); } }, 8000); {noformat}

Comments

  1. Ping Wang 2012-08-08

    PR https://github.com/appcelerator/titanium_mobile/pull/2700
  2. Ping Wang 2012-08-09

    Steps for functional test: 1. Run the test case in the ticket description on Android. Should see 5 alert dialogs. (before the fix, can only see 2 alert dialogs). 2. Run the test case below on both Android and iOS to see the parity.
       var win = Ti.UI.createWindow({
           backgroundColor : 'white'
       });
       //create object instance, a parasitic subclass of Observable
       var self = Ti.UI.createView();
       win.add(self);
        
       win.open();
        
       var addr = 'san jose';
        
       setTimeout(function() {
           alert('Start forwardGeocoder for: ' + addr);
           try {
               Ti.Geolocation.forwardGeocoder(addr, function(evt) {
               	var message = 'Foward Geocoder for ' + addr + ': evt.success = ' + evt.success + ', evt.error = ' + evt.error;
                   alert(message);
               });
           } catch(err) {
               alert("Error");
           }
        
       }, 2000);
        
       setTimeout(function() {
           addr = 'hhhhhhgggggg';
           alert('Start forwardGeocoder for: ' + addr);
           try {
               Ti.Geolocation.forwardGeocoder(addr, function(evt) {
                   var message = 'Foward Geocoder for ' + addr + ': evt.success = ' + evt.success + ', evt.error = ' + evt.error;
                   alert(message);
                   setTimeout(function() {
                       alert('finished');
                   }, 2000);
               });
           } catch(err) {
               alert("Error 2");
           }
        
       }, 8000); 
       
  3. Sabil Rahim 2012-08-14

    Reopening to add fixversion Release 2.1.2

JSON Source