i'm currently wondering how to add more localizations to my PhoneGap App on the App Store. So it is already deployed, and in App Store it shows under Languages, right under the Icon "English, Spanish" but I never changed any configs or so to acheive this. I found in my xCode-project /App_NAME/Resources a en.lproj and es.lproj folder with Localisation.strings.
The standard way I found so far would be to do this.
But for some Reason those folder I create never appear in xCode. What am I doing wrong, and why can't I add more of these ominous XX.lproj-folders?
I'm totally stuck.
I can do javascript localisations for the app itsself but without this app-store languages I can't get my meta-data translated...
Any experience highly appreciated!
the best way is to do it from javascript since you're using PhoneGap.
retrieve the device/userAgent language (or locale, or simply ask the user for a preferred language) and then edit the content accordingly.
If you want to localize app store meta data, your app, or your marketing content there are tools out there now to speed the process such as TraductoPro, which also has built-in human translation ordering services. It even automates or 'macronizes' your code, making the xcode strings localizable. It's a Mac app, simple to use.
I am a little confused on whether to embed swfs or load them when making apps for the iphone. Does anyone know what are the advantages of each (which is preferable to use)? I know that embedding swfs should be a little faster than loading them but is that all?
Also and this is kind of important, I read that Apple will reject any app with external swfs?? Is that indeed correct? If so, will embedding or loading said swfs solve this problem?
Thanks in advance
EDIT: after some searching around, turns that Apple does have problems with loading external swfs, u can still do it, but your swfs need not have any actionscript attached, here is a link http://whizzkid74.blogspot.com/2010/12/air-for-iphone-loading-external-swf.html It doesnt say anything about embedding swfs however, so my question is this: can u embed swfs when writing apps on the iphone??
EDIT To clarify, when i say external SWFs. I mean SWFs that are found on your system locally but you need to add them to your program since they contain MovieClips or Sprites etc... that u need. I didn't mean SWFs that you need to download from a website or an online source. (hope that clarifies things)
EDIT Changed the question's title...Problem solved, thanks for all the help guys and happy new year =D
Update, Oct 2012:
In Adobe AIR 3.5, adl is introducing a feature called "multiple SWF support" that allows the use of Loaders to load SWFs delivered in the .ipa (local files, not from servers) to have code in them. The adl compiler AOT compiles SWFs that are included in the .ipa, allowing them to be loaded and work under iOS.
AIR 3.5 is currently in beta at the time of this writing, available on the adobe labs site:
AIR 3.5 on Adobe labs website
AIR 3.5 release notes
Note that this feature requires -swf-version=18 or greater of the root SWF (not necessarily the assets being loaded) and AIR namespace ending in 3.5 in the application xml file.
Older answer:
I wanted to update this answer because I've learned a lot about this issue since I first looked into it.
The root of the issue is that, when making iOS apps with AIR, Apple TOS disallows runtime interpretation of code - and this includes SWF bytecode. So loading SWFs with code in them (even simple animation commands like stop(), gotoAndPlay(), etc) is disallowed and will not work via a Loader (prior to AIR 3.5).
Note that it's perfectly fine to load SWFs for their vector graphics content. The graphics will display, but the code will not execute.
However, there are a few workarounds for this. Both workarounds avoid a Loader by compiling assets with code in them into the main SWF, because once they're part of the main SWF, the AIR compiler (adt) will cross-compile the code into objective-c, and everything will work fine on iOS devices.
Using SWC libraries
This is the best option for iOS development. If you compile your graphical assets (.fla file) into SWCs (or export SWCs from symbols in your library), then compile your main swf against these SWCs, this goes through the compiler and actionscript code will execute on iOS devices.
Using SWFMerge for [embed]ed SWFs
Embedding assets into SWFs is very easy, and looks like this:
[Embed(source="GameLevel.swf")]
private var GameLevel:Class;
public function main():void
{
var my_level:* = new GameLevel();
addChild(my_level);
}
In this scenario, if gameLevel.swf has code in it, it typically wouldn't work in iOS, because new gameLevel() would create a Loader and interpret SWF bytecode. But, if you first run the above SWF through my tool called SWFMerge, it will take your embedded SWF and merge it into your root SWF. Then ADT will compile your main swf (including embedded code) into objective-C, it will work on iOS, and note: new gameLevel() now results directly in an instance of your asset - NOT a Loader.
The SWFMerge tool is here:
http://www.onetacoshort.com/temp/SWFMerge_alpha.swf
Let me know in the comments if this workaround works for you or if you have trouble.
Using Loaders
Prior to AIR 3.5, if you use a Loader to load a SWF file (whether this swf is included in your IPA or served from a webserver), the target SWF graphics will load just fine, but no code inside the SWF will execute, again because this is disallowed by Apple's TOS.
As of AIR 3.5, packaging SWF files in the .ipa as assets, using a Loader will work even if they contain code as this code is now AOT-compiled by adt. This requires -swf-version=18 or greater of the root SWF (not necessarily the assets) and AIR namespace ending in 3.5 in the application xml file.
However, it is technically possible to interpret SWF bytecode, it's simply an App Store legal restriction not to. If you only want to test on an iOS device and won't be distributing your app via the App Store, you can compile your SWF using adt's -target ipa-test-interpreter option, and Loading SWFs with code in them will work.
I'm not familiar with the rules around Apple and iPhone apps, but generally when I make apps/games, I embed everything. The advantages:
Your game/app is in one swf, making it easy to share
Your game/app loads quicker as all the assets are there at load-time
You're not dependant on internet access to get your assets (if you're loading them from a site) - good for an app
Your game/app will "just work" - no security issues, no problems with urls changing/asset site going down (if they're external)
If you use a swc instead of an swf (an swc can also be loaded btw), then you can also benefit from strict-typing
The disadvantages:
If you need to update one of your assets, you need to republish the game/app
The answer is yes, you can embed SWFs, but that is not the only way. You can also use normal Loader methods, with everything relative to the main SWF:
var myLoader:Loader = new Loader();
// iOS apps act as if the main SWF is in a folder
// and the other SWFs are in the same (or sub) folders.
var url:URLRequest = new URLRequest("loadedSWF.swf");
myLoader.load(url);
addChild(myLoader);
myLoader.x = 50;
myLoader.y = 30;
With one caveat: during compile time (in the "Air for iOS Settings", in the "Included files" list), you have to list the SWFs that you want to be loaded, and they will get compiled into the IPA.
So, no you cannot call to external SWFs, but you certainly can access other SWFs using the embed tag, or using (what might be called) IPA embedding.
Edit:
Since the question and title have changed a bit since I first answered this, here is a more generic summary. Apple does not allow loading local SWFs in the same way that you would be able to if using Flash Player on a website. There is no way to load an SWF (or anything else) using "relative" or "local" references in an i-device unless that content is compiled into the app. This does not apply to some types of "remote" SWF loading, and also does not apply to Actionscript "Native" coding, but that is not what the (original) question was about.
I am creating HTML5-based iPhone application. How to create a local RSS reader using JQurtyMobile , I don't want to host the HTML files on a server, rather, the HTML files are hosted locally in the iphone project folder
you should check this out with both server-side and only client-side implementation:
link
If you want to build your own RSS reader still in html + javascript and deploy it as an app, you can use PhoneGap.
PhoneGap allows you to store the html + javascript on the device, and then run it as an app.
It's exactly what you're asking for.
If you think phonegap is too big or confusing, you just need to follow one of the several UIWebview tutorials out on the web to write your own wrapper. It takes only a couple of minutes if you are familiar with objective c and Xcode. If that is not the case, it will take you some days, and phone gap adds lots of nice extra features.
for example:
http://www.theappcodeblog.com/2011/02/26/uiwebview-tutorial-link-to-an-ibaction/
I am new to building iphone apps. Have been searching the net on how to create a file dialog. That will allow me to select either images or videos to be uploaded to a website.
If this was a .NET application I would use the FileDialog on my winforms view.
Your help is much appreciated.
Take a look at the UINavigationController, UITableViewController and NSFileManager classes for building a file system browser, which reads the contents of the app's ~/Documents folder and allows "drilling down" into subdirectories.
I suggest using a UITableView for holding files, NSFileManager for learning how to manipulate files stored on the iPhone, and then using HTML POST requests (depending on the site) to push the data to the site. Go find these in the developer documentation!
We are looking on building a project that would run on Android, iPhone and other platforms with Phonegap. The app would be fairly simply, making use of the camera and basic UI features. The first versions would simply point to a web service and load information from there.
Over time, however, we want to improve the speed by:
1.) Downloading content via a separate thread when the app is running and storing the results in a local database,
2.) Hosting a mini webserver in the app*, and
3.) Pointing the PhoneGap UI to the app's mini webserver instead of the service's external webserver.
Two questions:
1.) Is it technically possible to host a mini webserver in iPhone that the app will access?
2.) Would this functionality be rejected by Apple?
Thanks in advance.
*I realize this step probably isn't really necessary. But, if it enables to truly build a "write-once-run-anywhere" UI, it might make sense still.
You're much more likely to want to have the HTML for presentation generated on your actual server, downloaded and stored by your separate thread as an .html file on the iPhone filesystem and served through local URLs using PhoneGap. Essentially, an advanced cache.
This way no web-server is necessary and you only need to write the UI generation code once on the server.