Viewing .gfx file in iOS - iphone

Resonantly I had to work with .gfx file, but i haven't got much information about gfx file.
My question is:
What is a .gfx file formated file contains?
is that any kind of image file or video file.
Where can i get a .gfx sample file to test?
is there any framework that support .gfx in iOS SDK?

1)
According to Google, GFX is used as an extension for at least five different kinds of files. My first guess is that you're thinking of a 3D model/scene format, which might be used in some kinds of games.
2)
That last web page I referred to lists a sample .gfx file.
3)
And this answer depends on exactly which kind of file, out of the five different types of files listed on the eHow page, is the kind of file you want to work with.

Related

What Files can iOS Apps use?

The situation: We would like to make an app that shows all files on an iOS Device
The system: iOS App, non jailbroken system
The question:
What files (and filetypes) are allowed to be accessed by every app (system-wide) ?
(PS: we won't do file-browser like actions like sub-folders, delete, etc .. )
UPDATE :
what you are trying to achieve is not possible because of the sandbox feature of the apps. though you can display certain file types using below description.
Previously Answered this
If I understand your question correctly, there is already a framework for what you are trying to achieve. It is called the quick look framework and supports these many file types...
A Quick Look preview controller can display previews for the following items:
iWork documents
Microsoft Office documents (Office ‘97 and newer)
Rich Text Format (RTF) documents
PDF files
Images
Text files whose uniform type identifier (UTI) conforms to the public.text type (see Uniform Type Identifiers Reference)
Comma-separated value (csv) files
you can have more info about it here...
You can't access anything other than your application folder. Your application is sandboxed and for good reasons (privacy, malware, etc...)
You can only access files within your application directory. Look here for a full explanation
If you don't mean files and just the content of the phone, there are APIs for
Photos
Contacts
Media from the Music app

Xcode Project Size problem- 72 text files

I am new to iphone sdk and creating my first application so please be nice when answering my questions.
I have following questions
Q-1. I have created a simple iphone application (not a game app, no OPenGL). My program is running fine but total xcode project size is 9 mb. I found that my xcode project size is less than 2 mb without "class" and "build" folder.
Do we upload files of "build" and "class" folder when we submit our application?
I have checked that most of iphone applications are less than 2 mb in size so I think build folder is just for me to test the application.
Can someone give me the list of all files or folders (just extension) that we need to upload in order to submit an iphone application.
Q-2. there are around 72 text files (each is 2 KB in size) in my program. Program open a text file according the selected criteria. I have all 72 text files in resource folder. I am not using SQLite as I think it is not too much data and text files are small in size.
Can apple reject my application just because there 72 text files? Is it a common approach to use multiple text files instead of SQLite?
Q-3. Do I need to add zip and unzip my text files instead of opening them directly?
Q-4. some of my text files has following five words
"sex" "sexy" "kinky" "filthy" "dirty"
For example "You are so kinky" , "I love sex" etc.
Do I need to remove these words from my files? Will they be considered vulgar? Will my application be rejected because of these five words?
I have seen some iphone applications on apple's website which shows sex positions and use words like sex,sexy,kinky so I think it should not be a problem.
Do I need to add something like "mature content. Must be 18 years old" just because I am using these five words. I think these are pretty common words that are frequently used by young people.
Many of these questions can be answered more completely by Apple's help docs in the iOS developer center and iOS Provisioning Portal (https://developer.apple.com/devcenter/ios/index.action and https://developer.apple.com/ios/manage/distribution/index.action - you need to be logged in to view these links)
However, here are some quick answers:
1) The build and classes folder hold files during development. The build folder holds the binaries that are created every time you click 'Build' in Xcode, if you build for different targets, there will be multiple copies of your binary in this folder. It also contains various debugging and symbol files used by Xcode.
The classes folder contains all of the implementation (.m) and header files (.h) that you have in your project. This folder corresponds to the 'Classes' group in the file organizer when you open your project in Xcode.
When you submit an application to Apple, all you submit is the compiled binary (found in the appropriate folder in your 'build' folder). It is normal for your project folder to be many times bigger than the final binary you submit. For more info on the submission process, refer to the second link I posted above.
2) If you're persisting a lot of data, I would recommend using the built in SQLite database. It's very easy to use (Google will help you with this), and quite fast. Apple probably won't reject your app for storing a lot of data in flat text files, but you have no reason to. SQLite databases are much cleaner and easier to maintain than 72 flat files.
3) No. But you should still use SQLite, especially if you're saving enough data to these text files that they need to be compressed. Reading and parsing large text files can be much slower and more cumbersome than reading the same data from a database (databases are made to handle data storage like this).
4) Again, Apple probably won't reject you for this (of course, nobody actually knows why they reject apps, so it's always a bit of a crap shoot). When you submit your app, you can choose the rating level for it (sort of like game ratings, or movie ratings) so when people download it they are aware of the level of maturity of the content. One of the ratings is 17+, which you can use if you need. I believe Apple has a document outlining it's rating system in one of the links I posted above (or it's somewhere, it does exist).
First of all you don't need to upload build folder to upload but classes will be uploaded. you have to follow a process for uploading.
No problem at all you can upload even 1000 files, 72 is very small amount. but be careful that if you project is very heavy then it app will be crashed.
No need to zip the files.
you may use all of these words you may even use pornographic contents but they should not be copy righted of any body else. You don't need to remove them, when you will be uploading your application there will be an option "Application include adult contents" you just have to check that option.

