Hello I have an android app that has a main menu with two buttons. First one gets you on a Google Maps screen and the other one on a screen that shows a listview with information(name, description, coordinates etc) from saved places on my MySQL database. This example shows exactly how I populate the lisview from my JSON, I've done it the same way. Now what I need is to put markers on my map screen from the coordinates of the places I get from my DB. How could I do this? Could I use the same files(AndroidVersion.java, Response.java, LoadJSONTask.java) I used to populate my listview? (see above example)What should I do to get the coordinates? Can I re-use the files from my other screen or should I start from the beginning? Any help would be appreciated! Thank you!!!
If you have a variable with the coordinates you can just call the map and pass them as an argument throw that screen.
Related
Java 8, min SDK: 24, target SDK: 27
My app displays a map with some type of map marker (within a Fragment) and if I click on one of these markers, a popup comes up to show some additional information about this marker. Currently I'm using a normal AlertDialog for that but I might replace it with a DialogFragment in the future.
Inside the dialog there's a RecyclerView that is filled with multiple values. If I click on one of the rows, I want my app to open a "fold-out" underneath it (the other rows should move down) that displays even more information about that row. Clicking on the row again should close that "fold-out".
Similar to what the FoldingCell library does but I want to add to the original row (instead of replacing it) and also don't need the fancy animation.
Like this:
Is "fold-out" the right word for it? I'm pretty sure I saw a similar question here on Stackoverflow (might have been for iOS) a while back but I've not been able to find it again yet. I know how to do the whole onClick thing for the map and the RecyclerView but how do I accomplish the "fold-out" part (create design in xml, then load via Java class)?
Is it possible to remove unnecessary marks and places in google map for an android developer? I'm trying to show some places, but when user zoom-in bunch of places and marks show in map which is pretty normal, but all i want is to remove them and show only my marks. check below image :
Well as u can see in below image, blue circle is my icons and red are belong to google map, i just want my icons show in app.
I hope this link will help you Android Google Maps v2 remove default markers. I tested it and it works perfectly.
This is my application require :
- Get data from a server (JSON)
- Show all data report like image above. Data will display as multi page ( do not scroll), use next and previous button to switch
See how I want:
I can get data from server and show data as listview. But I have some problem and need help.
1. How to display data like image I attached. I found some way but seem it is not good
2. How to display data as multi page. I do not know exactly how much data because it depend data on Server, i have to show all data on server. Pages should auto generate depend on data.
Thanks you.
Simplest way to do it would be to create three datasets (let's say arraylists) and keep previous page data in one and current and future in the next one.
Then put an onClickListener that changes the data in listviews and then notify adapter using .notifyDatasetChanged().
This is not an default Android Behavior, So Please do not follow this design. Better to use Load More Functionality :)
You can refer links for that.
ListView to load more items when reached to an end
LoadMore library
Infinite Scroll ListView
I am creating an app that uses Google Maps to show locations of stores. I have an array of 5900+ locations that I would like to have on the map. I am currently using https://github.com/MadsFrandsen/MapStateListener to make markers in a location visible and hide all other markers that are not in the screen range.
However the problem is mainly how loading 5900 markers onto the map on initialization takes quite a few seconds and reduces the devices speed and I keep retrieving errors about skipped frames.
What methods do I have that will best allow me to have these locations available when a user scrolls from state to state (as I load 50KM away from initial device location) ?
I don't think any user will find a visual filled with 5900+ markers useful.
There's no way to make this problem go faster unless you can figure out a meaningful way to display less data. You need to filter those locations better. Maybe only displaying those stores within a 10 mile radius of the current GPS location would work better. It'll render faster, and your users will thank you for not confusing them.
I pretty much doubt you need to display all 6k markers on your map at once as your view will get rather crowdy. However if you really think that makes sense, there's library that you may find useful -> Android Maps Extensions
demo: https://play.google.com/store/apps/details?id=pl.mg6.android.maps.extensions.demo
code: https://www.google.com/url?q=https://github.com/mg6maciej/android-maps-extensions/&sa=D&usg=AFQjCNEnOeOZB4NbvpjQldmChbVbzCZV7Q
First, you should group your markers into one if they are too close to each other when user zooms out. Then you should update your map only if user stops scrolling, zooming. It will take you a possibility to make UI faster.
You should add so many markers on map so user can see on the screen
I want to build an empty map that I can customize as I like. Now, I know how the whole system works with the tiles and lon/lat coords, but I still dont understand how to contect between my tile's pixels and the lon/lat. I want to have an empty map that shows only my country and that I can edit things the way I like (I work with Android - dont know if it matters).
Write a class which derives from the Overlay class and override the onTap() method. Then you can add your overlay to the your MapView. A GeoPoint object, which represents the position of you tap, is passed to the onTap() method when you tab somewhere on the map.
You also can use onTouchEvent(). Given the screen coordinates of the touch, you can use a Projection (from getProjection() on MapView) to convert that to latitude and longitude.
Here is a sample project.