1

I just installed Google Play Services

However, reading tutorials, maps seem to require fragments? (I only have a basic understanding of those since I am still new to Android)

From what I have read, it should be possible by using support library for fragments to get map v2 working on API level 8...

However, I have problems finding a demo that will actually run and not crash Eclipse/emulator (API level 8) so I am doing something wrong.

(Also the demos I have tried does not use the Google API console key which I do not understand. Everywhere I read it states it is required. But this is probably because it is also a "first" for me using any Google API for Android... Or at all actually)

All I want to do is to show a map centered on a specific address + add some pins

Tom
  • 3,587
  • 9
  • 69
  • 124
  • Post some code and your logcat/ crash log. – fweigl Mar 08 '13 at 13:04
  • 1
    use this library : http://actionbarsherlock.com/ and for more detail http://dj-android.blogspot.in/2013/02/android-google-map-v2-part-1.html – Dhaval Parmar Mar 08 '13 at 13:05
  • 1
    And what's the crash? Btw that tutorial does explain how to use the API key. – fweigl Mar 08 '13 at 13:07
  • Ascorbin: It froze to the degree I had to kill it with task manager. Anyhow, I found some infomation on SO somewhat similar to my case, so I will try that and post my results for those interested (and or extend this SO with more info) – Tom Mar 08 '13 at 13:12
  • @Dhaval Sodha Parmar When following the tutorial you link I get "InflateException" that it can't "inflating class fragment" when testing against SG2 Android v4.1.2 (however, it does not freeze Eclipse, so it is a big improvement. Will try see if I can fix the error.) – Tom Mar 08 '13 at 18:22
  • 1
    put your code here or follow comansware answer. – Dhaval Parmar Mar 13 '13 at 14:26
  • @DhavalSodhaParmar: In this SO: http://http://stackoverflow.com/questions/15301607/trying-to-get-maps-v2-android-demo-working/15302134 I learnt that I can not for some reason install Goolge Play Services correctly which I created this SO about: http://stackoverflow.com/questions/15325654/can-not-install-google-play-services-into-eclipse-correctly-trying-to-get-maps/15338114 (bounties on both) I will accept CommonsWare answer, but the problem is unresolved, unfortunately. (Thanks for trying though!) – Tom Mar 13 '13 at 15:42

1 Answers1

7

maps seem to require fragments?

No, though that is the recommended approach.

it should be possible by using support library for fragments to get map v2 working on API level 8...

Yes, though not all API Level 8 devices will support OpenGL ES 2.0 or have access to the Play Services Framework.

However, I have problems finding a demo that will actually run and not crash Eclipse/emulator (API level 8) so I am doing something wrong.

Maps V2 is not available on the Android emulator. Please do your Maps V2 development on a device.

Also the demos I have tried does not use the Google API console key which I do not understand.

I feel quite confident that the demos have the <meta-data> element in the manifest for the API key. Certainly all of my demos do.

All I want to do is to show a map centered on a specific address + add some pins

This is the simplest one of my demos for that scenario. It uses ActionBarSherlock and has a chance of running on an API Level 8 device, if that device has OpenGL ES 2.0 and the Play Services Framework. You will need to modify the manifest to put in your own Maps V2 API key, tied to your debug signing key and the app's package name (com.commonsware.android.mapsv2.markers).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • It appears there are many things I do not have installed since that projects gives me 92 errors. (ActionBar, CameraUpdate, GoogleMap etc. declareations are not recognized.) Anyhow, I will try work my through it! Thanks :) – Tom Mar 08 '13 at 18:56
  • 3
    @Tom: You need to attach your own local copies of the ActionBarSherlock and Play Services library projects. – CommonsWare Mar 08 '13 at 19:01