Android - ImageView as Offline map - android

I am trying to implement an offline map content into my android app. I need not so much detailed map just for a specific area and mark some places over it. a zoomable and scrollable image seems to be enough for me.
First question is;
1-) what is the best option for offline map in android? My constraint is that my app couldn't use any internet connection. Do I have to use an imageview (by adding button markers on it) or can I use any offline data for Mapview?
I have searched a lot for using imageview as map but couldn't get so much result.
my basic question for imageview is;
2-) How can I add a marker(a button) on a specific position of imageview?
I have found some sample code for scrolling and zoom and implemented them (Scrollview has no diagonal scroll as default) but I couldn't find a way to add marker to an scrollable, zoomable imageview.
Please don't think on sample code, just assume that imageview is in an scrollview and I try to add a marker(button) on it.
Thanks in advance

There are other options such as OSMDroid: But personal experience of this library would recommend using an imageview if you can and don't require zooming in and out and having performance issue.
You can have a scrollview, containing a horizontal scrollview, which can then contain a relative layout with an imageview taking up the space. Then add the markers to the relative layout and position accordingly.

Related

ImageView zooming in android through code

I am developing Android application for book. I create total images for book is one hundred. In the app two buttons present one is previous button and second is next button. The previous button and next move images forward and back correctly. But now I want to implement zooming effect for image. But the text are some smalls not seen correctly. Please help. Thank you
Below are the options available for implementing zoom in-out effect in android Imageview.
How to implement zoom effect for image view in android?
Android imageView Zoom-in and Zoom-Out
https://github.com/chrisbanes/PhotoView
https://github.com/jsibbold/zoomage
Much better than the offered alternatives here IMHO

Android: ImageView using scaleType="matrix" sample practical usage (to help me understand the matrix scaletype)

Would you help me to understand ImageView using scaleType="matrix"...
By providing some practical usage.
Want to create a Building Floor Plan Map. Maps are still images of each floor plan of a building.
Use Case:
set the current & destination place. (e.g. current:1F destination:5F)
current floor will be shown. scroll up & down to move to other floors.
My first step is to show the current floor image then switch to other by scrolling.
Guide me on how to do that.
I think GalleryView will solve your problem. Normally Gallery View display images in Horizontally but you can set it vertically.
Vertical Gallery View
Vertical gallery in android
How I can create vertical gallery in Android?

Overlay a static image on a MapView

I'm still a newbie to Android but have searched high and low for an answer to my problem without success.
I have a map view that the user can fully manipulate (scroll, enlarge etc.) but I need to let the user know where the midpoint of the map is. I want to use a small "crosshair" image for this and display it at the centre of the map AT ALL TIMES and AT ALL LEVELS OF MAGNIFICATION. In fact, I just want the image to remain on view at all times. Can I find a way to do this? Can I hell!
I'm sure there is a very simply solution to this from one or two of you gurus out there. Please help.
Tony
In your layout file that contains the MapView, make sure that the Layout container is of type RelativeLayout. Then simply add the ImageView as a child of the RelativeLayout, with an attribute of layout_gravity="center"
Basically, research RelativeLayout.

Zooming an ImageView

This should be easy, but I'm having trouble figuring out how to zoom an ImageView. I have an ImageView inside of a ScrollView and a HorizontalScrollView. I floated a ZoomControls over the ImageView and now I'm trying to figure out how to actually zoom the image.
I was thinking I would just scale the Drawable inside of the ImageView, but I can't figure out an easy way to do this.
How should I be going about displaying an image that I can both zoom and scroll?
(And yes, I know about WebViews, but it seems wasteful to load an entire WebView just to display one image.)
I had tried to do a similar thing myself (a pair of scrollviews) in my app, and while it worked okay, I've since replaced it with the one-finger zoom described in this tutorial, and it works fantastic: http://blogs.sonyericsson.com/developerworld/2010/05/18/android-one-finger-zoom-tutorial-part-1/

Android - how do I place an image on top of my existing layout through code?

I have a layout in which I am displaying a webview. I want to add images on top of the webview at specific places through code.
Can some one please tell me how to do that?
The translucent background example in API Demos makes the view cover the whole screen. I want to place only a small image and at a specific location (origin not 0,0)
Thanks a lot.
Have you tried putting both the WebView and the ImageView inside an Absolute Layout? This should let you specify the X/Y location of your image and by ordering make it constantly drawn over the webview.
EDIT: check out the Absolute layout:
http://developer.android.com/guide/topics/ui/layout-objects.html#absolutelayout
AbsoluteLayout is deprecated and if that bothers you, you may want to look for alternative.
I have put an example in my blog post here. It might not be exactly what you are after, but should give you an idea:
http://anothermobiledeveloper.blogspot.com/2011/10/using-relativelayout-instead-of.html

Categories

Resources