I am sure that I am missing somethink but i have no idea what.
This is what I got from key generation:
************
Thank you for signing up for an Android Maps API key!
Your key is:
0bpnJO3QG16Mzu7dSXxXhao_BcFyjBsdhCQyNbA
This key will work for all apps signed with your certificate whose
fingerprint is:
68:B6:91:00:5E:97:5B:03:4D:E2:EB:CB:F1:EF:7F:69
Here is a sample xml layout to get you started on your way to mapping
glory:
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0bpnJO3QG16Mzu7dSXxXhao_BcFyjBsdhCQyNbA"
/>
***************
This is what I am seeing in the logcat:
*********************
I/APP ( 299): I 12/29/2010 00:52:46:681 002881a0
APP| {:settings=>{:map_type=>"hybrid", :region=>["52.105833",
"5.015278", 0.2,
0.2], :zoom_enabled=>true, :scroll_enabled=>true, :shows_user_location=>true, :api_key=>"0bpnJO3QG16Mzu7dSXxXhao_BcFyjBsdhCQyNbA"}, :annotations=>[{:l
atitude=>"52.105833", :longitude=>"5.015278", :title=>"Current
location", :subtitle=>""}]}
I/APP ( 299): I 12/29/2010 00:52:46:692 002881a0
APP| ##029#######################################################
I/ActivityManager( 59): Starting activity: Intent
{ cmp=com.rhomobile.geonames/com.rhomobile.rhodes.mapview.MapView (has
extras) }
D/PhoneWindow( 299): couldn't save which view has focus because the
focused view android.webkit.WebView@43e50eb0 has no id.
W/System.err( 299): java.lang.IllegalStateException: Connection pool
shut down.
W/System.err( 299): at
org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:
284)
W/System.err( 299): at
org.apache.http.impl.conn.tsccm.ConnPoolByRoute
$1.getPoolEntry(ConnPoolByRoute.java:238)
I/APP ( 299): I 12/29/2010 00:52:46:979 002881a0
APP| meta deleted
W/System.err( 299): at
org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager
$1.getConnection(ThreadSafeClientConnManager.java:175)
W/System.err( 299): at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:
325)
W/System.err( 299): at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
555)
W/System.err( 299): at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:
487)
W/System.err( 299): at
com.google.common.io.android.AndroidHttpClient.execute(Unknown Source)
W/System.err( 299): at
com.google.common.io.android.GoogleHttpClient.executeWithoutRewriting(Unknown
Source)
W/System.err( 299): at
com.google.common.io.android.GoogleHttpClient.execute(Unknown Source)
W/System.err( 299): at
com.google.common.io.android.GoogleHttpClient.execute(Unknown Source)
W/System.err( 299): at
com.google.common.io.android.AndroidHttpConnectionFactory
$AndroidGoogleHttpConnection.getResponse(Unknown Source)
W/System.err( 299): at
com.google.common.io.android.AndroidHttpConnectionFactory
$AndroidGoogleHttpConnection.openDataInputStream(Unknown Source)
W/System.err( 299): at
com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(Unknown
Source)
W/System.err( 299): at
com.google.googlenav.datarequest.DataRequestDispatcher
$DispatcherServer.run(Unknown Source)
W/System.err( 299): at java.lang.Thread.run(Thread.java:1096)
I/APP ( 299): E 12/29/2010 00:52:47:211 002881a0
HttpServer| Connection gracefully closed before we send any data
I/APP ( 299): E 12/29/2010 00:52:47:261 002881a0
HttpServer| Parsing error
W/MapActivity( 299): Recycling dispatcher
com.google.googlenav.datarequest.DataRequestDispatcher@43e2fa38
V/MapActivity( 299): Recycling map object.
I/APP ( 299): I 12/29/2010 00:52:47:361 002881a0
APP| RHO serve_index: /app/index_erb.iseq
I/APP ( 299): I 12/29/2010 00:52:47:365 002881a0 RHO
Rho::RhoController| inst_render_index
I/MapActivity( 299): Handling network change notification:CONNECTED
E/MapActivity( 299): Couldn't get connection factory client
I/APP ( 299): I 12/29/2010 00:52:47:802 002881a0 RHO
Rho::RhoController| index layout
I/ActivityManager( 59): Displayed activity com.rhomobile.geonames/
com.rhomobile.rhodes.mapview.MapView: 861 ms (total 861 ms)
I/APP ( 299): I 12/29/2010 00:52:47:921 002881a0
APP| meta deleted
D/dalvikvm( 299): GC_FOR_MALLOC freed 2830 objects / 242096 bytes in
162ms
D/dalvikvm( 176): GC_EXPLICIT freed 2441 objects / 269160 bytes in
175ms
D/SntpClient( 59): request time failed: java.net.SocketException:
Address family not supported by protocol
D/dalvikvm( 299): GC_FOR_MALLOC freed 7412 objects / 495072 bytes in
87ms
******************
so I put the map call in a variable and print it into file:
I/APP ( 299): I 12/29/2010 00:52:46:681 002881a0
APP| {:settings=>{:map_type=>"hybrid", :region=>["52.105833",
"5.015278", 0.2,
0.2], :zoom_enabled=>true, :scroll_enabled=>true, :shows_user_location=>true, :api_key=>"0bpnJO3QG16Mzu7dSXxXhao_BcFyjBsdhCQyNbA"}, :annotations=>[{:l
atitude=>"52.105833", :longitude=>"5.015278", :title=>"Current
location", :subtitle=>""}]}
I also tried with hard coded lat lan with no success
@postcode = Postcode.find(@params['id'])
map_params = {
:settings => {:map_type => "hybrid",:region => [52.105833,
5.015278, 0.2, 0.2],
:zoom_enabled => true,:scroll_enabled =>
true,:shows_user_location => true,
:api_key =>
'0bpnJO3QG16Mzu7dSXxXhao_BcFyjBsdhCQyNbA'},
:annotations => [{
:latitude => @postcode.lat,
:longitude => @postcode.lng,
:title => "Current location",
:subtitle => ""
# ,url => "/app/Postcode/
{#{$pcodeResult.object}}"
}]
}
puts
"##028#######################################################"
puts map_params.inspect
puts
"##029#######################################################"
MapView.create map_params
WebView.refresh
redirect :action => :index
end
What is going wrong?
Sure I am missing something.
Cheers,
Murat