1 (edited by KevinH 2020-04-29 03:20:25)

Topic: SOLVED - Android not showing map and touch question

Hi there,

I'm pretty new to unity so maybe I'm doing something fundamentally wrong.
I have some questions concerning android.

I added a 2D map with SpriteRendererControl via the wizard and chose Google Maps as my provider.
Other than that I didn't select anything in the wizard.

When I test it via the play button the map works on my pc and I can control it with the mouse.
When I build and run it as an android app, it does start up the app but it only displays a blue coloured screen and not the map.

So my first question is: Any idea what I'm doing wrong?

My other question is: Are the android touch controls for the map automatically enabled or is only mouse control enabled? Where can I see these settings?

I'd really appreciate your help!
Thanks in Advance,

Kevin

Re: SOLVED - Android not showing map and touch question

Hello.

1. Most likely, you just did not add the scene with the map to the build.
How to do it:
- Open the scene with the map.
- File / Build Settings.
- Remove all the scenes that are added to the build.
- Add Open Scenes.

2. Online Maps will automatically detect that the target platform is Android, and will use touches instead of the mouse.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

3 (edited by KevinH 2020-04-28 21:25:42)

Re: SOLVED - Android not showing map and touch question

EDIT: See my newer response, it's beginning to work somewhat.

Thanks a lot for the fast reply!

1. Sadly it did not help.
The scene seems to be added correctly already since I additionally put a little png sprite on top of the map to see if my smartphone displays anything at all. The png does show up, but underneath it's still blue (which I guess is the empty background colour in a unity project).

Switched to Mapbox now to see if it makes a difference, but again, it works on my pc but it doesn't show up on my android phone.
Random guesses: It does display somewhere but out of bounds maybe? The camera is right on top of it though...
Could permissions on android play a role?
Should I select a plugin e.g. Adjust to Screen?

2. Ah, that's great to hear!

I hope we'll find a solution for this. Can't wait to play around more with this plugin. The possibilities seem really amazing.

Re: SOLVED - Android not showing map and touch question

Update:

I just realised that it DOES work, but only in landscape mode and I've been viewing the project in portrait mode this whole time.
So portrait mode still doesn't display anything (except the png I randomly put there).

Can I enable portrait mode somehow?
The Mapbox map feels really sluggish, though. Are there settings in your plugin that can optimise performance or is this an external issue?

Re: SOLVED - Android not showing map and touch question

I'm glad you found the map.
But, unfortunately, I do not know what and how you are doing, and it is difficult for me to give advice here.

I can give general advice:
1. Create a Tileset map instead of a SpriteRenderer.
Tileset has much better performance, uses less memory, and has many exclusive features.
2. Use Online Maps Camera Orbit + Tileset, and the map will always be in the center of the screen.
3. Use the Adjust to Screen component to adjust the size of the map to fit the screen.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: SOLVED - Android not showing map and touch question

Thanks a lot for the general advice. I really appreciate it.
I think this will help me a lot to get me started.