Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7544447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:40:27+00:00 2026-05-30T08:40:27+00:00

We are very familiar with the built-in Maps application on Android and I wanted

  • 0

We are very familiar with the built-in Maps application on Android and I wanted to ask if it is possible to create a location overlay that is like the overlay of the Maps application?

enter image description here
enter image description here

Is it possible to create an app that takes two images and randomly animate it to achieve what the Maps application has and change the orientation of the image with respect to the location?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:40:29+00:00Added an answer on May 30, 2026 at 8:40 am

    You find a brief introduction to the position sensors here: http://developer.android.com/guide/topics/sensors/sensors_position.html#sensors-pos-orient

    The following code snippet is based on the Compass.java sample and reacts to an orientation change by rotating an image (like the Maps compass overlay): .

    First you request the compass service (SENSOR.TYPE_ORIENTATION) in your onCreate()-method:

        mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
        mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
    

    Then you need a listener-method to save the current orientation when changed (this is done with a SensorEventListener). The sensor returns the azimuth – in layman’s terms: compass angle

        public void onSensorChanged(SensorEvent event) {
            mValues = event.values; //mValues[0] contains the azimuth angle
            mView.invalidate();
        }
    

    And finally you draw your overlay. The example code snippet rotates the canvas, then draws a basic shape.

        protected void onDraw(Canvas canvas) {
            // [...]
    
            int w = canvas.getWidth();
            int h = canvas.getHeight();
            int cx = w / 2;
            int cy = h / 2;
    
            canvas.translate(cx, cy);
            if (mValues != null) {
                canvas.rotate(-mValues[0]);
            }
            canvas.drawPath(mPath, mPaint);
        }
    

    For the full, working code, refer to Compass.java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a web app with Django. Since I'm very familiar with Apache I
I am not very familiar with the way of creating a daemon in Python,
I am not very familiar with Tomcat, in my head it is basically abstracted
I'm very familiar with using Enums in other languages, but I'm having some difficulty
Given this very familiar model of prototypal construction: function Rectangle(w,h) { this.width = w;
I am very familiar with STL vector (and other container) performance guarantees, however I
I am very familiar with C# but starting to work more in Java. I
I have not used jquery much yet and not very familiar with it. Trying
I've been programming in c++ for a bit now and Im very familiar with
I'm new to IDEA, but very familiar with Eclipse. I followed the instructions here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.