Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 124

ThomasB
Lost but trying
Profile
Posts: 162
Reg: Jun 23, 2011
Palo Alto
3,270
06/17/12 09:06 AM (13 years ago)

Custom Plugin (v1.5 version) quick tutorial

After reading posts by Fred and others: http://www.buzztouch.com/forum/thread.php?tid=3F602DD349CD3485055A1E2 it seemed like a good time to try the "Custom Plugin" screen type in v1.5. Note this is not at all the same as "Plugins" in self-hosted. V 1.5 Custom Plugins are chunks of Objective-C source code which you can compile into your BT app. Very very powerful feature, because now it's possible to start with BT as a platform, and add any IOS source code you want. So it's pretty simple. Followed David's instructions in this post: http://www.buzztouch.com/forum/thread.php?tid=466F8F2B4030E5F36E42445 and added 2 files, mycoolapp.m and mycoolapp.h to my BT project. These were derived from BT_screen_settingsLogin.h and m (which were easy to adapt). Then added a Custom Plugin type screen to a BT app, and referenced mycoolapp in the JSON string. The net result is a nice little screen which launches from my BT menu, which has a couple colored on/off buttons to press, and logs a comment in the IOS logger. Just a demo of custom Objective-C being run from a BT screen. Sorry this isn't a more detailed...busy times. Will try to add more detail if anybody is interested. Cheers! PS: I placed the mycoolapp programs (along with a screenshot of the screen) in Dropbox at this link: https://dl.dropbox.com/u/10064949/create_custom_plugin_tb.zip. Please give it a try and note any bugs. PPS: Thanks again David. Another SWEET little feature!!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/17/12 09:21 AM (13 years ago)
Excellent, keep posting. Fred
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/17/12 12:04 PM (13 years ago)
Great great stuff @ThomasB! David buzztouchmods.com
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
06/17/12 09:05 PM (13 years ago)
Why even do anything with 1.5 when BT is very persuasive about moving to 2.0? Also is there a tutorial for creating plug-ins with BT 2.0? This is really important as I just purchased self-hosting and am following the advice of BT and using 2.0. Thank you
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/17/12 09:13 PM (13 years ago)
There's a how-to by David@Buzztouch in the self-hosting section found in your account.
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
06/17/12 09:22 PM (13 years ago)
THANK YOU!!! I will look now!~
 
