Discussion Forums  >  Maps, Device Location, Tracking

Replies: 11    Views: 77

appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
09/20/15 03:49 PM (2 years ago)

Hosted android app location map with data url. [SOLVED]

I have been working through the How To by @GoNorthWest on "Posting a Device's Current Location to a Database" and have managed to get the bulk of it working... however I have hit a bit of a wall when populating the map with the data from the database. I have established a test location list here <a href="http://uker.consultantsussex.com/location-list.php" target="_blank" rel="nofollow">http://uker.consultantsussex.com/location-list.php</a> so you can see there is data and it is formatted correctly. I have also confirmed that I have google maps working in the app correctly because when I manually put a location in the control panel it shows on the map in the live app. But when I put the data url (above) in the control panel the map shows but with no locations on it.

Can anybody offer any assistance or guidance with this?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6249
Reg: Nov 07, 2012
Tamuning, GU
80,740
like
09/20/15 05:40 PM (2 years ago)
Well, at first glance the childItem format seems ok, so I'm curious about how it's being fed to the Location Map.

Run the app through Xcode, and watch the logs when you load the file/screen... see what it tells you is happening. If anything strange and unusual happens, let us know.

At the moment, there isn't enough information to adequately troubleshoot the issue, without a bunch of wild guesses :)

Cheers!

-- Smug

also, as you move on with other things, it might be worth taking a look at Susan's excellent 'WB Add Ons'... A PHP driven set of scripts and templates to get other kinds of information from your MySQL Server to various BT plugins... I keep a copy here:

https://dl.dropboxusercontent.com/u/115208762/wb_addons.zip

and I made a youtube video of it's install and use...

https://www.youtube.com/watch?v=7s2h9x30loc
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
09/20/15 05:49 PM (2 years ago)
Thanks for the response Smug, this is an android app so no xcode. I am following the How To so I am just using the url of the location list detailed above as the data url in the apps control panel (hosted).

What other info can I gather to help troubleshoot this?

Thanks
 
SmugWimp
Smugger than thou...
Profile
Posts: 6249
Reg: Nov 07, 2012
Tamuning, GU
80,740
like
09/20/15 06:21 PM (2 years ago)
Oh, well, Xcode, android, in the end it's all the same 'behavior'...

So I'd still do the same thing, but check the logcat output of either Eclipse or Android Studio, whichever one you're using.

I do know in my own trials and tribulations, that Android is a lot less forgiving than iOS, so make sure 'each' value exists; I noticed a couple of the 'title' values weren't there (specifically itemID 31, 32, & 35), so ensure you populate ALL of the data.

After that, it's back to the logs...

Good Luck, and let us know what you come up with.

Cheers!

-- Smug
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
09/21/15 05:04 AM (2 years ago)
Thanks again for the guidance Smug. I have tried this with one (complete) entry and it made no difference (you can see the first entry in the list is complete). I will try populating all fields in the database on each entry however I don't think this will make a difference.

Here is the log, can you offer any guidance as to what I am looking at and where the problem may be? :-)

I think I see an error at - getaddrinfo-,err=8 any ideas what may be causing that?

[Logcat removed]
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
09/21/15 06:01 AM (2 years ago)
OK so I have populated all database values and as suspected no difference. I have noticed something else in the log:

09-21 13:54:11.507 25166-25166/com.uker I/Choreographer? Skipped 44 frames! The application may be doing too much work on its main thread.

The first time round (above) this was 38 frames. This suggests to me that the app is skipping the database entries for some reason.

Any thoughts?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6249
Reg: Nov 07, 2012
Tamuning, GU
80,740
like
09/21/15 07:06 AM (2 years ago)
I've gotten the same thing from time to time, but it didn't hamper the app 'noticibly', so I don't think thats an issue.

and this is causing a problem:

09-21 12:53:54.567 22981-22981/com.uker W/ZZ? BT_screen_map:parseScreenData EXCEPTION org.json.JSONException: No value for subTitle

Make sure all your json keys have values, and don't use any weird characters.

If you're certain you've got everything covered, and you're still getting errors, run your url directly in jsonlint and see what it comes up with.

Let us know how it goes...

Cheers!

-- Smug
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
09/21/15 07:33 AM (2 years ago)
OK I've got to the bottom of it...

So the answer being that you must use the following syntax in your "Location List" php file to display the subtitles:-

printf("\"subTitle\":\"%s\"}", $myrow["Subtitle"]);

Notice that the first appearance of subTitle (with a capitol T). You must use camel case with the "T" this made all the difference.

There is no mention of "subTitle" in the How To documentation.

Thanks Smug for your guidance, we got there in the end :-D

Now on to changing the map markers...
 
SmugWimp
Smugger than thou...
Profile
Posts: 6249
Reg: Nov 07, 2012
Tamuning, GU
80,740
like
09/21/15 08:18 AM (2 years ago)
Glad you're all fixed. As much as I prefer a totally 'offline' app, learning how to hook up a php/MySQL backend on to an app really adds a lot of value, content wise... and far easier to administrate than any flat file. And your app can really expand with the added potential.

Now that you're off and running, take a look at the WB Addons when you have a spare moment; even if you don't utilize the entire package, the sample scripts that Susan and I created are pretty detailed, and help in creating additional screens on the fly using loadScreenObject and/or raw HTML files created with your database values.

Cheers!

-- Smug
 
Rachelle-Joanne
Aspiring developer
Profile
Posts: 65
Reg: Jan 15, 2013
Lagos
650
like
09/23/15 04:05 PM (2 years ago)
@ Appsoluetly Please I will like to know how you change the map markers. Thank you
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
09/26/15 06:35 AM (2 years ago)
@Rachelle-Joanne I just saved my marker with the same name as existing file ;-)
 
Rachelle-Joanne
Aspiring developer
Profile
Posts: 65
Reg: Jan 15, 2013
Lagos
650
like
09/26/15 07:32 AM (2 years ago)
ok thank you
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.