iPhone Development

Today, Corona Labs announced that Corona Plugins — code named “Project Gluon” — are live and available to Corona SDK Pro subscribers using Daily Build #1115 and above. One of the new plugins handles the compression and un-com...
Today, Corona Labs announced that Corona Plugins — code named “Project Gluon” — are live and available to Corona SDK Pro subscribers using Daily Build #1115 and above. One of the new plugins handles the compression and un-compression of files using the popular zip algorithm. For anybody who’s unfamiliar with zip files, the most common usage is when you need to group several related files into a “package” so it’s easier to move them around and share them with others. For example, if you contract a set of artwork from a designer, he/she can compress them into a zip archive and send them via email, Dropbox, etc. All of the artwork will be contained in that one file with the .zip extension, and when you open it locally, the file will “unzip” and all of the files will be available to you, exactly as the designer intended. Another use of zip files is to compress one large file into a smaller overall .zip file. The format and type of the original file will dictate the amount of compression achieved, but in virtually every instance, you’ll save valuable storage space. Why is this important to mobile app developers? For one, you gain the ability to expand your app’s contents. You can create a zip file containing expansion art and sounds, download it into your app, unzip it, and use those assets. Secondly, you can now produce zip files which you can upload to web servers for distribution. In today’s tutorial, let’s examine how to download a zip file from a web server, unzip the contents, and show a list of the files within. Using Corona Plugins Corona Plugins are “managed” from the build.settings file in your core project directory. This makes it easy to add just the specific plugins you need for an app, ultimately resulting in a lighter compiled binary. To use a plugin, simply add the plugins table within settings and configure the zip plugin within: settings = { orientation = { default = "portrait", supported = { "portrait", "portraitUpsideDown" }, }, plugins = { ["plugin.zip"] = { publisherId = "com.coronalabs", }, }, } Next, in your main project code, you must require the plugin, similar to how you’d require a core Corona library or external Lua module. local zip = require( "plugin.zip" ) That’s it! Now you’re ready to use the zip plugin. Note that when you run a project in the Corona Simulator that requires a plugin, you’ll be prompted to download the plugin; this only happens once, when you first use the plugin. Implementing .zip in Code Like many API calls in Corona, a callback function is required so that you can determine when the process is complete and then take the appropriate action. local function zipListener( event ) if ( event.isError ) then print( "Unzip error" ) else print( "event.name:" .. event.name ) print( "event.type:" .. event.type ) if ( event.response and type(event.response) == "table" ) then for i = 1, #event.response do print( event.response[i] ) end end end end Now, let’s use use the network.download API call to retrieve the zip file from a remote server and, in its callback listener, initiate the unzip process. The callback function will list all files that are successfully uncompressed. local function networkListener( event ) if ( event.isError ) then print( "Network error - download failed" ) elseif ( event.phase == "began" ) then print( "Progress Phase: began" ) elseif ( event.phase == "ended" ) then if ( math.floor(event.status/100) > 3 ) then print( "Network error - download failed", event.status ) --NOTE: 404 errors (file not found) is actually a successful return, --though you did not get a file, so trap for that else local options = {
about 11 hours ago
@espresso 100% agree. Sasha Frere-Jones' take on the album for The New Yorker is a good read about the oddity of it.
@espresso 100% agree. Sasha Frere-Jones' take on the album for The New Yorker is a good read about the oddity of it.
about 15 hours ago
Today, I’m happy to announce our first batch of Corona Plugin partners: Sponsorpay Tap for Tap inneractive Green Throttle Carrot It’s great partners like these that enable Corona developers to access the best new functional...
Today, I’m happy to announce our first batch of Corona Plugin partners: Sponsorpay Tap for Tap inneractive Green Throttle Carrot It’s great partners like these that enable Corona developers to access the best new functionality and 3rd party services. In particular, today’s batch span a wide variety of services from app advertising to cross-promotion and value-exchange ads, from social campaigns to game controllers. You can see more information at the Corona Plugin Directory. You’ll notice a “Docs” link below each partner that’s got all the technical docs you’ll need to use the plugin in your app. In the coming days, you will see more info from these partners about their services and why you should use them. Just keep in mind that, for now, you need access to daily builds to use these plugins. This is just the first wave. We have more partners coming in the next few weeks, adding to the growing list of additional features and services you’ll want to use in your apps. As you can see, Corona plugins are going to play an increasingly important role in your apps. Corona core gets lighter Another things that is happening this week is that the core Corona engine is about to get lighter. Last week, I talked about our plans to move certain services into plugins that currently reside in the core Corona engine. That move is happening this week. In tomorrow’s daily build (after 1115), the following services will be moved into plugins: iAds: iOS InMobi: iOS + Android Inneractive: Android This will make the core even smaller than it already is. We’ll also be rolling out a new “Plugins” section in our daily build docs where you can get details on the ‘build.settings’ changes needed to use those plugins in your device builds. Again, this will start in tomorrow’s daily builds. Plugins for Enterprise Two final notes for Corona Enterprise users. First, we plan to make plugin binaries available to you soon. These plugins will probably be available as a separate download. That’s because plugins will generally be the same across daily builds. Second, if you are using Corona Enterprise and you require InMobi or inneractive, the corresponding plugin binaries will not be available immediately. So if you use those services, stay on 1115 or earlier for now. These will be available in the separate download I mentioned above. * * * We’re going to have more plugin announcements in the coming weeks, but after Memorial Day, what I’d like to get back to in the weekly updates is more eye candy. With that in mind, if you have a favorite filter effect, let me know! Oh, and if you happen to be in the Big Apple today, we’re exhibiting at AppNation, hosting a panel on app monetization, and also crashing the Corona NYC meetup to share the latest and greatest.
about 16 hours ago
In this tutorial I will explain how local notifications can be performed in iOS application. Here there’s three important steps: 1. Create a new observer to listen for the notification (event) to happen. 2. Post the n...
In this tutorial I will explain how local notifications can be performed in iOS application. Here there’s three important steps: 1. Create a new observer to listen for the notification (event) to happen. 2. Post the notification when our event happens. 3. Remove the observer when we no longer need it. From apple documentation, NSNotification objects encapsulate information so that it can be broadcast to other objects by an NSNotificationCenter object. An NSNotification object (referred to as a notification) contains a name, an object, and an optional dictionary. The name is a tag identifying the notification. The object is any object that the poster of the notification wants to send to observers of that notification (typically, it is the object that posted the notification). The dictionary stores other related objects, if any. NSNotification objects are immutable objects. NSNotificationCenter object (or simply, notification centre) provides a mechanism for broadcasting information within a program. An NSNotificationCenter object is essentially a notification dispatch table. Objects register with a notification centre to receive notifications (NSNotification objects) using the addObserver:selector:name:object: or addObserverForName:object:queue:usingBlock: methods. Each invocation of this method specifies a set of notifications. Therefore, objects may register as observers of different notification sets by calling these methods several times. Each running Cocoa program has a default notification centre. You typically don’t create your own. An NSNotificationCenter object can deliver notifications only within a single program. If you want to post a notification to other processes or receive notifications from other processes, use an instance of NSDistributedNotificationCenter. We can create a notification object with either of the following class methods + (id)notificationWithName:(NSString *)aName object:(id)anObject + (id)notificationWithName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)userInfo Here first method Returns a new notification object with a specified name and object. Name is the new notification name and object is the object for new notification. And the second method returns a notification object with a specified name, object, and user information. The user information dictionary for the new notification. May be nil. However, you don’t usually create your own notifications directly. The NSNotificationCenter methods will take care of that. Following methods explain the basis of observing the notification. - (void)addObserver:(id)notificationObserver selector:(SEL)notificationSelector name:(NSString *)notificationName object:(id)notificationSender - (id)addObserverForName:(NSString *)name object:(id)obj queue:(NSOperationQueue *)queue usingBlock:(void (^)(NSNotification *))block As per the documentation this method adds an entry to the receiver’s dispatch table with an observer, a notification selector and optional criteria: notification name and sender. Second method adds an entry to the receiver’s dispatch table with a notification queue and a block to add to the queue, and optional criteria: notification name and sender. The parameter “block” will be executed when notification is successfully posted. If a given notification triggers more than one observer block, the blocks may all be executed concurrently with respect to one another (but on their given queue or on the current thread).The following example shows how you can register to receive locale change notifications. NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; NSOperationQueue *mainQueue = [NSOperationQueue mainQueue]; [center addObserverForName:NSCurrentLocaleDidChangeNotification object:nil
about 18 hours ago
Featured iPhone Development Resources Some time ago I mentioned the excellent free augmented reality framework from Qualcomm called Vuforia. Here’s an interesting example from Vivien Cormier called the iOS tangible detector for de...
Featured iPhone Development Resources Some time ago I mentioned the excellent free augmented reality framework from Qualcomm called Vuforia. Here’s an interesting example from Vivien Cormier called the iOS tangible detector for detecting objects that are placed on the screen.  The library does this by detecting the distance between three points on the object, and making calculations about the size, and angle of the object based on the location of those points. Here’s a video of the Tangible Detector in action: You can find the iOSTangibleDetector on Github here. A fun little library for detecting objects sitting on the iPad screen. Be the first to comment... Related Posts:Open Source iOS Library For Detecting When A User Is Taking A ScreenshotThe Apple iPad – Is it just a big iPhone?Open Source iOS Component Allowing You To Quickly Create A Customizable More Apps Listing ViewTesting Out iPad Code With An iPhone or iPod TouchOpen Source iOS Library Providing Quick And Easy Encryption Of Any NSCoding Compatible Object Original article: Example: Detecting Tangible Objects On The iPad Screen©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.
about 23 hours ago
This week we hung out with Ed Maurina, Gerald Bailey, Jesse Warden, Matthew Chapman, and Richard Harris to discuss memory management in Corona SDK. Ed did an excellent job of explaining the sample app he created after one of our previous...
This week we hung out with Ed Maurina, Gerald Bailey, Jesse Warden, Matthew Chapman, and Richard Harris to discuss memory management in Corona SDK. Ed did an excellent job of explaining the sample app he created after one of our previous Hangouts where we discussed Storyboard. His app demonstrates how memory is affected when objects are set to nil at various stages of development. Ed agree to post his code on GitHub, so we’ll post a link to his code once that is available. We also talked about the announcements at Google IO, the ongoing Dilbert contest, and COPPA Privacy Policies. Corona Labs T-Shirt Winner Congratulations to Theo Rushin, Jr. for winning this week’s Corona Labs’ t-shirt. For your chance to win, follow Corona Geek on Twitter and Facebook, and complete the Corona Geek giveaway form. Thank you for watching, we’ll see you on next week’s Corona Geek hangout! Remember To Subscribe Download the Corona Geek podcast on iTunes Listen to Corona Geek on Stitcher Subscribe to Corona Geek on YouTube
1 day ago
Featured iPhone Development Resources,iOS UI Controls,iPad,iPhone,Objective-C I’ve mentioned a number of libraries to aid with adding social sharing capabilities within your apps such as ShareKit which allows you to quickly add so...
Featured iPhone Development Resources,iOS UI Controls,iPad,iPhone,Objective-C I’ve mentioned a number of libraries to aid with adding social sharing capabilities within your apps such as ShareKit which allows you to quickly add social sharing within your apps for a wide variety of social networks – and Apple has added this capability for the major social networks. Here’s a slick user interface control from Camden Fullmer that provides a circular menu interface with icons included for Facebook, Twitter, Google Drive, Pinterest, Dropbox, and Evernote sharing. Each selection is activated by dragging the circle in the middle to the selected choice: You can find CFShareCircle on Github here. Keep in mind you’ll need to integrate the sharing for each choice, but an excellent control that can be customized to your needs. Be the first to comment... Related Posts:Open Source: Library For Fully Functional Keynote Style Image SidebarsOpen Source iOS Component For An Editable, Animated iBooks Style Navigation ControlNifty UICollectionView Extension That Adds Drag And Drop Re-OrderingAdd Snazzy Drag & Drop Functionality To Mapkit In iOS 4 – Open SourceOpen Source iOS Control For Easily Creating A Graphical Customizable Scrolling Selector Original article: Great Looking Open Source Drag To Share iOS UI Control©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.
1 day ago
This week’s App of the Week – Tomb Breaker – is a brand new puzzle game that was created with Corona SDK and recently graced with a ‘New and Noteworthy’ recognition on Apple’s App Store. A year in the ...
This week’s App of the Week – Tomb Breaker – is a brand new puzzle game that was created with Corona SDK and recently graced with a ‘New and Noteworthy’ recognition on Apple’s App Store. A year in the making, Tomb Breaker was developed by Kurt Bieg, the designer behind Simple Machine, with art by Victor Soto. It’s a casual puzzle game that’s easy to learn and fun for all ages, thanks to vibrant graphics and intuitive gameplay. In Tomb Breaker, your goal is to clear as many gem tiles as possible by swiping across tiles to make chains. The more tiles you clear in one swipe, the more points you’re awarded. As you collect gems and purchase game powerups, you can also score breaking crossovers, clears, and combos. And, if you’re feeling competitive, you can challenge friends on Game Center or on Facebook, or you can play against your own high score. This catchy puzzle game is available for free on iTunes – give it a play!
1 day ago
Featured iPhone Development Resources Welcome back to the weekly feature of the most popular new resources mentioned on the site in the past week. This weeks most popular resource is a library that allows you to create high quality flat...
Featured iPhone Development Resources Welcome back to the weekly feature of the most popular new resources mentioned on the site in the past week. This weeks most popular resource is a library that allows you to create high quality flat style user interface controls. Here are the 3 most popular resources for the last week: 1. FlatUIKit - Allows you to create flat user interface controls such as buttons, alert views, switches, steppers and nav bars. (share on twitter) (featured here) 2. MMDrawerController -  A drawer type navigation control that supports custom transition animations (sliding, slide and scale, swinging door, and more included) (share on twitter) (featured here) 3. RRCircularMenu - A great looking rotating pie style control with images. (share on twitter) (featured here) Thanks for reading! Be the first to comment... Related Posts:Top iOS Development Resources For Week Ended April 5th, 2013Top iOS Development Resources For Week Ended April 28th, 2013Top iOS Development Resources For Week Ended April 12th, 2013Top iOS Development Resources For Week Ended April 21st, 2013Top iOS Development Resources For Week Ended April 14th, 2013 Original article: Top iOS Development Resources For Week Ended April 19th, 2013©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.
2 days ago
Our long effort to rebuild Cocoa piece by piece continues. For today, reader Nate Heagy has suggested building NSString's stringWithFormat: method.(Read More)
Our long effort to rebuild Cocoa piece by piece continues. For today, reader Nate Heagy has suggested building NSString's stringWithFormat: method.(Read More)
5 days ago