3

i have an android app with a googlemap view

i have to put an animated icon representing a gps position on the map

i know how to do it with a normal png image, but i want to use something like a GIF image, an animated image

how i can to do it?

EDIT:

THIS IS THE XML ANIMATED: animation.xml

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false">
<item android:drawable="@drawable/miniicon" android:duration="200" />
<item android:drawable="@drawable/miniicon2" android:duration="200" />
<item android:drawable="@drawable/star" android:duration="200" />
</animation-list>

this is where i asign the XML animated to the drawable

//drawable2 = this.getResources().getDrawable(R.drawable.miniicon2); // Icono del programa, para mi posicion GPS
drawable2 = this.getResources().getDrawable(R.layout.animation); // Icono del programa, para mi posicion GPS
NullPointerException
  • 36,107
  • 79
  • 222
  • 382

3 Answers3

0

Another answer - there's a similar (but old) question on stackoverflow:

Image series (animation) over Google Maps

which if you look at the accepted answer, provides a demo link. Some other interesting comments as well.

Community
  • 1
  • 1
Mark Mayo
  • 12,230
  • 12
  • 54
  • 85
-1

You need to use an animation-list its just a simple xml file that you drop in the drawable folder. Here is an example, this is the download icon in the notification bar is done.

Nathan Schwermann
  • 31,285
  • 16
  • 80
  • 91
-1

For sure - OpenGL allows 2D images to be overlayed on top of the image, for one way to do it. Have a look at Does Google MapView in Android use OpenGL? for a similar question.

Community
  • 1
  • 1
Mark Mayo
  • 12,230
  • 12
  • 54
  • 85