My application requires at least 40MB of RAM, so earlier iPhones (like 3G, first iPod touch versions) just do not have it (they have max about 20MB for my app). Is there a proper way to disable installing it to 3G devices? I know UIRequiredDeviceCapabilities, but it does not have parameter for minimum available memory.
First, are you sure that your application actually uses 40 MB of RAM on the older devices? I've found (by using the Memory Monitor instrument) that the same application uses less RAM on my iPhone 3G than it does on my iPhone 4 or iPad. The latter two devices have more pixels within their interfaces, so my application chews up more memory when running on them.
If it does, figure out if you can optimize memory usage to get it within a safe (< 30 MB) range for the older hardware. If you can do this, I think you'll see an across-the-board performance improvement in your application, even on the newer hardware.
Finally, if you absolutely cannot run on an older iOS device, I'd recommend using the UIRequiredDeviceCapabilities keys armv7 or opengles-2. Either will filter for the newer (iPhone 3G S and greater) hardware. While not keyed on memory size, the iPhone 3G S launched with significantly more RAM than the older models, and not a device since has had less. It's hard to imagine Apple reducing this specification at any point in the future.
Related
i want to develop an application that is capable of using 2G 3G or 4G depending upon the availability of the network. Because this app will be used in different countries and there is a support of only 2G in some countries while some support 3G or 4G.. i am a little bit confused whether my app will automatically use the Fastest network available or i will have to explicitly code for each one.
According to Apple's documentation, WiFi is what is chosen first. If that fails, then it goes to the next available (and presumably fastest) cellular network data connection.
This is the kind of thing programmers do not have to worry about when designing apps for iOS.
iOS will take care of whether wifi or 3G is used. You don't need to worry about that.
If you have operations in your app that use a lot of data you may want to restrict them to when the user is on WiFi (or at least warn them). The reachability example shows how to do this, among other things. Worth looking into as apple have been known to reject apps that use excessive amounts of cellular data.
I've seen plenty of posts about the simulator running slow, but my problem is different.
I ran my app with instruments and saw that in the device, the app uses about 8mb of live memory when the app is running. In the simulator the live memory is about 50MB, and I have no idea why this is.
This causes the simulator to lag and I need it to run smooth so i can take a nice screen capture video of my app.
Any ideas?
There are a number of steps in the OpenGL ES 1.1/2.0 pipeline that are done in software when running on the simulator (as the Mac GPUs are plain OpenGL) but are hardware accelerated when running on the device (hence it actually running faster on the device).
From the documentation:
Important: Rendering performance of OpenGL ES in Simulator has no
relation to the performance of OpenGL ES on an actual device.
Simulator provides an optimized software rasterizer that takes
advantage of the vector processing capabilities of your Macintosh
computer. As a result, your OpenGL ES code may run faster or slower in
iOS simulator (depending on your computer and what you are drawing)
than on an actual device. Always profile and optimize your drawing
code on a real device and never assume that Simulator reflects
real-world performance.
This definitely explains the speed discrepancy, might also explain the extra memory taken up when running in the simulator.
I want to know the feasibility of these things:
1) Is it possible to download 200MB audio files to our application?
2) How much RAM can be accessed from an iPhone app? What is the largest amount of RAM an app can expect to use?
Anyone's help in this regard is deeply appreciated.
Thanks to all,
Monish
1) Yes, although you might make users angry who are not on Wifi + fast DSL. Also you will need to handle interrupted downloads.
2) No, since ARM is a 32bit processor a maximum of 4GB RAM can be addressed. Anyhow, iDevices have a maximum of 512MB right now (iPad 2). Your application will get killed by iOS if your app takes about 75% or so of the available RAM which means in reality you shouldn't use more than, say, 80MB of RAM. And if you need to address 8GB then your design is totally flawed to begin with.
There are always ways to work with a lot less (e. g. either by using better algorithms and/or by caching to disk). On the disk, you are only limited by the available space left on the device. So if you have an iDevice with just 8GB you're naturally out of luck as the system itself and other apps/data are reducing the available space. Same if you're on a 64GB iDevice which is packed with movies. You will need to be able to work with the space that is available. You can, for example, try to "reserve" the necessary space by creating a file and making it as big as you need it (via a seek and a write) but be prepared for angry customers.
I am testing my app in two different devices. My app is relies heavily on images(allocating and deallocating). I know I have a leak but I am just curious why I observe this.
The behavior between the two devices is different. Device A crashes after 4 cycles of switching between views and Device B after 10 cycles, yet Device A has more free memory than Device B.
Device A: Device B:
Type iPhone 3G 16GB iPhone 3G 8GB
Capacity 14.64GB 7.08GB
Audio 5.32GB 1.18GB
Video 48.8GB -
Photos 267.3GB 46.8GB
Apps 1.08GB 505.5MB
Other 343.9MB 370.7MB
Free 7.60GB 5.0GB
Any insights why this is the case?
I am not sure if I understand this correctly, but the figures on the last row (7.6/5 GB) refer to available flash memory, not to the RAM. Therefore they say nothing about the expected performance of a memory-intensive application. Neither the amount of free RAM is exactly telling, because the system will start killing large applications when the memory is scarce and the amount of free memory will go up.
How many bogomips (or any other relevant unit) can an iPhone or iPod touch deliver?
Is performance in larger applications, as on normal PCs, more limited to cache thrashing than to number of CPU instruction? Or is there some other limit?
What is a recommended total polybudget for a state-of-the-art game in a plain iPod touch (i.e. not iPhone 3GS)?
Does the ARM-11 in the iPod touch and the Samsung ARM in the iPhone have an FPU with the same performance as that of a normal PC, scaled to the core clock frequency?
The reason I'm asking is that I want to port a game with a physics engine (i'm using ODE). If you know anything else I should look out for, don't hesitate to mention it!
GLBenchmark has published a series of benchmarks for various mobile devices, including the iPhone, iPhone 3G, and iPhone 3GS. For example, the iPhone 3G appears to be capable of rendering 687,000 smooth shaded triangles per second (the best I've actually been able to get in my application is 460,000).
In regards to the CPU, the ARM processor on the iPhone has native floating point support, and even has a vector floating point unit. In comparison to a desktop, I ran a computationally intensive operation (NSDecimal addition) on both my desktop (in the iPhone simulator) and on the device (non-3G iPhone). The desktop (MacBook, white, 2.0 GHz Core 2 Duo) did 3344593 operations per second, where the iPhone did 281555. The desktop, which scored 2.64 Gflops on Xbench, was 11.88 times faster than the iPhone. Whether this means that the non-3G iPhone is capable of more than 220 Mflops would require more testing.