The map only show grid not any map information on Android emulator

瀏覽次數:527 次
跳到第一則未讀訊息

Murat Olmez

未讀,
2010年12月25日 清晨5:47:102010/12/25
收件者:rhom...@googlegroups.com
I have a map key and I put it into build.yml like this:
android:
  version: 2.2
  mapping: true
  apikey: 0bpnJO3QG16PCOUEDxa........MYOWNKEY (I think this one is not needed on emulator but I add this just to be sure)

What am i missing?
I puts the info into log and thay show ok (@postcode.lat @postcode.lng)

Thanks in advance,
Murat

my controler has a method like:

def map_it

       @postcode = Postcode.find(@params['id'])

      map_params = {

          :settings => {:map_type => "hybrid",:region => [@postcode.lat, @postcode.lng, 0.2, 0.2],

                        :zoom_enabled => true,:scroll_enabled => true,:shows_user_location => false,

                        :api_key => 'My own api key'},

          :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

Dmitry Moskalchuk

未讀,
2010年12月27日 上午8:10:372010/12/27
收件者:rhom...@googlegroups.com
We have many such reports and in all cases it was wrong API key. Please
follow _strictly_ procedure of retrieving API key from Google - in case
if key is wrong Maps API does not return any error and even does not
report about that in log - it just draw gray grid.

And, of course, you need installed Google API add-on to Android SDK.
Just read
http://wiki.rhomobile.com/index.php/BuildingRhodes#Prerequisites_5 -
strict following of the described steps should solve the problem.

Dmitry Moskalchuk


25.12.2010 13:47, Murat Olmez пишет:

> --
> You received this message because you are subscribed to the Google
> Groups "rhomobile" group.
> To post to this group, send email to rhom...@googlegroups.com.
> To unsubscribe from this group, send email to
> rhomobile+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rhomobile?hl=en.

molmez

未讀,
2010年12月28日 晚上7:10:572010/12/28
收件者:rhomobile
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

Dmitry Moskalchuk

未讀,
2010年12月29日 上午8:05:462010/12/29
收件者:rhom...@googlegroups.com
Did you have this key specified in your application's build.yml as
described at
http://wiki.rhomobile.com/index.php/Building_Rhodes_on_Supported_Platforms#Prerequisites_5?
There are two keys involved in Maps API - one is common Google Maps key
and another is Android specific API key. These keys are different.
Android key can not be specified in runtime - it must be included to the
app on build stage while common Maps key is not so strict. I know this
looks ugly but this is how Google API designed - on Android it is bound
to the certificate which you use to sign final apk (even for debug and
on emulator).

Dmitry Moskalchuk


29.12.2010 03:10, molmez пишет:

molmez

未讀,
2010年12月29日 中午12:12:022010/12/29
收件者:rhomobile
Dmitry,

Yes I put my key (I have only one. The one that I sen on prvious mail)
in build.yml.

I also tryied with/without putting my api key in map_params section in
the controler but no success.


here is my build.yml:
sdk: "C:/APPS/RoR/InstantRhodes/ruby/lib/ruby/gems/1.8/gems/
rhodes-2.2.6"

sdkversion: 2.2.6

name: geonames

version: 1.0

vendor: rhomobile

build: debug

bbver: 4.6

wmsdk: "Windows Mobile 6 Professional SDK (ARMV4I)"

applog: rholog.txt

iphone:

configuration: Debug

sdk: iphonesimulator4.0

provisionprofile:

codesignidentity:

entitlements:

BundleIdentifier: com.rhomobile.geonames

BundleURLScheme: geonames



extensions: ["json", "another-extension"]

android:

version: 2.2

mapping: true

apikey: 0bpnJO3QG16Mzu7dSXxXhao_BcFyjBsdhCQyNbA

molmez

未讀,
2010年12月29日 下午1:08:592010/12/29
收件者:rhomobile
While I was typing my previous mail I was also reinstalling and
configuring my Android SDK/NDK what ever
comes from google (No changes on the rhomobile installation or code
changes on my app).

And after reinstall and re configuration of those SDK NDK , it begin
to show the map on emulator!!!
Just a huge cleansing on whatever comes through google.

So I can go further with my development now.

Thanks for your time Dmitry.

Cheers,
Murat
回覆所有人
回覆作者
轉寄
0 則新訊息