Discussion Forums  >  Uncategorized

Replies: 9    Views: 205

ChrisBlair
I hate code!
Profile
Posts: 5
Reg: Jan 06, 2012
Kildare
50
01/07/12 04:36 AM (14 years ago)

File Locations

Hi, Firstly let me say that as a new (and very green) developer I am very excited by the buzztouch offering and have already begun experimenting with positive results. I feel fairly comfortable with the interface and basic concepts however, as is my nature I need to up the anti :-) I therefore have a few questions which I am hoping someone can help answer. I have an idea for a web app in my head which will use html, php and an SQLite databse for local device storage. Having already dabbled in the html side of things I have a good understanding of how that works and where the code lives etc. What i need to know is... 1. My application screens will need to call on php files and I need to know where to store the referenced php files? I imagine the php files will live in the BT_Docs folder of the project? 2. SQLite database - I created a folder in the project called Resources and placed the db in here. I am not sure that is correct so looking for a guide on this too please? 3. I am looking also for example code that specifically addresses local storage and retrieval using SQLite. Would someone be willing to support me in this? TIA and Best Regards Chris
 
ChrisBlair
I hate code!
Profile
Posts: 5
Reg: Jan 06, 2012
Kildare
50
like
01/07/12 04:39 AM (14 years ago)
Did I say new (and very green) developer :-) I forgot to mention that I am starting out on iPhone IOS development rather than Android so my post refers specifically to the iPhone. Thanks again and Best Regards Chris
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
01/07/12 07:28 AM (14 years ago)
Kildare? It's a long long way from here to there as the song says. Welcome to BT. I'm afraid I have yet to play around with any type of DB calls in BT yet but just wanted to reply and say hi and welcome to the greatest lil app house on the interwebs. These links (posted on here by @Going-Viral) look like a decent place to start: http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/ http://dblog.com.au/wp-content/uploads/2008/09/sqlitetutorial.zip - This is a sample SQLLite project that you can fire up in xcode to see the workings.
 
ChrisBlair
I hate code!
Profile
Posts: 5
Reg: Jan 06, 2012
Kildare
50
like
01/07/12 07:50 AM (14 years ago)
MacApple, A long way it may be but with modern technology it could simply be around the corner. Thanks for the welcome and the links - I found those when I was trawling around for info. Will dig deeper into them and see where I end up :-) Can you shed any light on the file locations with regard to my questions 1 and 2? Best Regards Chris
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
01/07/12 08:01 AM (14 years ago)
lol Just realised the reference I made 'long long way' is actually a reference to County Clare, not Kildare. Oh well! You are correct in your assumption that referenced docs go into BT_Docs but as far as php is concerned I reckon (and I'm not 100%) these have to go under a custom url screen. That is to say, if you are calling php screens iOS isn't going to interpret these, they are web server technologies. So when the (a) custom URL screen is called it's going to hit your webserver to pull the php files and then it will feed that output back into the custom url screen. That make sense. Need more coffee.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/07/12 09:58 AM (14 years ago)
Howdy! Keep in mind that a php script has to be run on a platform that supports the installation and running of PHP itself...like a web server. I don't think iOS or Android natively support that. So, any calls a php script in your app make would have to be out to a server and then back again to your app with the response. It's not like Javascript that can run locally in the browser if you provide the correct files. PHP is a client-server model. Mark
 
ChrisBlair
I hate code!
Profile
Posts: 5
Reg: Jan 06, 2012
Kildare
50
like
01/07/12 10:12 AM (14 years ago)
Hi Mark, Thanks for the input - made me re-think where I was going with this idea :-) All I want to do is interact with a SQLIte db via a custom html page (now using JS :-) I imagine that is doable and will investigate this further. What I really need to know is where in the projects file structure do I save the SQLite db - does that go in the BT_Docs folder or can I (as stated above) store it in a new folder called Resources that I created in the project? Thanks and Best Regards Chris
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/07/12 10:43 AM (14 years ago)
Hi Chris, Anything related to docs - HTML, PDF, Word, etc - go into BT_Docs. So I'm guessing that's where your stuff will go. There's been lots of talk on the forums about using Sqllite db in BT apps, but not sure if anybody has figured it out. If you do, a tutorial would be invaluable to the rest of us! Thanks, Mark
 
ChrisBlair
I hate code!
Profile
Posts: 5
Reg: Jan 06, 2012
Kildare
50
like
01/08/12 07:59 AM (14 years ago)
Mark, If I come up with anything positive I will surely pass it on. Pulled an all nighter - couldn't sleep with this stuff going round my head - and got through a mountain of information. I need a sanity check so here goes... I found loads of examples out there using html5, javascript and SQLite db's, all of which are a piece of cake (says the novice hehehehe). I got a good few examples up and running on Safari, now, to my very tired mind the process should be almost identical in BT? Let's say I create a menu item that loads a custom html page containing a very simple form and some JS to take the contents of that form and store it in the SQLite db - just like I did in Safari - it should work, right? Wrong! I could be barking up the wrong tree here but the only reason that I can see for it not working is because of where the db should be saved to and I do not know where that should be in order for it to be transferred over when the project gets built and passed through the sim. I have tried putting it into BT_Docs, A resources folder that I created in the project, Copy Bundle Resource (under Targets in the project), and I have manually copied it to the Documents folder that the app creates when washed through the simulator just to make sure that the app had access to it when running on the sim. Nothing!!!!!!! I cannot believe that it is this difficult to achieve. The iPhone and Safari are using the very same technologie(s) so what is the problem? Would someone either please shoot me or send me a lifeline :-) WIll continue on with the good fight and let you know if anything materialises. Best Regards Chris
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/08/12 06:49 PM (14 years ago)
Hi Chris, I think you are right when you say only reason that I can see for it not working is because of where the db should be saved to and I do not know where that should be in order for it to be transferred over when the project gets built and passed through the sim. In the examples you gave, you are using an accessible local file system. That same thing is not available on iOS, least not in the way we are accustomed to on our PCs/Macs. So, the game here, like you've said, is figuring out how to store and access the info. Wish I had an answer, but will continue to monitor this for when you eventually come up with it! Mark
 

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.