In the project I use Here map-android-sdk. It is necessary to photograph the screen with the map, I did not find the desired functionality in sdk. I know that for google map this solution works. When you try to take a picture of the parent view in which the map lies, instead of the map, the black area appears. Has anyone encountered a similar problem? Any ideas?

The code that I'm trying to make the screen below:

View screenView = getWindow().getDecorView().getRootView(); Bitmap bitmapFull = Bitmap.createBitmap(screenView.getWidth(), screenView.getHeight(), Bitmap.Config.ARGB_8888); bitmapFull = Bitmap.createBitmap(bitmapFull, 0, 0, screenView.getWidth(), screenView.getHeight()); Canvas canvas = new Canvas(bitmapFull); screenView.draw(canvas); screenView.setDrawingCacheEnabled(false); 
  • print screen of the phone screen is not suitable? - redL1ne
  • What do you mean, the same way that is described in my code? - Harco
  • Screen screen, press simultaneously the power and volume keys. But as I understand it, this is a bit not what you need - redL1ne
  • one
    a lot of extra code with dimensions, you can simply get the dimensions of the desired view element and make the bitmap output to the canvas as well - Shwarz Andrei
  • Yes, corrected, but the problem is not solved - Harco

1 answer 1

In general, the answer is:

Note: The MapFragment class provides you with the getScreenCapture method getScreenCapture(OnScreenCaptureListener) , for creating a map of the currently visible MapFragment area. When a snapshot was created, an event callback to OnScreenCaptureListener occurs. This is where the screen is captured. If you want to use it, use MapOffscreenRenderer.

But this only works for the premium version of sdk.