Apple watch series 3 or series 5 for development device? - xcode

I wish to start developing apps for the apple watch and I wonder if I can get just the series 3 model without cellular capability as the series 5 is a little too pricey for me. What am I missing if I don't get the series 5 and cellular capability?

Series 3 should be fine since the important part is that you'll have a physical device to test on. The Series 4 and Series 5 have rounded corners, more space on the display, and a bottom region outside of the safe area. Just make sure the 40mm and 44mm sizes are also tested in Simulator or SwiftUI previews.

Related

Zooming or enhancing performance on ZXing

I'm using ZXing.Mobile.Forms (ZxingScannerPage) in a Xamarin project for an app in which users would have to scan QR Codes and barcodes that are fairly high up (say, around 3 to 4 meters from the ground). The problem is, it's too far for the camera to detect!
I've already tried on more than one phone, one of them being fairly high end. Is there a way to use a zooming functionality, or to enhance the scanner's maximum range? If not, is there a better alternative to ZXing? Or will I just have to tell my bosses to hang all the labels lower?

Apply variations based on device's screen size in Xcode 8?

How do I apply auto layout variations based on the screen size of the selected device? All iPhone devices are Compact width Regular height, so if I want to add a variation for an iPhone 4s screen only, the variation gets applied to ALL iPhone screens since they're all part of the same trait. I remember this used to be pretty easy and straightforward in Xcode 7, but I'm guessing that this just another of millions things that Apple unnecessarily has to overcomplicate. How do I do this in Xcode 8?
How do I apply auto layout variations based on the screen size of the selected device
In a nutshell: You don't. The idea of auto layout is that you apply constraints that cause your interface to look reasonably good in all the different iPhone sizes (that is, all the different ways that the trait collection can be Compact/Regular or Compact/Compact).
This is typically done by using constraints that are based in some way on the size of the ultimate superview; thus, when the superview size is different (because you've launched on a different size screen), things still look good.
I remember this used to be pretty easy and straightforward in Xcode 7
Then you remember wrong. There is no difference in this regard between Xcode 7 and Xcode 8. There is a difference in how Xcode 8 displays to you the effect of your constraints in the Interface Builder canvas, but this is merely a matter of display in Interface Builder, and is in fact an improvement over Xcode 7 (which showed you a big unhelpful square).

How do I get my skspritenodes to appear in the same spot on different sized screens?

I made a game using sprite kit but when I run it on ipod 5 or iphone 5 it works but not on the 4 or 4s. Is there any way to fix this or will it just not work on smaller screens?
They did a great job explaining the initial planning phase to cater for universal app.
http://www.raywenderlich.com/49695/sprite-kit-tutorial-making-a-universal-app-part-1
The gist is to set a screen boundary according iPhone 5 (since the ratio is the odd one) and take set the node to the screen ratio (with Scale Mode set to Fill).
e.g.:
self.scoreLabel.position = CGPointMake(CGRectGetMidX(self.frame)*9.5/10,self.frame.size.height*8.8/10);
self.scaleMode = SKSceneScaleModeAspectFill;

iPhone 5 - Background images

With the new screen resolution and aspect ratio of iPhone 5 it seems there are two approaches to take advantage of the new screen real estate when handling images that are full screen (or mostly full screen) images:
Include two images bg#2x.png and bg-h568#2x.png and check the device's main screen bounds to figure out which to load.
Only include the one file but make it the full iPhone 5 resolution
(There are other methods also: stretching, tiling, and / or drawing with Quartz.)
Both of these options have drawbacks:
Including two files is going to increase your app's bundle size
Loading a iPhone 5 retina image on a 4 will clip the image data when displayed on screen, but will still consume the same amount of memory resources
I am particularly interested in understanding the details of the second drawback better.
I am thinking it would save the app bundle (and my designer) if I could use this consolidating images idea further...
Let's say I have an image that take up 320pt x 480pt in portrait and 480pt x 320pt in landscape (width x height).
(EDIT: Initially I hadn't considered a couple of other important tidbits. For sake of completeness, I'm including those thoughts here)
If we create a single image file at a 480pt x 480pt resolution instead of landscape and portrait files, it would prevent the app bundle from having two files that which each contain 320pt x 320pt area of duplicate image data. However, this large square image would include four 80pt x 80pt quadrants in the corners that won't be seen. All things equal, we should still have 20% less image data in the app bundle.
Having re-read Bill's "iBooks Author Experiment", the memory requirements are very easy to figure out:
Landscape or Portrait: 640 * 960 * 4 = 2,457,600
Large Square: 960 * 960 * 4 = 3,686,400
The memory required to load the large square is 50% more then loading the image sized correctly for the screen. Clearly the savings in the app bundle don't measure up to this hit on resources!
But, what about extending this to a giant square that would encompass iPhone 5 and iPhone 4 - 568pt x 568pt? Instead of four files (iP4 landscape, iP4 portrait, iP5 landscape, iP5 portrait), there would be only one file in the app bundle (giant square). The savings could be about 60%.
What about the resources hit?
iPhone 5 Landscape or Portrait: 1136 * 640 * 4 = 2,908,160
Giant Square: 1136 * 1136 * 4 = 5,161,984
That's 110% more memory for iPhone 4, and 77.5% more memory for iPhone 5.
My original question was roughly two parts: 1. Do I understand this correctly and 2. is this tradeoff a wise one to make.
I hope my edits (spurred by Bill's answer) show that I do understand this stuff now. And, if the new found knowledge is correct, then #2 pretty much answers itself. :-)
Generally you get it.
Assuming that you have the big square image and it's some kind of tiled pattern (linen etc) then you could use ImageIO to load the cropped image at the size you need which would use some extra memory decompressing the image but once done it would consume only what is needed to fill the background.
I would suggest against scaling the image.
On the flip side though, shipping an app with 3 images (foo, foo#2x and foo-h568#2x) instead of 1 makes way more sense. The only way I'd say you should go with one image is if you are close to the 3G/LTE download size of (I think) 50MB.

Slow performance on Android tablet with SurfaceView

I'm developing a card game in Android using SurfaceView and canvas to draw the UI.
I've tried to optimize everything as much as possible but I still have two questions:
During the game I'll need to draw 40 bitmaps (the 40 cards in the italian deck), is it better to create all the bitmaps on the onCreate method of my customized SurfaceView (storing them in an array), or create them as needed (every time the user get a new card for example)?
I'm able to get over 90 fps on an old Samsung I5500 (528 MHz, with a QVGA screen), 60 fps on an Optimus Life (800 MHz and HVGA screen) and 60 fps with a Nexus One/Motorola Razr (1 GHz and dual core 1GHz with WVGA and qHD screens) but when I run the game on an Android tablet (Motorola Xoom dual core 1 GHz and 1 GB of Ram) I get only 30/40 fps... how is that possible that a 528 MHz cpu with 256 MB of RAM can handle 90+ fps and a dual core processor can't handle 60 fps? I'm not seeing any kind of GC calling at runtime....
EDIT: Just to clarify I've tried both ARGB_888 and RGB_565 without any changes in the performance...
Any suggestions?
Thanks
Some points for you to consider:
It is recommended not to create new objects while your game is running, otherwise, you may get unexpected garbage collections.
Your FPS numbers doesn't sound good, you may have measurement errors, However my guess is that you are resizing the images to fit the screen size and that affects the memory usage of your game and may cause slow rendering times on tablets.
You can use profiling tools to confirm: TraceView
OpenGL would be much faster
last tip: don't draw overlapping cards if you can, draw only the visible ones.
Good Luck
Ok so it's better to create the bitmap in the onCreate method, that is what I'm doing right now...
They are ok, I believe that the 60 fps on some devices are just some restrictions made by producers since you won't find any advantage in getting more than 60 fps (I'm making this assumption since it doesn't change rendering 1 card, 10 cards or no card... the OnDraw method is called 60 times per second, but if I add for example 50/100 cards it drops accordingly) I don't resize any card cause I use the proper folder (mdpi, hdpi, ecc) for each device, and I get the exact size of the image, without resizing it...
I've tried to look at it but from what I understand all the time of the app execution is used to draw the bitmap, not to resize or update its position here it is:
I know, but it would add complexity to the developing and I believe that using a canvas for 7 cards on the screen should be just fine….
I don't draw every card of the deck.. I just swap bitmap as needed :)
UPDATE: I've tried to run the game on a Xoom 2, Galaxy Tab 7 plus and Asus Transformer Prime and it runs just fine with 60 fps…. could it be just a problem of Tegra 2 devices?

Resources