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 7129361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:14:05+00:00 2026-05-28T11:14:05+00:00

I have a camera class that holds a picture of the camera using SurfaceHolder

  • 0

I have a camera class that holds a picture of the camera using SurfaceHolder and so on. I enter the above SurfaceView TextView. and that I wanted to ask is how can I update the text in TextView with latitude and longitude values ​​I get from GPS?
where I put coding to get the current position and updates the position

  • 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-28T11:14:05+00:00Added an answer on May 28, 2026 at 11:14 am

    Do the below changes to your code and try.

            textView = (TextView)findViewById(R.id.textViewId);
    
            LocationManager mlocManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
            mlocManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, new LocationListener() {
                @Override
                public void onLocationChanged(Location loc) {
                    String location = "Last known location\nLatitude = "+loc.getLatitude()+"\nLongitude = "+loc.getLongitude();
                    textView.setText(location);
                }
                @Override
                public void onProviderDisabled(String provider) {
                    Toast.makeText( getApplicationContext(), "GPS Disabled", Toast.LENGTH_SHORT ).show();
                }
                @Override
                public void onProviderEnabled(String provider) {
                    Toast.makeText( getApplicationContext(), "GPS Enabled", Toast.LENGTH_SHORT ).show();                
                }
                @Override
                public void onStatusChanged(String provider, int status, Bundle extras) {
                    Toast.makeText( getApplicationContext(), "GPS Status Changed", Toast.LENGTH_SHORT ).show();             
                }           
            });
    

    In manifest file you have to use permissions as below

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION">
    

    I hope you understand and it help you.

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

Sidebar

Related Questions

I have a camera that returns raw images that can easily be converted to
I have a Camera class that produces very large images at a high FPS
I have an ImageManipulator class that performs some cropping, resizing and rotating of camera
I have made an openGL camera class that uses lazy evaluation to provide the
I have made an openGL camera class that uses lazy evaluation to provide the
I have a simple concept question. I have a class that snaps a picture
Ok so I have a class that extends SurfaceView and overrides surfaceChanged - just
I have a camera class that has two pointers as parameters: Camera::Camera( float fOVDeg,
I have an abstract class Camera. There are some derived classes that will handle
Suppose I have the following class: class Camera { public Camera( double exposure, double

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.