I would like to make the google maps viewable in another activity, that is, it does not take the entire screen. Is it possible to embed a google map map activty in another activity, so that, let's say, it takes half or 3/4 of the screen please?
Thanks in advance!
Try this:
http://mobiforge.com/developing/story/using-google-maps-android
You can use MapView as any other view - position and size as you like.
If you want to place MapView into ScrollView here is good solution to make sure it works correctly: MapView inside a ScrollView?
You can include MapView in layout and code for the same in MapActivity with the portion you want for it.
Why do you want for it in another activity?
Related
I'm wondering how to get the map to appear inside the CardView, like in the images below, highlighted in pink.
On the left is Strava, it shows the map with the route highilghted. On the right is Google Calendar, it has a map of the location of the calender event.
I would really appriciate some pointer on where to look in the apis to achieve this.
Regards,Luke
You need to use a MapView to achieve this.
This is part of Androids Lite Mode.
Create your card, and add the MapView inside the CardView.
Then in your onCreate(), you create the actual map and set the MapView to display that map.
I'm trying to make my app be able to draw with your finger like Snapchat on part of the screen but not the whole thing? Every example I have seen of drawing is just an app that turns your whole screen into the canvas and does nothing else but I'm having a hard time implementing it as just part of my app. So as well as how to just choose a section of the screen as the canvas is it possible to make another activity just like the examples that extends view that I include or can I put everything in MainActivity.java?
Yes, there is. You can create a fragment, or as many as you want, and them place the fragment(s) wherever you want in the activity by using some of the available layouts.
For example, you can use a relative layout. You can add a frame layout to the relative layout and align it in the activity where you want, set its size, and then add the fragment to it. You can check this link to learn about fragments and their usage if you don't know them.
I have been trying to find a way to get this done but keep running into issues.
I want to be able to have a map in a frame (it does not necessarily have to be a FrameLayout, i just want it framed so it only takes up 1/2 or 2/3 the screen) ontop of my current layout and to have the current activity still displayed behind it.
In a perfect world, i would like to attach this view to a button and animation so clicking the button causes this view to slide in from offscreen left and settle in the center of my current activity, while still being fully clickable and and the map being useable (can zoom, click, etc.)
I have tried doing this with a fragment, but the issue is that the Activity i am working in is already extending another class that is absolutely necessary, so i can not extend Fragment or FragmentActivity, so i cant use fragments (unless i am missing a work around to achieve this.)
The same goes for MapActivity and MapView, cant extend the MapActivity class so cant use MapView.
Any time i try to inflate a map view or anything i get runtime errors because my activity does not extend the pertinent class. Is there a work around for this?
Does anyone have a suggestion as to how i can get this map to display the way i am looking for?
This is easily achieved in iOS but i cant seem to figure it out in Android.
Thank you in advance
EDIT
I am not looking for code, unless you have a specific example in which case obviously code is very helpful, but i am looking for an idea as to how to achieve this -- a push in the right direction if you will -- so i can write the code myself.
Solved this by adding a frame layout to my "Main" activity. That frame layout's class was set to my Map class. The Map class extended FragmentActivity and its contentView is set to my map_fragment.xml. The map_fragment.xml contains only a fragment and that fragments name is set to com.google.android.....SupportMapFragment.
After setting up my project in this way as well as setting up the correct screen layouts and dimensions for sizing purposes as well as defining a GoogleMap in my Map class, i was able to display a fully usable and interactive map over my "Main" activity.
I overrode some Activity transition animations to the Map class and got my project working 100% how i want it to.
I didnt ask for code, so i will not supply any code, but this process is pretty straight-forward if you follow the same process as i have described above.
On the Foursquare activity screen, a map is displayed at the top of the scrollable activity feed, and the text appears to "float" above the map. When the map is tapped it expands to fill the screen. What kind of Android views are they using here?
I think it's a FrameLayout, with the map fragment below and a listview above, being the first element of the list an empty transparent rectangle. When you click that first element an animation is triggered to hide the listview and set the map's configuration.
I'm trying to achieve a similar screen. That's the general idea, not sure yet about the details, I'll add some code later if I can.
Can't be certain, but I'm 99% sure that they are using the Google Maps api, with markers added. Check out this link for more information: https://developers.google.com/maps/documentation/android/marker
Hello there android experts, I have a problem for some time and after some workaround, I can't achieved what I want.
I just want to have a layout (not sure what the name of it) that is similar to the Map application on android:
Here's the image of the layout:
How to achieve / call this kind of layout if you are in a MapView?
Is it possible?
Based on examining this in Hierarchy View, it would appear that your panel is a separate activity, themed with a translucent background so the underlying activity shows through.