Does sencha load all files of all profiles while deploying to a particular profile? - sencha-touch-2.1

I am developing a Sencha Touch2 application. I am using profiles for creating different views for different device types like tablets, desktops and mobile. But when the application is loaded in any particular device type say mobile, does it load only files related to mobile or does it loads all the files of all device types.

If you are listing profiles as such:
Ext.application({
profiles : [ 'Phone', 'Tablet' //etc ]
})
Then yes, Sencha Touch will load each of the profile classes and any dependencies listed in their requires blocks. It does this because the framework will look at each profile to determine which is "active" at any given time, and it's better to take the time to load dependencies at startup than randomly at runtime.
Now you could write some logic before running Ext.application() to manually load the necessary profile data... but that's going to be tricky in most cases.
In either case, you should be using Sencha Cmd to minify your code into a production build - so the memory footprint would be smaller and the application would load much faster.

Related

iOS "Plugins" with sounds

Let's say a "plugin" is a collection of 5 sounds:
1.mp3 2.mp3 3.mp3 4.mp3 5.mp3
My app needs to support such plugins to switch between different sound-themes.
On Android ecosystem, I can simply create a new application that only contains those 5 mp3-files in the assets folder. It will be a plugin. Let's say its package name will be com.mysite.plugins.test
From my main application, I can list all installed apps (plugins) with package prefixes com.mysite.plugins.*. And easily access any of their assets.
I'm new to iOS world... And need something same. As far as I have researched, it's not possible... There can't be an app that contains only sounds, accessible from my main iOS app.
The only way seems to host sound-packages on my server (cloud) and download them from the main app.
However, this way requires payments for data transfer.
Am I missing some more elegant solution? Like hosting sound-packages directly on Apple servers?
Thank you!

IPhone: Best way to deliver configuration file to test application

Main Problem
I have to write test application for iOS to test very complex multi platform framework.
There are already applications for other platforms which are using common configuration file (which defines test servers, user names, log level, and so on). Configuration process is quite complex so providing a complex UI will be waste of time on mobile platforms.
This file is a xml and its file name extension is xml.
Tester will have multiple configuration files (will use only one at the time)
This files should be easily uploaded by tester
tester should be able to select configuration file
What solution I'm looking for
At bagging I was thinking about iCloud service. Problem is that in 90% of cases device is shared by multiple people (testers and developers), so I'm not convinced this is best approach, since this will provide problems with sharing an iCloud account (usually there is account per device not per tester/project).
It would be best if this files could be delivered to application by using iTunes. Anyone who will do test will have this tool to install test application, so it would be nice if he could upload those files too.
Any useful hint will be appreciated (not necessary a full solution).
As a bonus opposite direction would be also useful (fetching logs). Currently usually logs are send by an email. If it is possible to easily fetch this in same meaner as configuration file it would be great.
Ok looks like it is possible to do this with iTunes.
When inspecting list of installed app for device in iTunes at the bottom there is a section "File Sharing" where you can add remove files.
If you want
That your test application for iOS, test something by readying XML File
There are different XML files
There are different testers.
In this case rather than doing too much you can
Ask testers to upload the files in dropbox.
Have a textbox in your app, in which user will type the URL of XML file (which they have uploaded on dropbox)
And next to it you have test button on click of it you can download the file and test against the logic.
Once the test is over you can grab the result by email or ask them to upload on Dropbox (manually or using api).
Ok I've finally found something like that. This perfectly solves my problem.
Files will be uploaded and downloaded by iTunes.
Another helpful link.

How to design a container like iOS app that can grow in functions?

We have a requirement where we need to build an iOS app 'A' that would have menu options for a number of functionalities and these functionalities will grow over time. So, the clients suggested that we do an iOS app 'A' that displays just the menu options and the options when clicked will each launch another iOS app (which implements that functionality) residing on the device. This would be a bad user experience considering the user will have to be moved out of 'A' for each link. At the same time, we cannot build all the features in 'A' since the size of 'A' would get too large.
Is there an elegant design solution for this kind of an application?
Launching a different app for each function seems a bit clunky at first, but on the other hand it does offer the flexibility of adding additional modules without having to rebuild and redistribute your application every time. If the modules are independent enough that a user wouldn't need to constantly switch between them, this might not be a bad solution.
You could use custom URL schemes to launch each module, and use (for example) an XML file to configure which modules are available and the URL scheme to launch each one. That way you could update the XML file remotely (have the application call a web service on startup to check for an updated configuration file). Your configuration file could be as simple as something like this:
<modules>
<module name="Module A" url="moduleA://myModuleA"/>
<module name="Module B" url="moduleB://myModuleB"/>
<module name="Module C" url="moduleC://myModuleC"/>
</modules>
and then the app could provide a button to launch each module. You can add additional tags for any other information you need about each module (e.g. an icon image or whatever).
When you add a new module, update the config file on the server and the app will find it on the next startup. Your app would have to redirect the user to the app store to download and install the new module if it's not already installed on their device.
Of course if your modules need to communicate with each other or share data, it gets more complicated. You can pass parameters between modules in the custom URL scheme, but if they need to share large amounts of data (like a database or something), then you'd need some other way to share that data.
Hope this helps.

Display offline html5 website

For my business I need to be able to show a potential client a website I generate with a program called Pano2VR, which is a virtual tour program. This program takes some panoramic photos linked with each other and can generate a virtual tour out of them (as example: www.casas-fotoart.de/virtualtours ). The output this App gives can be either HTML5, Flash or both (flash if available and html5 for mobile devices, for example).
I need to be able to show that on my iPad while offline. i haven't found any solution for that so I tried to build a easy App for that, which I thought it wouldn't be complicated.
I generated a html5-only virtual tour and I droped the output into the "Suporting Files" group on the Xcode project. I added a UIWebView and on viewDidLoad I set it so it loads the html file.
The files I'm droping are like these (these inside the ipad folder):
The html file loads into the webView, but it just displays "This content requires HTML5/CSS3, WebGL, or Adobe Flash Player Version 9 or higher.", even though when loading these files from the net, it loads perfectly. I know this message comes from the html file.
Any idea on how to make it work will be much appreciated. Thanks in advance.
Your problem is this probably - XCode is mangling the JS files, I assume because it's trying to compile them

iOS local file access and webkit

I'm absolutely new to iOS App development (I haven't actually started yet, still in a design phase).
The task that I have to accomplish with my app is to download a zip from somewhere, extract anywere to local storage and display its content (html pages with javascript) in a embed webkit widget.
The questions are:
1) Will my app have access to any folder of my iPad storage memory?
2) Will my app's embedded Webkit widget be able to display local html pages (like file:///somewhere/over/the/rainbow.html ?
3) WIll that local page be able to use Ajax method (over httpxmlrequest) to dynamically load external scripts or xml (also locally stored - ie ./something.xml)?
Thank in advance for any help!
No it can't access any file. Apps are sandboxed on iOS. You can only access the app bundle's content and documents folder (a writable area unique to your app).
Yes - provided said content is in the areas mentioned in (1). This is how Phonegap-based apps work.
Yes - they can. We've done exactly this extensively in several of our apps.

Resources