android - Map view appears white -
until map view working ok appears white though address location out of can see in picture
what can problem im out of guesses
the code this
@override public bitmap doinbackground(void... params) {
string url = string.format( "http://maps.google.com/maps/api/staticmap?center=%f,%f&zoom=16&size=%dx300&sensor=false&key=%s", lat, lon, imagewidth, context.getresources().getstring(r.string.mapapikey2) ); log.d("map request ", "" + url); bitmap bmp = null; httpclient httpclient = new defaulthttpclient(); httpget request = new httpget(url); inputstream in; try { in = httpclient.execute(request).getentity().getcontent(); bmp = bitmapfactory.decodestream(in); in.close(); } catch (illegalstateexception e) { } catch (clientprotocolexception e) { } catch (ioexception e) { } return bmp; }
also mapview works ok, problem static map.
if take url generated in code , paste on browser get
the google maps api server rejected request. api project not authorized use api. please ensure api activated in apis console: learn more: https://code.google.com/apis/console
but dont understand because have activated there
well didn't activate correct api, seems google has different api's different purposes.
i had activated google maps android api v2
, alright had activate static maps api
Comments
Post a Comment