Discussion Forums  >  Uncategorized

Replies: 5    Views: 173

Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
02/03/12 11:59 AM (14 years ago)

Embed an BTv1.4 app into an BTv1.5 and/or BTv2.0 app

I coming to believe it's possible to embed an BTv1.4 app into either a BTv1.5 app or a BTv2.0 app. My understanding is that BTv1.4 is similar to PhoneGap only that it's wapping a webapp into a native app. That's why you need internet connectivity for a BTv1.4 app to function. With some help in understanding the interworking of BTv1.4, I think we could accomplish this. Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/03/12 11:59 AM (14 years ago)
Post here or email me. Fred
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/03/12 12:32 PM (14 years ago)
v1.4 is not a wrapper in all cases. It is in cases where it's using only html files as content but lots and lots of the screens added in v1.4 apps run native code. The design of 1.4 was not ideal in that is forced the app to constantly contact the server on a screen-by-screen basis which wasn't good. This is the biggest difference between v1.4 and v1.5 - is not the actual screens and how they work but instead where the data comes from. Embedding one app into another app is something I've experimented with and done on many occasions. In fact, it's the core concept behind many situations where you need dozens (or hundreds) of individual app 'instances' inside one parent app. Consider this: If an insurance company (pick your favorite national brand) needs one 'parent app' in the market, but also needs to allow individual agents to manage their instances of their own 'mini apps' inside the parent, it makes sense that they could it do it using the control panel. Agent's create apps that are auto-magically included in the parent. Super common. Apple generally hates this approach but has approved many of these types of apps. If done professionally, it can be very VERY successful, fun, and flexible when helping folks solve larger corporate type problem that surface when they try to figure out their brands app strategy. How it works depends on lots of factors. It's basically like this: a) Create an app to act as the parent. Make this app like you would expect. Corporate info, features appropriate for the corporate identity, etc. b) Create a tab in this app that loads a list of 'child apps' for each agent. This could be a list, buttons, search logic, whatever. This screen just displays the appropriate agent instances. Using the insurance analogy here. c) Tapping a agents icon, name, whatever, loads another UIViewController that is configured to download the data for the agent's app then displays menus, features, content the agent created. Hope this helps.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/03/12 12:49 PM (14 years ago)
Your insurance example is one that I would love to be able to do. But I was thinking the ability to reference / launch a BTv1.4 app in particular would be ''doable''.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/03/12 01:12 PM (14 years ago)
Yes, you can use this logic to launch existing apps. The trick, and the challenge, will be getting the parent app setup to 'understand' what the heck a v1.4 app is! LOL. In v1.4, the app delegate launches an instance (instantiates) of an AppViewController object. This object is instantiated by calling it's initWithApplication method. In other words, create an AppViewCotroller and show the app object I pass in when I call the initWithApplication method. In a v1.4 app you can see this logic on about line 173 in the app delegate. So, app delegate in turn launches a AppViewController. In AppViewController, you'll see where it sets up the home screen menu and other application options. Tapping an item on the home screen loads an additional screen. So far so good, nothing too complicated. All this means is that you'll need to build a menu or button (or list of buttons) that launches a v1.4 app when tapped. The best way to do this will be to start with a v1.4 app, not a v1.5 app. This is because the v1.4 app code will be in place to handle all the other mini sub-apps that are also v1.4 apps. Get confusing I know. a) Build a v1.4 app b) Add a menu item that reads 'Show Apps' or something. c) Look at the AppViewController file and intercept the tap when this 'show apps' item is tapped. d) Instead of loading a built in screen type (v1.4 built in screen type) when this item is tapped, load your own custom view controller that lists all the apps you want to show. hard to know how you want to manage this list of apps? Probably just manually type them in? The idea is that your code will need to know the app ID of the one selected. It will then instantiate an instance of an App that will then get passed to the initWithApplication method in the AppViewController. Push this view controller on the stack and you're good to go. For most folks, the trouble comes in when they don't understand how to instantiate instances of Objects, such as the Application.h / .m object. Because they don't understand the core concepts behind Objective C, but have a wonderful idea instead, they can't quite get this to work. I wish I could explain it better but can only say that you can do this but will need to get comfy with how to instantiate the Application.m object found in v1.4 and the AppViewController in v1.4 then push that view controller on the screen.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/03/12 01:19 PM (14 years ago)
Too much info for now, will read again tonight when I'm good and drunk, I think that might help. Thanks, 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.