Discussion Forums  >  Maps, Device Location, Tracking

Replies: 63    Views: 219

GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
06/05/12 02:08 PM (13 years ago)

[How-To] Posting Device's Current Location to a Database

Hello! Based on some requests, I've written a new tutorial, this time on "Posting Device's Current Location to a Database." It will show you how to create the database file, how to capture the user's current location (and extra comments), and how to spit it all back, via JSON, to a Multiple Location screen! The direct link is here: http://www.buzztouch.com/resources/Posting_Current_Location_to_a_Database_v1.0.pdf But it's also linked to the general How To's section: http://www.buzztouch.com/resources/ As always, constructive feedback requested! Mark
 
Vali
buzztouch Evangelist
Profile
Posts: 193
Reg: May 22, 2011
Bucharest
5,830
like
06/05/12 02:57 PM (13 years ago)
I know Mark does not need any votes of confidence, but I just wanted to say that I tested this new tutorial and it works flawless. Now the imagination is the limit. Thanks Mark!(again)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/05/12 03:01 PM (13 years ago)
Hi Vali, I appreciate the vote of confidence! It's always good to know that people can understand the processes that I write up! Mark
 
Tony @ Buzztouch
buzztouch Evangelist
Profile
Posts: 528
Reg: Mar 05, 2011
Saint Louis, Mi...
24,620
like
06/05/12 05:51 PM (13 years ago)
Mark great job as always my friend! Tony "Magic Man"
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
06/05/12 06:45 PM (13 years ago)
awesome Mark!
 
Known
Apple Fan
Profile
Posts: 83
Reg: Jan 07, 2012
Suttons Bay, Mi...
830
like
06/05/12 07:57 PM (13 years ago)
Mark- Just when I thought it was safe to look away you go and do this!!! Thank you so much. I am looking forward to finding a million different ways to implement this! I will report back when I do. Cheryl
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/05/12 08:03 PM (13 years ago)
Hi Cheryl, Thanks! Keep your eyes peeled...got some more good stuff in the hopper for the next few weeks! ;-) Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/05/12 10:44 PM (13 years ago)
Hi GoNorthWest, I've tried tons of things so far and I'm close to using this in my 1.4 app. Stay tuned for my additions. Sevens
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
06/06/12 03:21 AM (13 years ago)
I haven't read it yet but thanks Mark!! Always appreciated!
 