The best resources file type for iPhone

In my iPhone project, there are a lot of files including: image files, audio files, and text files.
Now the issue is finding the best file type to manage these files. The image files are related with the audio files and the text files.
I need a file that show the relationship of these files.I am currently using txt type, but it seems chaotic. I want to use xls file type but I can't parse the file correctly.
Can anyone help me? Thanks.
Try using a PLIST. They are easy to read (NSDictionary and NSArray can be created from them) and allow associations to be stored. Also, XCode provides native editing support.

High level process of extracting images from a container

Right, this is the problem I have a container (rar,zip) which contains images png's tiffs bmps or jpegs in an order.
The file extension isnt zip or rar though but uses the same compression.
I want to pull out a list of images contained within the file in the numerical order, then depending on the user decision go to the image selected.
I'm not after any code just the high level thought process/logic of how this can be achieved and how it could be achieved on iphone OS.
From what i know of iphone OS it uses a kind of sandbox environment so how would this effect the process as well.
Thanks
You can include the libz framework in your project and write some C to manage zipped data. Or you can use Objective-C wrapper classes others have written.
Your application resides in its own sandbox. You can include zip files in the "bundle", i.e. add them to your project, and copy them to the application's Documents folder to work with them. Or you can copy archived data over the network to the application's Documents folder if you don't want to include files in your project.
I don't think the extension matters so much as the data being in the format you expect it to be.
Everything I wrote above is for zip-ped files. If you're working with rar-formatted archives, you'll need to look at making a static library for the iPhone, perhaps from the UnRAR source code.

Own data format for the iPhone

I would like to create my own data format for an iPhone app. The files should be similar structured as e.g. Apple's iWork files (.pages). That means, I have a folder with some files in it:
The file 'Juicy.fruit' contains:
Fruits
---> Apple.xml
---> Banana.xml
---> Pear.xml
---> PreviewPicture.png
This folder "Fruits" should be packed in a handy file 'Juicy.fruit'. Compression isn't necessary. How could I achieve this? I've discovered some open source ZIP-libraries. However, I would like to to build my own data format with the iPhones built-in libs (if possible).
Best regards,
Stefan
Okay, so there are three ways I am reading your question, here's my best guess on each one:
You want your .fruit files to be associated with your app via Safari/SMS/some network connection (aka when someone wants to download files made for your app or made by your app).
In this case, you can register a protocol for your app, as discussed here:
iPhone file extension app association
You want the iPhone to globally associate .fruit files with your app, in which case you want to look into Uniform Type Identifiers. Basically, you set up this association in your installer's info.plst file.
You want to know how you can go from having a folder with files in it to that folder being a single file (package) with your .fruit extension.
If that's the case, there are many options out there and I don't see a purpose in rolling your own. Both Microsoft and Adobe simply use a standard zip compression method and use their own extension (instead of .zip). If you drop any office 2007 document, such as docx or Adobe's experimental .pdfxml file into an archive utility (I like 7z, but any descent one will do), you will get a folder with several xml files, just like you're describing for your situation. (This is also how Java's jar file type works, fyi). So unless you have a great reason to avoid standard compression methods (I vote gzip), I would follow the industry lead on this one.
I can definitly appreciate the urge to go DIY at every level possible, but you're basically asking (if it's #3) how you can create your own packaging algorithm, and after reading how some of the most basic compression methods work, I would leave that one alone. Plus I really doubt that Apple has built in libraries for doing something that most people will just use standard methods for.
One last note:
If you are really gunning to do it from scratch (still suggest not), since your files are all XML, you could just create a new XML file that will act as a wrapper of sorts, and have each file go into that wrapper file. But this would be really redundant when it came time to unwrap, as it would have to load the whole file every time. But it would be something like:
Juicy.fruit --
<fruit-wrapper>
<fruit>
<apple>
... content from apple.xml
</apple>
</fruit>
<fruit>
<banana>
... content from banana.xml
</banana>
</fruit>
<fruit>
<pear>
... content from pear.xml
</pear>
</fruit>
<picture>
...URL-encoded binary of preview picture
</picture>
</fruit-wrapper>
But with this idea, you either have to choose to unpack it, and thus risk losing track of the files, overwriting some but not all, etc etc, or you always treat it like one big file, in which case, unlike with archives, you have to load all of the data each time to pull anything out, instead of just pulling the file you want from the archive.
But it could work, if you're determined.
Also, if you are interested, there is a transfer protocol intended specifically for XML over mobile called WBXML (Wap Binary XML). Not sure if it is still taken seriously, but if there is an iPhone library for it, you should research it.