Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 18    Views: 66

bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
01/22/14 11:56 AM (11 years ago)

Global Variables

My question is fairly simple. Some background. I need a way to store a variable that can be stored in the app delegate so I can access this variable at any time in any screens. I know how to do this code wise already so I do not need a sample of that. My question is this. Is there a way to add a global variable to the app delegate in a buzztouch app without have to recode/modify the app delegate every time you download the app from the control panel? thanks, Bob
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/22/14 12:04 PM (11 years ago)
Unfortunately, no. When you download the source code from the control panel, it gives you the standard appDelegate that everyone gets - it has no way of knowing what changes you made locally after the last download.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/22/14 12:25 PM (11 years ago)
Yup, as chris said. In an ideal world, you only need to download the source code once, and update the config as needed. If you need new plugins, download a new project, drag those plugins into your old project. That would be the *best* way to handle it most efficiently. Best of luck. David
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/22/14 12:27 PM (11 years ago)
yep - I think of one of the goals is to allow users to download an individual plugin for their project. But that's a ways off yet.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/22/14 12:28 PM (11 years ago)
Small steps :) See you in the meeting today Chris.
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
01/22/14 01:02 PM (11 years ago)
So I guess the best solution to this issue then is to just add the code for the global variable every time you download the app? I think that is what you guys said just clarifying though. thanks, Bob P.S ok I see now what you mean. Edit the srouce code how you need it in the project and then just move the new plugins into the folder and update the config with the new one with that plugin?
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/22/14 01:04 PM (11 years ago)
That's right, but if you read my post it explains how you don't have to download a new project each time so you wont have to re-do it. :-) David.
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
01/22/14 01:04 PM (11 years ago)
Ya I just edited my answer :D thanks for the info!!
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/22/14 01:07 PM (11 years ago)
No problem mate. Cheers.
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
01/22/14 01:10 PM (11 years ago)
So as far as the plugin market goes, how would this work? Lets say I wanted to make a series of database plugins and to use them they need a global variable that is a handle to the database then should I just document that you need to fill this in in the app delegate. Or should I try to build it without the need of global variables? thanks, Bob
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/22/14 01:15 PM (11 years ago)
Oh, you're trying to build a plugin for distribution? The best choice is to *try* to build it without your global variable, like you said. The second best choice is then to make it as simple and easy as possible to integrate the variable and document it as simple and specific as possible for the release. Note plugins like Kittsy's Favorites or my Message Bar plugin. David.
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
01/22/14 01:16 PM (11 years ago)
Well plugin is ultimate goal but for now not really haha. Thanks! Bob
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/22/14 01:18 PM (11 years ago)
:) I suggest you check out some of the BTU lessons and earn some points! https://www.buzztouch.com/account/btu.php David
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
01/22/14 01:21 PM (11 years ago)
I have but it was on my boss's account.... speaking of that is there any way to link my account with his paid account so I do not have to log into his? In fact I have made some plugins already. I have not put them on the market because they are copies. But at this point waiting to get the self hosted stuff up first before continuing. Speaking of that did buzztoch 3.0 ever get ported to the self hosted stuff yet?
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/22/14 01:23 PM (11 years ago)
3.0 to self hosted - yup, but there are bugs, so don't upgrade on a control panel you're not willing to have issues with. Unfortunately, no (the account thing), I do the same thing you do, ha! Going SH is the best thing you could do on buzztouch, good idea. Cheers, David
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/23/14 07:52 AM (11 years ago)
Get your own account, be indie! :-) Are you aware of loadScreenObject as a JSON object for database situations? Do a Google search on these forums for that phrase. Tell us more on the database plugin. I am all ears. We can work together if you need a buddy. -- Niraj
 
1stFriday
Aspiring developer
Profile
Posts: 4
Reg: Jun 26, 2012
Pensacola
5,890
like
01/23/14 12:14 PM (11 years ago)
I am coding it right now. I am using kinvey to handle to database. I will allow people to change databases, change queries, and change collections. I can handle it the only issue I see now is passing info between screens haha. A whole other story hahaha.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/23/14 06:22 PM (11 years ago)
I thought Kinvey was expensive?
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
01/23/14 08:58 PM (11 years ago)
It is not that much for me but that is because we got grandfathered into some stuff. But even with it's current pricing scheme it is only free for first 100 users and then $7 per month per 1000 users. I have not done much research but that sounds reasonable to me. Especially considering I can code a database back end with it in like 30mins hahaha. Anyone else have a comment?
 

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.