Android Question I Need Conversion of GoogleMap with marker from SQLite to PHP_MYSQL Version

Discussion in 'Android Questions' started by omo, May 29, 2019.

  1. omo

    omo Member Licensed User

    Please, help me!
    The attached file below populates markers from sqlite database, i don't have issues with using sqlite with google map and handling other semi-advanced issues after wonderful people like Erel, Don Manfred, Klaus, Mashiane (comprehensive php/mysql tutorial) and entire forum members had resolved my issues relating to google map in one way or the other in the past (God bless you all!). Now, what i need is to convert the code below (or anybody can give me another sample code) that populates custom markers on google map from mysql database using only php and b4a. I have tried several times to convert with no success, i don't have issues with handling CRUD operations in php/mysql, but showing custom markers have been giving me sleepless night since many days now.
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Why use PHP? Use jRDC2. It is simpler and more powerful.
     
  3. omo

    omo Member Licensed User

    Yes, I already know about security issues like SQL injection and others discussed in the forum concerning PHP and mysql and measure to improve security. The provision and resources I have right now is for PHP and Mysql and I have gone far in the app except how to display googlemap custom marker from mysql. However, about jrdc2, I can only handle simple program with it, once, it gets to complex coding, I get lost with the structure. I have not been able to see comprehensive tutorial when it comes to complex coding and program flow, i can connect to jrdc2 server, I can do CRUD operation and simple stuffs, but getting to complex coding structure, I get lost. At moment, I will be happy if I can get help converting the attached file above to PHP mysql version as stated in the question.
     
  4. DonManfred

    DonManfred Expert Licensed User

    It does not matter where you get the infos from. JRDC2, PHP, SQLite, Textfile.

    Get the data for the Markers and create them based on the data.

    Where/what exactly is the problem?
     
    Last edited: May 30, 2019
  5. omo

    omo Member Licensed User

    Thank you DonManfred, honestly, I can't even state what/where the problem lies, but I know if the simple google map that shows customized marker from mysql_php or the one attached above is converted for me to PHP mysql. I should be able to adapt it to resolve problems I am facing relating to my application.
     
  6. DonManfred

    DonManfred Expert Licensed User

    Start with providing more informations! What problems? Which error? Give us a php-url which returns the markers you want to show.
    Start a new thread for any question/issue you have.
     
  7. omo

    omo Member Licensed User

    OK, I will try and upload mysql, php and b4a where I guess problem might lie together. Thank you!
     
  8. omo

    omo Member Licensed User

    Here attached is my attempt to convert the above google map with customized marker to php_mysql version.
     

    Attached Files:

  9. omo

    omo Member Licensed User

    Things to Note:
    I used FusedLocationProvider library to obtain user's latitude and longitude through cell/telecommunication network to replace GPS as used in Erel's Background Tracking Location code. After the main activity loads, between 30 to 50 seconds, it gives latitude and longitude through global variables defined under 'tracker1' service module. These latitude and longitude and other variables defined in the program are used to perform some calculations before sending the results to SQL query in PHP. Running the program, map is showing but no marker is been populated from database. I have checked and re-checked, but to no avail.
     
  10. DonManfred

    DonManfred Expert Licensed User

    Querying
    from a database results in a mysql-error. This is the sql query your php is generating.
    the answer to your action mapfrag is always empty as of the mysql-Error.
     
    Last edited: May 30, 2019
  11. omo

    omo Member Licensed User

    With Distance, I am trying to create 'Distance' column from the query programatically. However, if it is not possible that way, I have another column in mysql database called 'userdistance' which you can use if 'Distance' can not be generated from Query programmatically. Although, 'Distance' is generated programmatically in the first post attachement when used in SQLITE. Thank you very much for assistance!
     
  12. omo

    omo Member Licensed User

    In the query, it was created programmatically with 'as Distance' in Sqlite, when converting to PHP, maybe 'as Distance' is not recognised or what?
     
  13. DonManfred

    DonManfred Expert Licensed User

    Note that i removed everything about fusedlocationprovider as i only was interested in the communicationpart.

    Note that i used a MySQLi Class.

    WhatsApp Image 2019-05-30 at 17.49.46.jpeg
     

    Attached Files:

  14. DonManfred

    DonManfred Expert Licensed User

    Things to note too:

    - You are using an VERY VERY OLD httputils module. I have replaced it with okhttputils modules.
    - I have changed all call to use multipartpost as this is the most interesting here and you dont need to convert a map to a query manually (it is the wrong solution). See my changes in your code.
     
    mendiburen likes this.
  15. omo

    omo Member Licensed User

    DonManfred, My standing ovation for you! I delayed in getting back to you so I can cool down to check it and know where again I may be having problem adapting it to my need. I have seen all the changes you made and your comment, I will learn a lot from it. However, getting it adapted to my local wamp server is not giving me result at moment, but I know it should be something to overcome after more research. I will post back the report +ve or -ve after much trial. Thank you!
     
  16. DonManfred

    DonManfred Expert Licensed User

    Try to create a small app just with the api calls and a googlemap.
    it wil be easier to find problems if you do not need to spent time on other issues.
     
  17. DonManfred

    DonManfred Expert Licensed User

    What does "+ve" and "-ve" mean?
     
  18. fixit30

    fixit30 Active Member Licensed User

    +ve = Positive
    -ve = Negative
     
    DonManfred likes this.
  19. DonManfred

    DonManfred Expert Licensed User

    is this knowledge for electricians?
     
  20. omo

    omo Member Licensed User

    Sorry for Delay Response,
    +ve (positive response) means if i am able to convert and run your wonderful solution, i will report back to you.
    -Ve (Negative response) means if i exhaust all my energy trying to adapt or run this your wonderful solution, but due to some technical issues beyond my power can still not do so, then i will still report back to you.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice