Mobile - connect to database

瀏覽次數:6 次
跳到第一則未讀訊息

Alex Samoilescu

未讀,
2012年2月17日 晚上8:24:182012/2/17
收件者:mobileweb...@nyu.edu
Sean,
Wanted to get your opinion/direction on something.  It  seems that the biggest hurdle for me at this point  is finding out a way to connect my mobile app to an existing SQL database - that's where my data exists at this point.  From my research so far, it seems that I will need to create a web services in order to make my data available to the outside world via XML or JASON.  After the web services are available, then I can consume data using mobile app.  

Am I approaching this the right way?  Can I access data from mobile device any other way than through a web service?  Thoughts, advice?

Alex

--
Regards,
Alex Samoilescu

T: 646.484.8415

Sean Montgomery

未讀,
2012年2月18日 下午1:17:102012/2/18
收件者:mobileweb...@nyu.edu
Hi Alex,

Generally, yes, I think you're heading in the right direction. 
You can use AJAX to POST a JSON object to your server-side PHP, which can handle all your SQL reads/writes and then return JSON data via an AJAX response.
This looks like a pretty simple tutorial - http://simpletutorials.com/?path=tutorials/javascript/simple_ajax
and another example / tutorial here - http://api.jquery.com/jQuery.post/

You could alternatively use XML to wrap up your data rather JSON objects - e.g. http://www.javascriptkit.com/dhtmltutors/ajaxgetpost3.shtml
but I think parsing JSON is really nice and easy, so I would go that route unless you come up with a reason not to.

Let me know if this is helpful.

Cheers,
Sean

Sean Montgomery

未讀,
2012年2月19日 晚上11:50:362012/2/19
收件者:mobileweb...@nyu.edu
In case it helps, I found this simple example using jquery to POST JSON data to/from a php server -  http://www.devirtuoso.com/2009/07/beginners-guide-to-using-ajax-with-jquery/ 
-s

Alex Samoilescu

未讀,
2012年2月20日 凌晨12:33:102012/2/20
收件者:mobileweb...@nyu.edu
Thank you, this is very helpful - I think this is all coming together now.  Can't wait to implement.
Alex

Nick Santaniello

未讀,
2012年2月23日 下午3:58:382012/2/23
收件者:Mobile Web Spring 2012
Hey Alex,

I've accesed SQL databases from my mobile web apps before using some
simple PHP. There are some JQuery helpers for sending requests to php
scripts such as $.post that make the process a lot easier on the HTML
side. If you want, I'm happy to show you what I know sometime.

Nick

Martín Bravo

未讀,
2012年3月1日 下午5:51:302012/3/1
收件者:mobileweb...@nyu.edu
a good reference for what to put in your .gitignore file


then if you had already commited the project you want the files to be removed from the repo but not  from your project.

git says you can do : git rm --cached <file>

in our case (you can just copy and paste in the project folder in the terminal):

git rm --cached *.apk 
git rm --cached *.ap_ 
git rm --cached *.dex
git rm --cached *.class
git rm --cached local.properties
git rm -r --cached bin/
git rm -r --cached gen/


On Fri, Feb 17, 2012 at 8:24 PM, Alex Samoilescu <alex.sa...@gmail.com> wrote:

Ben Turner

未讀,
2012年3月1日 下午5:57:512012/3/1
收件者:mobileweb...@nyu.edu
Thanks for this.  This answered my question to the ITP list too.

Sheiva Rezvani

未讀,
2012年3月1日 下午5:58:502012/3/1
收件者:mobileweb...@nyu.edu
awesome, thanks!

2012/3/1 Martín Bravo <bravo...@gmail.com>



--
--
To avoid criticism, do nothing, say nothing, be nothing. - Elbert Hubbard

Sheiva Rezvani
c: 310-895-8777
www.sheiva.com

回覆所有人
回覆作者
轉寄
0 則新訊息