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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:38:10+00:00 2026-05-27T19:38:10+00:00

Hi My app is an Google api map. I would like it to be

  • 0

Hi My app is an Google api map. I would like it to be compatible with old android version sso I have included the android compatibility package jar v4 in the libs folder. In my manifest I have:

I have this service which starts when my app starts and I want it to update the location and then when the map will be loaded it will be faster. So I have this code in the onCreate method of my service:

 Criteria criteria = new Criteria();
    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    if (isEmulator() || !isOnline())
        provider = LocationManager.GPS_PROVIDER;
    else
        provider = locationManager.getBestProvider(criteria, false);

    try {
        Location location = locationManager.getLastKnownLocation(provider);
        if(location==null || location.getTime()>(new Date().getTime()-Constants.TIEMPO_ENTRE_LOC_UPDATE))

        locationManager.requestSingleUpdate(provider, null);
    }catch (Exception e){
        e.printStackTrace();
    }

the thing is when I launch the app on emulator (google apis level 7) I get this error:

01-02 12:21:30.971: E/AndroidRuntime(523): java.lang.NoSuchMethodError: android.location.LocationManager.requestSingleUpdate
01-02 12:21:30.971: E/AndroidRuntime(523): at com.tresipunt.scm.MyService.onCreate(MyService.java:78)

Well of course I know requestsingleupdate is not available in earlier apis but isn’t the compatibility package supposed to fix it? How could I solve the problem? thks a lot

  • 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-27T19:38:11+00:00Added an answer on May 27, 2026 at 7:38 pm

    The compatbility package does not include the LocationManager. You can see available packages here:
    http://developer.android.com/sdk/compatibility-library.html#Using

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

Sidebar

Related Questions

I am working on an Android app that utilizes the Google Maps API MapView,
How would you query Picasa from a Google App Engine app? Data API or
In google app engine can I have www.domain.com point to version X of my
I am currently developing an android application uses Google map API. I am wondering
I'm developing a Google Map API v2 app, where markers are loaded from a
I have a problem with Google Maps in my Android app. I've switched to
I am currently developing a web app that uses Google's Static Map API, in
I wrote an app that plots my position on the google map API using
I would like to develop an android application with the following description: The app
Im currently writing an ios app which uses google map api's to measure driving

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.