Business Sample App Discussion

Thread to discuss the Corona Business Sample App

We’ve uploaded our newest Corona-built business sample app on GitHub here: https://github.com/coronalabs/business-app-sample

The app demonstrates several principles related to business apps including tabBar controllers, tableViews, buttons, networking, RSS feeds, webViews and mapViews. For more information, please reference this Corona blog piece: http://coronalabs.com/blog/2013/10/09/a-look-inside-a-sample-corona-powered-business-app/.

Hello Inna,

Great stuff! Just a quick note to let you know that the first link above is broken (404)

Thanks for the example app.

Mo

Is it ios7 only?  For which build?

Because on simulator (windows) I get:

Windows simulator build date: Aug 28 2013 @ 17:45:55 Copyright (C) 2009-2013 C o r o n a L a b s I n c . Version: 2.0.0 Build: 2013.1202 Runtime error module 'widget\_theme\_ios7' not found:resource (widget\_theme\_ios7.lu) does not ex ist in archive no field package.preload['widget\_theme\_ios7'] no file 'X:\Users\xxx\AppData\Roaming\Corona Labs\Corona Simulator\Plu gins\widget\_theme\_ios7.lua

Link has been corrected.

As for my error I suggest:

in main.lua there should be (change in line 95)

if system.getInfo("platformName") == "Android" or system.getInfo("environment") == "simulator" then myApp.theme = "widget\_theme\_android" myApp.font = "Droid Sans" myApp.fontBold = "Droid Sans Bold" myApp.fontItalic = "Droid Sans" myApp.fontBoldItalic = "Droid Sans Bold" myApp.topBarBg = "images/topBarBg7.png" else myApp.theme = "widget\_theme\_ios7" myApp.font = "HelveticaNeue-Light" myApp.fontBold = "HelveticaNeue" myApp.fontItalic = "HelveticaNeue-LightItalic" myApp.fontBoldItalic = "Helvetica-BoldItalic" end widget.setTheme(myApp.theme)

and in menu.lua line line 46 should be commented out

--if not myApp.legacy then -- widget.setTheme(myApp.theme) --end --widget.setTheme("widget\_theme\_ios7")

We will look into this.  Actually we can probably drop the theme code out completely now since the widgets now auto-select.  I’ll see what we can do. 

I should point out, there are also some features like custom map markers that require daily build 1227 to work in which case the ios7 theme will be included.

AirPrint support is highly desirable. I would used Corona back in 2010 for business apps if it had that feature, and is the main reason why I still can’t use Corona today.

Easily sync-able databases would be a great too. Something like the Dropbox DatastoreAPI. Although this is less important as workarounds are possible.

ocq - can you add/vote on these features here?

feedback.coronalabs.com

Thanks for the feedback.

For what it’s worth - you can do these things today with Corona Enterprise. But I do agree it would be a bit easier if they were in Corona SDK.

Voted.

I think AirPrint should be in regular version, purely on the grounds the Objective C is only about 50 lines! Admittedly the code would be longer with added fanciness and options, but still, it’s such a quick win. That’s why I’m a bit bemused after all these years when I see features get completely re-written to get to ‘2.0’, whilst poor old Mr Printy doesn’t get any attention.

Thanks for voting it up. I agree, there are things that seem like easy wins, but it gets a bit hard when there are a bunch of things in the pipeline :) 

Actually in main.lua at line 104, the following code should take care of the issues:

&nbsp;&nbsp;&nbsp; myApp.theme = "widget\_theme\_ios7" &nbsp;&nbsp;&nbsp; local coronaBuild = system.getInfo("build") &nbsp;&nbsp;&nbsp; if tonumber(coronaBuild:sub(6,12)) \< 1206 then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myApp.theme = "widget\_theme\_ios" &nbsp;&nbsp;&nbsp; end

The widget iOS 7 theme went into play at build 1206.  The Theme files don’t take care of everything needed to make an app look iOS 7 vs. iOS 6.  For instance, the top bar in iOS 6 is a gradient, in iOS 7, it’s flat.   In Corona those are typically done using images or other display objects and they are not part of the theme.   The same goes with the tabBar controller.  The iOS7 tab bar doesn’t change the color of the tab, only the color of the tab icon.  For our widget, there is a 3 graphic (left, center and right) image needed to provide the overall pressed look for iOS 6.  With iOS7 you have to provide three transparent/empty images as well as provide thinner styled icons.

The buttons in the top bar for iOS 6 typically required a graphic for Corona apps to emulate the native buttons, but that style changes with iOS7 and you would in code have to program handling both styles.  Because this is a sample app and not a production app, it was more practical to make it iOS 7 look and feel.   But since the public build doesn’t support the iOS7 field, this code work around will take care of this.  The only real visual impact seems to be chrome around the buttons on the menu tab.

Speaking of the menu tab, I recommend changing this:

--if not myApp.legacy then --&nbsp;&nbsp;&nbsp; widget.setTheme(myApp.theme) --end widget.setTheme("widget\_theme\_ios7")

at line 43 to simply:

widget.setTheme(myApp.theme)

so it matches the other modules in the sample app.  Hopefully these changes will be reflected in the github repository soon.

DOesn’t seem to work with the latest free version.    Will the free version ever support IO7 widgets?   I am a sole independent dev and cannot afford the pro version.

@dweezil

Use corrections I mentioned above and it will work for sure :slight_smile:

Awesome stuff!  This ‘feed’ is new to me.  So if you press the Corona Blog button it takes you to “http://www.coronalabs.com/feed/” why is feed on the end?   and it downloads the feedURL  to a feedFile ( feedName = “corona.rss”)where it is stored?

Also how can you tell if its an Atom feed?

Does this app works only for Pro Developers?

I believe they said this update was only available in the Pro and Enterprise version. I am about to download it now! I do a lot of business apps and can see some advantages of these updates. And yes, printing would be great!!

Warren

Would be nice if you supported text field with correct z order etc. as it stands I can’t use corona for business apps because of that.

G

@gslender
As CoronLabs stated it’s not possible becausr of android and ios restriction as for opengl apps on which corona bases

Quick note to someone at Corona. In the public build currently (perhaps current build as well) there is a bug that can hurts business apps. Native text boxes appear blank until scrolled if they have too many lines of text when brought on screen in a new scene. The text is there, just not showing, you can highlight and copy it but it just looks like a white area until you scroll it if its over ~15 lines, try 30 and see yourself. This is on an iPhone 4s (works perfect on emulator).