iphone - Extracting ZIP files in iPhone App - iphone

I am aware of some third party libraries and open source libraries to extract ZIP files within iPhone application.
But I would like to know whether there are any default iPhone frameworks provided in SDK itself?

None that I know of. I have been using Objective-Zip and it seems pretty good for my needs. But I am deflating not inflating.

Related

How can i access iPhone files via Objective-c?

I noticed that there is software (such as iExplorer) that allows you to access files on an iPhone-device from your Mac.
Now my question is: How can I access iPhone files via Objective-c?
This is only for educational purposes.
I found this: https://github.com/Chronic-Dev/libirecovery but I'm not sure if I'm on the right track.
So it seems that you're looking for an API which makes it possible to access the filesystem of the iPhone from a computer. Well, this API exists, and it's called the MobileDevice framework.
Unfortunately, there's no easy or legal way to access files on your iPhone, especially through Objective-C.
The applications installed on iOS are sandboxed, which means they can only access files in their own directory tree; they have no access/knowledge of other files.
Like you said, you can access files using software like iExplorer, but not programmatically from the iPhone itself.
Here is an old project to browse the iphone. You may be able to get some pointers from it on building an application to do the same with the latest info.
http://code.google.com/p/iphonelist/
Couple that with carbonic acid's post about the Mobile Device Framework and you should be able to do some good stuff.
if I find more unique info ill post it here.

iPhone .ipa and file extraction

I am writing an app for the iphone platform. My code is mostly C++ with some Objective-C code to interface with ios sdk apis. I am not very versed on iphone programming and this is my first app, so problem is that i need to read a binary file, using C++ code, containing some data but i don't kown how to do it. My concern is: can i use directly fopen/fread? Which path should i use? I come from Android development. The .apk is a simple .zip archive, so one just need to extract in memory the needed file and process it, or extract the file in a temporary directory and read it in the usual way, but i do not know how to to the same in the case of an iPhone application. Thanks.
I believe the core question you're asking has already been asked and answered. You want to read and write files, but aren't confident about how/where to do so: Write a file on iOS

iPhone : what the best way to integrated iPhone application to other application?

I want to reuse iPhone source code application with other application, so in Xcode iPhone does it be able build library .jar file?
You cannot reuse a whole application, but you can create a static library and have other apps link to it.
".jar" is a Java archive format, so no. iPhones don't come with a jvm. You can build libraries though.
The best way to recycle your code from one application to the next is to try to write in the most general or abstract way you can, i.e. in such a way as to minimize the dependence on any given project.

PhoneGap: download & save binary files (mp3s) for iPhone & Android

Is there a way in PhoneGap to download & save a binary file (I'm specifically interested in mp3s) that works across both iPhone and Android?
A web search reveals a plugin for Android:
http://www.toforge.com/2011/02/phonegap-android-plugin-for-download-files-from-url-on-sd-card/
And some code for iPhone:
http://blog.clearlyinnovative.com/post/1097750723/phonegap-plugin-for-downloading-url
But nothing that covers both.
PhoneGap has evolved & added this functionality.
I would suggest that you write some lines of javascript code to hide them both behind the same interface (you will have to provide different storage locations anyway)
Their interfaces look pretty similar already

Can I develop my own objective-C Framework for Cocoa Touch Applications?

Is it possible to create an own obj-C Cocoa Touch framework which can be used by other developers? And furthermore can you protect this framework?
I've created templates for Xcode 4 that allow you to build universal iOS frameworks (which work in both device and simulator).
Once the templates are installed, you simply select "Static iOS Framework" when creating a new project and it does the rest. It also works with unit tests.
https://github.com/kstenerud/iOS-Universal-Framework
You can create a static library. There is an option in the XCode project chooser to do this. You'll have to distribute the compiled static library file and the header files to users of your library. Your actual implementation files (.m) do not need to be distributed.
GHUnit does a good job of this - packaging up the libraries for both simulator and device - so I recommend looking at this project. (I also recommend using this library for unit testing :-)
The frameworks in Objective C are typically just C / ObjC code and a bunch of classes, nothing amazingly special. As such, you can create your own if you'd like, and then just include that in your project when you build it. The iPhone doesn't care about the difference, it just knows to put all that code into your app, along with everything else.
Have a look at the Framework Programming Guide on Apple's website. It will get you started. Essentially what you'll do is create a Framework project in XCode and then go from there.
As for "protecting" your framework, I assume you mean making your code unreadable. I'm not sure if and how you can do this, but perhaps Apple's guide will say something about it.
Yes you can create frameworks for use with Cocoa Touch.
However there are these caveats:
has to be a statically linked libary, no dynamic loading (dyld) for us
should be a combined (lipo) library for i386 (simulator), arm6 and arm7
you need to hack a bundle project into a framework
you should embed (small and few) images into the library so that the developer does not have to mess around with resources but just drags/drops it into his project
... or if you have large and many images build a bundle with these
I have guides for these things on my site.
1+2 = http://www.drobnik.com/touch/2010/04/universal-static-libraries/
The other links you have to google because this site does not let me post more than one URL.
You could make a static library available as binary (i.e. rudimentary "protection") to third parties, but not a dynamic one, as Apple's App Store policy prevents dynamic linking.
Take a look at a worked example for static libraries given at
this site
If you're going to do it, in my opinion JSON.framework is a great example to follow. To hide/obfuscate the source code is a different story, and a different question entirely,
When creating a new project, navigate to iOS > Framework & Library > Cocoa Touch Framework, it's as simple as that. When you are successfully compile, .framework will be created under Products folder in XCode. Right click to show in Finder, and you can find the output.
It's unlikely this will work the way you want it to because the other developers won't be able to use your framework. This StackOverflow Question explains why.