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

  • Home
  • SEARCH
  • 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 6535837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:25:11+00:00 2026-05-25T10:25:11+00:00

I need to use map rendering library in my android project. I want to

  • 0

I need to use map rendering library in my android project. I want to use code found in mapsforge website.

First, I must set the map I want to use. Method to do that is setMapFile(String newMapFile) from MapView class. I tried to place map file in assets and res/raw folder in Eclipse project and then give path to it, but it doesn’t work for me.

Could anyone tell me how to correctly deliver path with map to this map?

  • 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-25T10:25:12+00:00Added an answer on May 25, 2026 at 10:25 am

    You’ll have to place the map files on the SD card and access them as described in GettingStartedMapView.

    One of the mapsforge developers answers a similar question on mapsforge-dev Google Groups explaining why map files can not be placed inside the app (i.e. in the assets or res folder):

    […] The problem is, that a
    java.io.RandomAccessFile instance is needed in order to read the map
    data from a binary map file. Just having an InputStream is not enough,
    as it doesn’t have a seek() method. Calling skip(n) is not the same.
    In worst case all n bytes will be read, which is not an option for
    huge map files.

    Unfortunately, Android does not offer seekable file access on
    resources. That is due to the way all resource files are packaged and
    compressed into one .apk file. A quick Google search reveals that many
    other people are having the same problem. One work around may be to
    copy the file to the SD card or internal phone filesystem when your
    application is started for the first time. See:
    http://groups.google.com/group/android-developers/browse_thread/thread/59b6bf70ca6d2081

    But depending on the file size, this copying process may take a longer
    time. Having map files bundled with your application will also
    increase the size of your APK file a lot. Another disadvantage is that
    the map file can no longer be updated separately or copied to other
    devices.

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

Sidebar

Related Questions

I need to use java-legacy code with the following method: public void doit(Map <String,
I need to use map in my Android application. There are many Android platforms.
I am developing an app in which i need to use map kit(first time)
I usually use C++ stdlib map whenever I need to store some data associated
I need to use a many to many relationship in my project and since
I need to use a byte array as a profile property in a website.
I need to use the google map directions to show the directions between two
I want to know when we need to use the abstract factory pattern. Here
I'm doing some maths calculations in android map activity and I need to find
I need to use STL C++ map to store key value pairs. I need

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.