lsills81
Apple Fan
Profile
Posts: 469
Reg: Mar 19, 2012
location unknow...
14,090
like
06/17/12 09:25 PM (13 years ago)
....found it, right in plain sight.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
06/17/12 11:25 PM (13 years ago)
This is great stuff, Thomas! Thanks for the tutorial! While v2 is certainly the future of BT, there are LOTS of people who will use v1.5 for a long time, and lots of apps already created with v1.5 that could potentially use this feature in the future. Thanks for sharing! Mark
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
06/18/12 08:28 AM (13 years ago)
awesome Thomas! I still haven't done this with 1.5 as i'm moving along with custom plug-ins in BT 2.0. no need to reverse course for myself and use 1.5. just curious what kind of control over the plug-in you still maintain in in the Control Panel when you do this? This is really the big hurdle IMO on making custom plug-ins that the average BT user (say one who wants new screens but doesn't want to manually edit .h and .m files) can easily download, use and modify in theri own app. Connection to the Control Panel. I understand what needs to be done to pull those fields into a CP screen on the 2.0 Server so you could modify the values - but i'm not looking into this area of creating JSON Data Points to make that happen. I'm comfortable editing code now. It's great to have custom plug-ins screens/code- but IMO it's just not flexible like the rest of BT code UNTIL it's connected to that Control Panel somehow....
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
06/18/12 08:35 AM (13 years ago)
Yup there are many reasons to use both really, some people are just fine with what 1.5 offers, and don't need more then that! David buzztouchmods.com
 
ThomasB
Lost but trying
Profile
Posts: 162
Reg: Jun 23, 2011
Palo Alto
3,270
like
06/18/12 09:12 AM (13 years ago)
I'm afraid we have a miscommunication here. Sorry I wasn't more clear guys. My work here has nothing whatsoever to do with "plug-ins" as you define them in 2.0. The term "plug in" is used in 2 very different ways in BT. 2 completely different functions. A CUSTOM PLUG IN is a type of screen which allows you to insert your own custom source code into the app. This was a screen type that was created for 1.5 which I believe (and hope) David will migrate for 2.0. It's a super-useful screen type. If and when he migrates this, I hope he chooses a new name so we don't have the confusion we are witnessing now! A SELF HOSTING PLUG IN is a module that you build to create new screens in 2.0. Again, these are 2 completely different concepts that just happen to share the term "plug in," thus the confusion. And, the CUSTOM PLUG IN concept should absolutely be ported to 2.0 because it is an extraordinarily powerful and simple way to add new Objective-C features into your Buzztouch products. if (when) it is ported, you could call it "CUSTOM CODE"
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/18/12 09:30 AM (13 years ago)
Yes, the BTv1.5 (iOS) custom plugin screen is a powerful screen, and not to be confused with a BTv2.0 plugin. I've proposed said plugin for BTv2.0 in a previous thread. 100% agree "Plugin" should not be part of the name, only leads to contusion. I suggested Custom Screen plugin David@Buzztouch suggested Custom View plugin View vs. Screen Either way your work on understanding how to use the BTv1.5 custom plugin screen is appreciated. Fred
 
ThomasB
Lost but trying
Profile
Posts: 162
Reg: Jun 23, 2011
Palo Alto
3,270
like
06/18/12 09:31 AM (13 years ago)
@Atrain53 Thanks for feedback...yeah, the "Custom Plugin" in 1.5 isn't very configurable with the control panel. I don't think there is much you could do with the control panel in this case. By it's very nature, this screen is kind of *intended* to be just a stub that gives us an easy way to insert custom code into our apps. For that purpose, it works perfectly. Maybe it's a feature that is only usable by a small subset of developers who want to go into the code. I'm just barely able to do that myself...but fortunately the instructions David provided were super simple. But, I still think it's a really powerful and crucial BT feature BECAUSE: 1. It allows you to add literally any feature to a BT app. Why is this important? Because then, as a developer I can use BT for 80% of what I want, and yet add Objective-C/Java code to be the other 20%. That converts a standard BT app into a totally custom experience. 2. This allows BT to serve as a platform for doing corporate, enterprise, and other larger-scale app building. BT becomes equivalent to a Mobile Enterprise App Platform (MEAP) like Appcelerator or Kony. 3. Prior to using this feature I have been adding highly customized features via JQuery screens. Now I also have a similar ability to add customized features via pure Objective-C and Java, which tap directly into device control objects. For example, I can now turn on/off the LED on the camera, from Buzztouch. OK, maybe that's silly, but it makes me very happy :) So what do you think? Would somebody be willing to download my little "mycoolapp.h/.m" file and insert it into their residual 1.5 apps and see if it works? --- Maybe we could use this feature in 2.0 also? David, does the 2.0 menuing system still recognize this type of screen, if I grafted it into my 2.0 BT_config.txt file?
 
ThomasB
Lost but trying
Profile
Posts: 162
Reg: Jun 23, 2011
Palo Alto
3,270
like
06/18/12 09:33 AM (13 years ago)
@Fred Actually I like both Custom Screen and Custom View! :) :) Just as long as I can enjoy playing with it.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
06/18/12 09:49 AM (13 years ago)
does the 2.0 menuing system still recognize this type of screen, if I grafted it into my 2.0 BT_config.txt file? Yes, When (not if) we have the custom screen/view plugin it'll be simpler. My workaround is explained in my article, "Adding plugin files directly to the Source Code". Concept is simple: Create files (.m & .h for iOS) (.Java & .XML for Android) or modify existing files or borrow from existing plugin that's not installed on control panel Add JSON data to Config file. But, I still think it's a really powerful and crucial BT feature BECAUSE: 1. It allows you to add literally any feature to a BT app. Why is this important? Because then, as a developer I can use BT for 80% of what I want, and yet add Objective-C/Java code to be the other 20%. That converts a standard BT app into a totally custom experience. 100% agree 2. This allows BT to serve as a platform for doing corporate, enterprise, and other larger-scale app building. BT becomes equivalent to a Mobile Enterprise App Platform (MEAP) like Appcelerator or Kony. 100% agree and slowly this point will become better known 3. Prior to using this feature I have been adding highly customized features via JQuery screens. Now I also have a similar ability to add customized features via pure Objective-C and Java, which tap directly into device control objects. For example, I can now turn on/off the LED on the camera, from Buzztouch. OK, maybe that's silly, but it makes me very happy :) Agree, but I think jQuery Mobile is more easily explained and understood. I'm sure many would like to see your LED code. Fred
 

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.