I am developing for Blackberry usign phonegap and I need to copy all my app files to a writable location (I assume the app file location is red only).
Setting up the plugin to do this is easy enough using Java, however the problem I am having is finding the location of these files specific to my app so that I can copy and move them.
From previous reseaerch it seems that Class.getResourceAsStream would work e.g.
getClass().getResourceAsStream("/index.html");
However do not userstand how this can be specific to my app.
Thanks,
BlackBerry application file is packaged as *.cod file. It is kinda modified java *.jar file with hierarchical structure (folders, packages inside of the archive).
When you run getClass().getResourceAsStream("/index.html"); you get index.html file from the root package of your *.cod file. If there's a file attached upon compilation process, then you will get it, otherwise the operation fails.
As you want to use a writable media, then consider FileConnections API of the RIM SDK.
cod files are stored to a special location (not the filesystem). But you will need to deal with the filesystem if you want to write files to the device memory or memory card.
Related
For a native iOS application we are integrating a C++ library which is writing some logs to disk to json file.
During debugging, we would like to access to this logs, but currently we can only do it by downloading the whole app container to the macOS machine and searching for the file there.
Since this a very time consuming operation we were hoping that there would be some solution that would allows us to get this file quickly. I did take a look to the lldb commands, but none of them seem to let you extract a file from the phone.
Is there anyway to do this in a quick way?
Thank you
Couple options...
1 - Add debug-only code in your app to share the log file (via AirDrop would probably be a good option).
or
2 - During debug, set these two keys (in project settings / info) to Yes:
Application supports iTunes file sharing
Supports opening documents in place
Once you've done that, you can open / copy files from your app's Documents directory (assuming that's where the logs are being written) from Finder on your Mac.
I know how to search a directory for a file(s) using NSFileManager. But I want to search all directories in iphone to find files with some extension (let's say .txt). How can I do that?
The files that an app can access are those in the app's sandbox. This means you can access only those files that originated(directly or indirectly) from your app. Complete unrestricted access to the iOS file system is not possible as of now.
However I think it is worth noting that iOS 11 has introduced some changes that do allow you to view the document directories of other apps. This is possible only if those apps have made their documents directory public using the 'UISupportsDocumentBrowser'key in their info.plist. Again this depends on how the other apps are coded and might not be of help in your case.
I have a iOS and OSX application which is document based and i am saving complex folder hierarchy inside the document so i change my UTI type to document package.
But the problem is that according to apple Document Package is just a folder. If i open the document package on windows or linux machine it consider it as folder despite of having a .abc extension. I figured out that one solution to this problem is that i zip the folder while saving. But i don't think that it is a good approach because every time i open up the file i will have to decompress the folder and compress it again on re-saving.
Is there any other solution to this problem?
I found another better solution.
Solution is to use SQLite database as your document as long as you have text to save on the file systems. In my case i also had images, so i created a table for all the images and a table for all the files contents that i used to write on files. So the document will have custom extension(.abc) which will only be opened with your application.
My application needs to load external swfs with ABC. I checked that this feature is available in AIR 3.7 and later. I managed to get the new SDK - 3.8 with the latest version of FD (4.4.3).
Now I am following this link: http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air-apps-on-ios/
According to this post, "During IPA packaging, ADT extracts the ABC code from all child SWFs, adds it to the final executable and generates stripped SWFs in the “externalStrippedSwfs” folder created in the current working directory. The directory structure within the “externalStrippedSwfs” folder remains the same as specified within the text file. The generated stripped SWF’s should then be externally hosted on a web server of developer’s choice."
However, firstly, I could not find any such folder called "externalStrippedSwfs".
Secondly, even if this works, this means that everytime I have a new external swf to load, I will have to get it stripped off the code, put it in the main swf, and then upload the stripped swf (with assets). So everytime I do this, I need to "reupload" my app to Apple.
Are these assumptions right? My app architecture will need to be modified accordingly.
Yes, your assumptions are correct: You can't load an external .swf containing AS3 and have the app execute the byte code.
If we ignore the fact that it would most likely not be approved by Apple it can't technically work. The reason is because the Adobe AIR app doesn't contain a virtual machine capable of interpreting the byte code in the .swf:
When you build your application for iOS, there is no interpreted code
and no runtime in your final binary. Your application is truly a
native iOS app.
Source: http://www.adobe.com/devnet/logged_in/abansod_iphone.html.
You can do it! :) You just need to upgrade to AIR SDK3.8+ and follow the painful process.
The only limitation is that each external swif that you will be loading at run time, must be stripped by your ADT.
But you are right: you will need to update your app everytime your external content needs to be updated.
"externalStrippedSwfs" is arbitrary (name it as you wish I believe), you have to create that folder in your bin and run the command line from there.
Looks like Apple is not ready to lose the leash yet...
I got my app rejected due to violation of 2.23
After inspection, it would appear that I was indeed not a correct path for storing downloaded images and data files (i.e. files that I would prefer to have available for offline usage, but which the app can re-download again if removed by iOS)
However, after looking at:
https://developer.apple.com/library/ios/qa/qa1719/_index.html
It appears it may not even be enough to proper "cache" path for iOS > 5? Example:
/var/mobile/Applications/00000000-0000-0000-0000-000000000000/Library/Caches/'
Will using above make my app pass this requirement? Or am I forced to using the API for making files not to be backed-up?
Using the caches directory is correct if you can re-download the files. They will not be backed up. You only need to use the "do not backup" flag if the files exist in a location that normally is backed up (e.g. the documents directory).