I'm new to android development and I am stuck with a problem.
I am trying to develop an android application that shows the user the location of atms, hotels etc on a google map. I haven't started working on the gps yet. As of now the app works something like this, first of all a map loads on which I intend to show the users current location. On clicking on the menu button there are 3 options:
services
about us
quit
On selecting services option the following options are available.
atm
hospital
hotel
etc
on selecting the atm option we will be shown a screen displaying some text.
on using the menu for this screen we get the following menu items.
sbi
canara
hdfc
icici
etc
my intention is that when the user selects the sbi option a map should load showing the various places where there are sbi atms near where the user is currently.
I started out with the google map api but I had to quit because when I select one of the menu options, such as "sbi", the map does not load, instead I am getting the error "application failed to load". Basically I was trying to load a map activity from my first map activity. After googling a bit without any results I tried another approach. I tried to download and view the static map of the location I wanted. It worked, but when I tried to download the static map when I select an option like before I get the same error. "application failed to load". then I tried downloading 2 images from inside onCreate that worked. I cannot do the same thing outside the onCreate. for eg.inside the function for the selected option.
I have given the link to my code below.
If someone can please look into this it would be of great help to me. I have been sitting with this problem for days now. And its urgent too. I have done the project in eclipse.
httpDownload.java --- http://dpaste.com/195981/
I looked at your code.
I think the problem is that you didn't do setContentView before loading the map outside OnCreate.
Related
I am considering creating an introduction/instruction/tips for my android studio app - "how to use it, what this button does". When user for first time opens the app it should give some tips, for example: this button is used for navigating in map (or something like this). Half year ago I installed app (forgot the name :D) and the first screen activity went into gray shades and highlited only single options. After I passed a few steps of introduction into app started working as normal. Any ideas how to create something like this? I was searching in google but I have no clue how to name this functionality.
Pedro
I am using MapBox on my app and I have a fragment which is separate from the activity that has the map.
In that fragment I have a ListView, which contains a list of region names.
I want to create the option to click on the ListView and generate a download of that region.
I have looked at this guide: https://www.mapbox.com/android-docs/map-sdk/overview/offline/
but that refers to downloading a specific region when activity starts.
How do I connect my ListView items with the option to download specific regions?
I have already created the LatLngBounds, metadata and OfflineTilePyramidRegionDefinition of the regions I need.
Thanks!
Are you specifically speaking about downloading a region without actually showing the map? I'd recommend trying out the Offline Plugin #tobrun has been working on. It runs the download in the background inside a service which will allow your users to leave the app and continue downloading the region.
In my app I need to be able to display google map as overlay up on other applications.
For doing so I am using service and window manager to show google map view as TYPE_SYSTEM_ALERT .
I am already able to the display the map twice inside the activity using 2 different google API clients with same valid API key.
I can't figure it out but for some reason when attaching the 'View' which contains 'SupportMapFragment' to 'WindowManager' the map wont display , only google logo at the bottom .
I was thinking maybe it has to do something with pixel format ?
Any suggestions ?
It has to do something with kind of views which window manager supporting , maybe window manager cannot display fragments ?
Is it possible to archive what am I trying to ?
There is no problem in the implementation so I don't past code here .
maybe window manager cannot display fragments ?
Correct. Use MapView directly. It may not work especially well in your case, as not everything is designed to go in an alert window, but it is the only chance that you have.
Also note that your app may have problems starting with Android O, as Google slowly starts to rein in apps that do these sorts of overlays.
I've made an app where I display a map. On the same page I also have a button. When the button is clicked I want to display a modal page to enter some data. It works except from Android, where the app crashes when I do the navigation. It's this issue https://forums.xamarin.com/discussion/81768/launching-a-modal-over-a-page-containing-a-map-maps-ad-m-cannot-be-cast-to-android-view-viewgroup
So far I haven't found a solution that fixes the issue. I'm running latest XF 2.3.4.247 stable
best regards
I am developing an android app where more than one user can connect like whatsapp along with their location.
For example,
I have connected with three friends called A, B, and C. I can able to get their location in latitude&longitude and showing those in the google map. I implemented that.
If I start moving I can see that my location also moving. I implemented this using GPS.
Here I also want to show the navigation of my friends if they started moving. (Multiple navigation at one time) How can I achieve this? Is this possible with Google Maps?
I searched for solutions in SO and google. Cant find. Help needed.