- This topic has 8 replies, 2 voices, and was last updated 12 years, 1 month ago by elussya.
-
AuthorPosts
-
elussyaMemberI’m trying to import the most recent values from this website:
http://green-grow-tech.com/list_data.phpI’ve been trying to design a mobile app for awhile, and MobiOne seems to be the right one, however – I’m not sure how to have the app pull the data from the above site
(say, every minute to every few minutes).I’ll be purchasing once I can get help with this issue. It seems some people have been able to create work-arounds in their specific instance, but I can’t figure one out that I understand / can get to work.
Can someone help?
I just want to be able to get this working so that I can play with the program more.
Hope to hear from someone soon.
~Elussya
elussyaMemberHere’s my current layout, in case it helps?
Attachments:
You must be logged in to view attached files.
elussyaMemberAnyone?
support-michaelKeymasterA couple of questions:
1) are you planning to build a native app or a mobile webapp?
– if you are planning a webapp then consider generating a php UI of your mobile UI and bind it to your data on the server.2) if you are planning a native app can you get access to this data in a little more structured manner?
You are requesting to download and parse the data from an html doc which is doable but I avoid screen scrapping hacks unless I absolutely can’t avoid doing it. Can you provide web access to the data in a structured format, e.g., json or xml?
elussyaMemberWayne,
1.) I’m planning on a native app.
2.) The data is the way it comes in more-or-less. The data is coming from a arduino system I’m putting together for my father, and aside from the system itself logging in, and giving the data to it, that’s all there is.
There is the php file that controls the table,
it’s code is:
if(!isset($_GET['client'])) header("location: index.php"); $client = $_GET['client']; if(!isset($_GET['distance'])) header("location: index.php"); $distance = $_GET['distance']; if(!isset($_GET['light'])) header("location: index.php"); $light = $_GET['light']; if(!isset($_GET['humidity'])) header("location: index.php"); $humidity = $_GET['humidity']; if(!isset($_GET['temperature'])) header("location: index.php"); $temperature = $_GET['temperature']; // To protect MySQL injection (more detail about MySQL injection) $client = stripslashes($client); $distance = stripslashes($distance); $light = stripslashes($light); $humidity = stripslashes($humidity); $temperature = stripslashes($temperature); $sql = "INSERT INTO $tbl_name (client, timestamp, distance, light, humidity, temperature) VALUES ($client, NOW(), $distance, $light, $humidity, $temperature)"; if(mysql_query($sql)){ // redirect to file "create_message.php" echo "SUCCESS"; } else { echo "ERROR"; } ?>
I’m hoping you can help me out.
Cheers,
El
elussyaMemberCurrently I’d be viewing (or letting him view) the data on this page: http://green-grow-tech.com/sensor-vine.php
But, I really want the ability to make this a phone app for him?
support-michaelKeymasterThanks for the info. From what you have shared it’s doable to use mobione to create your app. A few more thoughts:
1) It sounds like you have access to the web code (php) and modify the format that data is communicated from the arduino to your app. Yes/No?
1a) Assuming yes, I recommend creating a new web api that will return app data in json format. For more info see http://php.net/manual/en/function.json-encode.php This recommendation assumes the arduino web server support json formatting.
2) mapping the data into your UI, a.k.a., data binding will require a little bit of javascript.
3) Your app looks cool. I would like to discuss your app in more detail. Please drop me a note at support at genuitec dot com, title it “Green App Followup for Wayne/MobiOne Team”. I’ll follow up with you by email thereafter.
elussyaMember1) Yes, I have access to the web code. The arduino isn’t the server though- it’s just sending the info to the go-daddy server.
1a) I am assuming that the go-daddy server supports json formatting. I’m just not familiar with json at all?2) I am not the most familiar with javascript, I am a little adept at ‘acquiring’ examples to fit my need when possible.
3) Thank you! I’ve sent an email.
elussyaMemberI should actually be able to add the ability to return the app data in json format. Apparently the newer php versions allow this natively without much work.
I’m bouncing ideas off of a friend currently on how easiest to implement this.
Looking forward to your email. -
AuthorPosts