RobK
Lost but trying
Profile
Posts: 73
Reg: May 19, 2012
Milton Keynes
6,530
like
06/06/12 06:50 AM (13 years ago)
Thanks! I read that and immediately thought it would be great feature to add to my app - But I can't understand a bloomin word of it, despite the 'If you are a complete novice...' bit There might be a long email on its way!!!!
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/06/12 07:40 AM (13 years ago)
So I have it working up to this point: - created the "theguide1" table on my server via myphpadmin - DONE - created and tested location.php. This works and displays the google map - DONE - Link the HTML/PHP form to your app I have the customURL page working in my BT2 app, and it loads on my iphone fine, but it does not feed in the deviceLatitude or deviceLongitude info. Any ideas?
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/06/12 08:19 AM (13 years ago)
Yeah. The same on Android. There is something with the php. Working on it now.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/06/12 08:39 AM (13 years ago)
So, you're seeing the form, but no map with your current location is being displayed? Do you have Turn on GPS enabled for the app? Also...I'm not sure this will work in a simulator...I've always used a live test app. Mark
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/06/12 08:42 AM (13 years ago)
I did see one possible issue; in your location_php.txt, you first set mysql_select_db("yourdatabasename",$db); but then later you hardcode "theguide" as your table database name. $sql = "INSERT INTO theguide (SubmitterEmail, latitude, longitude, Description, Status) VALUES
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/06/12 09:20 AM (13 years ago)
Yep...that should work just fine, so long as you have a table called "theguide" in whatever database you create. Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/06/12 09:46 AM (13 years ago)
doesnt work on the simulator unless you have a GPS attached and connected to the simulator. However, having a generic map load on real device. Looks like there is no update to the table. Perhaps the code is not updating the table properly
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/06/12 09:51 AM (13 years ago)
Hi Sevens, Have you ensured that the table you created matches in name the table that is coded into the script? If it's not "theguide" then it needs to be changed. Mark
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/06/12 09:56 AM (13 years ago)
Mark, I had overlooked turning on GPS...that fixed it, and it now feeds in the Lat/Lon perfectly. Thanks for a great how-to!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/06/12 10:01 AM (13 years ago)
Awesome @RonBo! Glad it's up and running! Mark
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/06/12 01:43 PM (13 years ago)
I was having an issue of getting my map points to display. They were getting into the mysql table, but would not display. Not sure if this affects anyone else, but here is what I found out: When the data base is created, latitude and longitude are in lower-case CREATE TABLE IF NOT EXISTS `theguide` ( `ID` int(11) NOT NULL auto_increment, `SubmitterEmail` text NOT NULL, `latitude` text NOT NULL, `longitude` text NOT NULL, `Description` text NOT NULL, `Status` text NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=29 ; But later on in location-list.txt, you switch to upper-case if ($myrow = mysql_fetch_array($result)) do { printf("{\"itemId\":\"%s\",", $myrow["ID"]); print "\"itemType\":\"BT_MapLocation\","; printf("\"latitude\":\"%s\",", $myrow["Latitude"]); printf("\"longitude\":\"%s\",", $myrow["Longitude"]); printf("\"title\":\"%s\"}", $myrow["Description"]); if ($num > $i) printf(","); $i++; As soon as I changed those ($myrow["Latitude"]) to lower-case, all my map points came in and displayed in my BT App. My php server is ver 5, if that matters. I can switch them back to uppercase, and only the blank google map displays. It even shows my current iphone location, as I turned that on in the BT settings. But when I edit my location-list.php to have those in lower-case, my app displays the points fine.
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/06/12 01:48 PM (13 years ago)
Hmm good catch. Trying now.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/06/12 02:11 PM (13 years ago)
Interesting! I'll have to check that out a bit. The script worked exactly as described in it's current version for a number of us. But I can see how what you described might cause an issue. Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/06/12 04:39 PM (13 years ago)
That did the trick. Hmmm. Interesting. So I have finally mapped the device loc. now to save in table and recall in a non BT map is the second half of the deal. Man I'm slow. Thanks for the good work, GoNorthWest. Maybe I soon I will get special help with adjusting v1.4 to accept a dataURL anyone have any thoughts? Sevens
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/11/12 07:18 AM (13 years ago)
Mark, any chance of adding in the ability to take a photo of the current location, and saving that as well? Would be cool to attach link of photo to the map pointer.
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/11/12 09:25 AM (13 years ago)
@Ronbo I bet that is possible. Maybe you'll need to add that to the result of the form. Buzztouch servers aren't designed with photo capabilities for their maps. But you could create the code if you have the technosmarts.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/11/12 09:47 AM (13 years ago)
That is something I also want to add to this setup. The issue, I think, is attaching a photo to the form data before it gets sent. I'm not sure how to do that from an HTML form in an app. If we could get the photo into the database, then everything else would be easy from there, I think! On my list, but sorta low priority at the moment. Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/11/12 10:05 AM (13 years ago)
What's high for youGNW?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/11/12 10:09 AM (13 years ago)
Got a big doc in the works (Android related), and then general life and work! Got a few actual apps I want to work on as well! But, the topic here actually has to do with an app idea I have, so it might move to a higher priority. Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/11/12 12:03 PM (13 years ago)
You know I never got the table updated using my form. I did tons of research, but no luck. Check out my app in the market if u get a chance. Its specifically designed to use this tech. But seems like my server won't allow adding to the table I created.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/11/12 12:09 PM (13 years ago)
Bummer! I interpreted from you comments a few rows above that you had gotten the save to table part working. What's the app URL? Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/11/12 12:29 PM (13 years ago)
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/11/12 12:32 PM (13 years ago)
I got the form to call for the device location and display that static map. Adding to the table from the form is not working.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/11/12 12:33 PM (13 years ago)
Looks pretty darn cool! If I had an Android device, I'd install for sure! Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/11/12 01:13 PM (13 years ago)
Oh no android? I don't have an iPhone. Developing only on simulator.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/11/12 01:14 PM (13 years ago)
I have an iPhone and iPad, but use AVD for Android dev.
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/19/12 08:39 AM (13 years ago)
UPDATE: Called my hosting service and had it out with the tech. Tables are being written by php now. Strange hickup in hosting. Got tables inserted now to pull from tables is another task. Code keeps returning Nothing there to see. So code is being read and executed, aexcept there seems to be an issue with the printf commands. Here is what I have in my dataURL php code. <?php $conn = mysql_connect("mysql-happyforum.domainname.com", "username", "password"); $db = mysql_select_db("happyforum",$conn); $result = mysql_query("SELECT ID, latitude, longitude, Description from shipit_contacts",$db); $num = mysql_num_rows($result); $i = 1; print "{\"childItems\":["; if ($myrow = mysql_fetch_array($result)) do { printf("{\"itemId\":\"%s\",", $myrow["ID"]); print "\"itemType\":\"BT_MapLocation\","; printf("\"latitude\":\"%s\",", $myrow["latitude"]); printf("\"longitude\":\"%s\",", $myrow["longitude"]); printf("\"title\":\"%s\"}", $myrow["Description"]); if ($num > $i) printf(","); $i++; } while ($myrow = mysql_fetch_array($result)); else {echo "Sorry, nothing there to see!"; } print "]}"; ?> SEE ANY ISSUES WITH THIS?
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/19/12 03:17 PM (13 years ago)
You should verify your SELECT statement is working, by using your hosting providers SQL admin tool. My provider uses phpMyAdmin, and it provides an interface for you to Browse, Edit, etc. your mySQL tables. Use the SQL tab to run/test your "SELECT ID, latitude, longitude, Description from shipit_contacts" to make sure it returns records.
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/19/12 07:58 PM (13 years ago)
It returns records. Try the link in your browser. It works http://www.sevensco.com/phpBB-3.0.10/phpBB3/shipit_contact_list.php
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/19/12 08:12 PM (13 years ago)
I see your records, so that is good. Have you checked that your Screen Data URL for your View screen has the variable to send the Device Data? http://test.example.com/location_list.php?latitude=[deviceLatitude]&longtitude=[deviceLongitude]
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/19/12 08:25 PM (13 years ago)
I haven't. But how would that affect the points not plotting on the map? Besides, the device location shows on the map.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/19/12 09:47 PM (13 years ago)
Hello! Sorry it's taken me so long to weigh in on this...but you guys have worked out most of it yourself! If you take the URL: http://www.sevensco.com/phpBB-3.0.10/phpBB3/shipit_contact_list.php And plug it into the "Screen Data URL" section in the Advanced Properties for a Location Map, your points will show up on the map. I tested it in a test app I have, and it works! Do that, and you should have the complete solution in place. Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/20/12 01:00 AM (13 years ago)
Hi Mark, I sent the dreaded email to info@buzz touch.com. There is an issue with the app that is not usual. So David said to email. Still waiting to hear what the problem is. To think, all this heart ache is for something I could not help...
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/20/12 05:33 AM (13 years ago)
I should have been more clear; in my app, I needed to append the device lat/lon variables, as I only want to display a max of 20 map points in a 25 mile radius out from where the device is: $sql = "SELECT id, latitude, longitude, Description, ( 3959 * acos( cos( radians($MyLat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($MyLon) ) + sin( radians($MyLat) ) * sin( radians( latitude ) ) ) ) AS distance FROM theguide HAVING distance < 25 ORDER BY distance LIMIT 0 , 20";
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/20/12 08:34 AM (13 years ago)
That's brilliant Ronbo! I'm taking calc 3 in school now so I'm actually doing problems like this code. What's the arbitrary 3959? Anyway... David caught something that was wrong with the plugin for Android. Everyone who helped me happened to have an older plugin. The new plugin didn't allow for blank subtitles. So with a keen eye, David caught a line in the logcat that showed a JSON exemption. Finally, he just asked me to add subtitles to fix all my points and have them show using the code I already have until he rolls out the new plugin for maps.
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/20/12 08:45 AM (13 years ago)
Oops... Radius of earth in miles = 3959
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/20/12 09:01 AM (13 years ago)
Any published apps @RonBo? I'd like to see how that looks. I'm also wondering if I could display another layer of points data on the same map.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/20/12 09:42 AM (13 years ago)
@RonBo...that's some brilliant code, and I've been looking for something exactly like that for a long, long time! Thanks! Is your problem...with respect to points being displayed on the map...solved now? Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/20/12 10:20 AM (13 years ago)
Yes. Worked on it until early this morning. Finally found the problem. Android plugin must have subtitles. Maybe a good addition to your PDF.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/20/12 10:22 AM (13 years ago)
So, for each map location, on Android, there has to be a title AND sub-title for it to work? Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/20/12 10:25 AM (13 years ago)
Exactly. So this is what the code should look like for everyone to be happy: <?php $conn = mysql_connect("mysql-finallyforum.happy.com", "happyuser", "password"); mysql_select_db("finallyforum",$conn); $result = mysql_query("SELECT ID, latitude, longitude, Description, address from shipit_contacts",$conn); $num = mysql_num_rows($result); $i = 1; print "{\"childItems\":["; if ($myrow = mysql_fetch_array($result)) do { printf("{\"itemId\":\"%s\",", $myrow["ID"]); print "\"itemType\":\"BT_mapLocation\","; printf("\"latitude\":\"%s\",", $myrow["latitude"]); printf("\"longitude\":\"%s\",", $myrow["longitude"]); printf("\"title\":\"%s\",", $myrow["Description"]); printf("\"subTitle\":\"%s\"}", $myrow["address"]); if ($num > $i) printf(","); $i++; } while ($myrow = mysql_fetch_array($result)); else {echo "Sorry, nothing there to see!"; } print "]}"; ?>
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/20/12 10:28 AM (13 years ago)
Excellent! Thanks for all the work on that. I'll have to contact @David and see if we can remove the restriction for a sub-title. Not sure if it's required by Android itself, or just the code David wrote. Mark
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/20/12 10:29 AM (13 years ago)
interestingly @RonBo and @GNW, the select statement is unneccessary. the code prints from the table whether columns are declared or not. Weird but I added the address to be printed in my code without adding to SELECT statement. Thoughts?
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/20/12 10:36 AM (13 years ago)
Yes mine is working great. My database has over 700 entries across the us tracking wild honeybee hives. It took too long to to load them all and it makes sense to see ones close by. I'm adding the ability to choose the distance you display from your location. I've been collecting my data from my website www.savethehives.com/fbp.
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/20/12 10:39 AM (13 years ago)
Yes mine is working great. My database has over 700 entries across the us tracking wild honeybee hives. It took too long to to load them all and it makes sense to see ones close by. I'm adding the ability to choose the distance you display from your location. I've been collecting my data from my website www.savethehives.com/fbp.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/20/12 10:40 AM (13 years ago)
Honeybee tracking...that's pretty cool!
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/20/12 11:08 AM (13 years ago)
I'm sure that code will come in handy when I have hundreds logged onto my app. So just insert that line and I'm limited to 20 and reduced map view size?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/20/12 02:36 PM (13 years ago)
@RonBo...Feral Bee Project...totally cool stuff! That data is PERFECT for an app! Mark
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/20/12 04:11 PM (13 years ago)
Yeah that I why I asked about letting people take photos and attach to the map pointers.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/20/12 04:16 PM (13 years ago)
Totally agree. Haven't found a solution to that yet, aside from using the email photo feature. But there has to be a better way. Mark
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/22/12 10:16 AM (13 years ago)
Mark, having an issue getting driving directions to work. The BT1.5 instructions say to "Set loadScreenWithItemId to "showDirections" to show the driving directions option. Or use the itemId, or the nickname, or the the JSON data for a screen or menu or feature. Only one of these three properties will be used." Can't get it to work, you see any syntax error? print "{\"childItems\":["; // build JSON for BT to consume if ($myrow = mysql_fetch_array($result)) do { printf("{\"itemId\":\"%s\",", $myrow["ID"]); print "\"itemType\":\"BT_MapLocation\","; printf("\"latitude\":\"%s\",", $myrow["latitude"]); printf("\"longitude\":\"%s\",", $myrow["longitude"]); // printf("\"loadScreenWithItemId\":\"showDirections\","; printf("\"subTitle\":\"%s\",", $myrow["description"]); printf("\"title\":\"%s\"}", $myrow["name"]);
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/22/12 10:16 AM (13 years ago)
Mark, having an issue getting driving directions to work. The BT1.5 instructions say to "Set loadScreenWithItemId to "showDirections" to show the driving directions option. Or use the itemId, or the nickname, or the the JSON data for a screen or menu or feature. Only one of these three properties will be used." Can't get it to work, you see any syntax error? print "{\"childItems\":["; // build JSON for BT to consume if ($myrow = mysql_fetch_array($result)) do { printf("{\"itemId\":\"%s\",", $myrow["ID"]); print "\"itemType\":\"BT_MapLocation\","; printf("\"latitude\":\"%s\",", $myrow["latitude"]); printf("\"longitude\":\"%s\",", $myrow["longitude"]); // printf("\"loadScreenWithItemId\":\"showDirections\","; printf("\"subTitle\":\"%s\",", $myrow["description"]); printf("\"title\":\"%s\"}", $myrow["name"]);
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
06/22/12 10:28 AM (13 years ago)
Never mind...found the error! working now!! if ($myrow = mysql_fetch_array($result)) do { printf("{\"itemId\":\"%s\",", $myrow["ID"]); print "\"itemType\":\"BT_MapLocation\","; printf("\"latitude\":\"%s\",", $myrow["latitude"]); printf("\"longitude\":\"%s\",", $myrow["longitude"]); print "\"loadScreenWithItemId\":\"showDirections\","; printf("\"subTitle\":\"%s\",", $myrow["description"]); printf("\"title\":\"%s\"}", $myrow["name"]); if ($num > $i) printf(",");
 
erdocsg
Lost but trying
Profile
Posts: 21
Reg: Jan 31, 2012
philadelphia
1,160
like
06/22/12 10:29 AM (13 years ago)
[delete]
 
Sevens
Code is Art
Profile
Posts: 146
Reg: Jan 28, 2012
New York Metro ...
11,960
like
06/22/12 03:18 PM (13 years ago)
I wonder if I can use that show directions line in my plugin? Hmm.
 

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.