Issue
I'm actually working on a project that will involve a Web-App (Ionic framework, pretty new for me..) that will do that:
Posting data to a mySQL DB via an Arduino GPS Tracker (already done, hosted on 000webhost)
Building a Web-App, that will fetch those data, and display them on a map(of course using the Google maps APIs)
Possibly, draw a "daily trip" list, that will show always on a map the route made for each day (the idea here is to 'connect' each marker stored on the db)
Is there any hint on how to correctly fetch those mySQL data in Ionic? Plus, as I've already hosted a some php code in order to check if the Arduino was correctly posting, how can I test the web-app?
Solution
So first and foremost, you'll need to create an API for your MySQL. You said you've already built a small PHP application so that's a good start.
Maybe take a look at PHP frameworks such as Laravel if you'd like to use something a bit more functional. Of course, you could stick with the pure PHP route if you'd prefer.
Secondly, you need to look at how Angular works with making HTTP requests. It's reasonably straightforward but far too long to provide a comprehensive answer here.
There are some key areas you should look at:
There is an abundance of Ionic Angular tutorials online which will give you a visual starter on how to implement them but it's good to have a read first to ascertain some understanding.
When it comes to testing, try using an API testing tool such as Postman which will give you an overall understanding of the API request you are making and it's responses and/or errors.
Answered By - Super_Simon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.