Live data from Hacker News

Android Development Tips For iOS Devs

stuartkhall.com

51–60 of 78 posts

Re: Android Development Tips For iOS Devs

#51

Earlier quoted context omitted.

In my experience anything that Xcode promises to just work, just doesn't but yes they have at least improved provisioning. The original point was that there are steps to go through, and creating a paid developer account is a non trivial step

You need to create a paid developer account on Android too.

No, you do not need any paid account in order to compile an APK and install it on any number of devices. I could paste a link to an APK right here, and if you were visiting it from your phone, you could install it directly from that downloaded file.

This works on any number of devices.

You need a Google Play Developer account in order to distribute through the Google Play store, but you can directly install an application on an unlimited number of devices for free without ever signing up for an account. This is not possible on iOS without jailbreaking every phone.

Re: Android Development Tips For iOS Devs

#52

Earlier quoted context omitted.

This is by design in Android. It's very computationally heavy to ask for the heights of each ListView item. Unfortunately I wasn't able to dig up my reference to this. :( Two more things: 1. The wormy scrollbar is actually standard on Android: the messaging app does it, IIRC even the twitter app on Android does it. So even though your iOS experience tells you it's weird, any users of yours on Android likely won't not…

> It's very computationally heavy to ask for the heights of each ListView item. Can you expand on that? Do you mean that it's expensive for the OS for some reason, or do you mean that it's expensive for your (client) code to compute the height of each item? It seems like in most cases it's a simple method like "return isHeader : HEADER_HEIGHT : ITEM_HEIGHT;"

For the OS. Imagine 999 rows containing one line of text and the last one containing a long text spanning maybe 30 lines.

To calculate the scroll accurately you need to calculate the height of 1000 elements to get the full height.

Instead in the common scenario you just calculate the height of the rows displayed on the screen and estimate the height using the average and the count.

Re: Android Development Tips For iOS Devs

#53

Earlier quoted context omitted.

> Therefore, most Android developers test small changes initially on a device. That's also because deploying an APK on a test device (or several devices) is way easier than deploying an IPA on an iOS device. As someone relatively new to iOS this past month or so, I was shocked by the number of hoops I have to jump through just to take a piece of code I've written and put it on a device that I own and is sitting right…

I would argue that debugging is also infinitely easier in the Android world, since plugging a phone into USB and authorizing ADB gives you full control to see everything on the phone. You can get full logs and debug control over the hardware. You can push and pull stack traces and files to and from the device with a single, three operand command line and obtaining hardware screenshots requires only a click in IDE. An…

[deleted]

Re: Android Development Tips For iOS Devs

#54

Earlier quoted context omitted.

> It's very computationally heavy to ask for the heights of each ListView item. Can you expand on that? Do you mean that it's expensive for the OS for some reason, or do you mean that it's expensive for your (client) code to compute the height of each item? It seems like in most cases it's a simple method like "return isHeader : HEADER_HEIGHT : ITEM_HEIGHT;"

For the OS. Imagine 999 rows containing one line of text and the last one containing a long text spanning maybe 30 lines. To calculate the scroll accurately you need to calculate the height of 1000 elements to get the full height. Instead in the common scenario you just calculate the height of the rows displayed on the screen and estimate the height using the average and the count.

I don't have to imagine this, though, I've done it on iOS. It works fine, because you're rarely working with 1000 items at once. With pagination, you cache the old results, and only calculate the new 50 or so rows at a time.

Re: Android Development Tips For iOS Devs

#55

Earlier quoted context omitted.

> Therefore, most Android developers test small changes initially on a device. That's also because deploying an APK on a test device (or several devices) is way easier than deploying an IPA on an iOS device. As someone relatively new to iOS this past month or so, I was shocked by the number of hoops I have to jump through just to take a piece of code I've written and put it on a device that I own and is sitting right…

I would argue that debugging is also infinitely easier in the Android world, since plugging a phone into USB and authorizing ADB gives you full control to see everything on the phone. You can get full logs and debug control over the hardware. You can push and pull stack traces and files to and from the device with a single, three operand command line and obtaining hardware screenshots requires only a click in IDE. An…

Uh. It's way harder to setup an android device for debugging. I just had to plug in my iphone and tap "use for development" at the prompt.

I'm porting an iOS app to android right now, and android is way behind on the development side of things.

Re: Android Development Tips For iOS Devs

#56
post #3

"I used to think the iOS simulator was painful, now I realise it's pretty awesome. Skip the Android simulator all together and deploy to a real device, or be prepared to spend a lot of time waiting." With its "native" emulator, yes, but there are better alternatives like Genymotion. Giving up on them is not good development advice.

The android emulators not only are bitterly slow to launch and use, but they do not reflect actual device performance, unlike the iOS simulator.

This makes automated testing impossible on the simulator, whereas in iOS I can run my full test suite (400-something tests) in the simulator in a couple seconds.

Re: Android Development Tips For iOS Devs

#57
If you're commenting on the ease or difficulty of building iOS/Android native apps in this thread, and you aren't actively building an app for both or have built one before, you probably don't know what you're talking about.

The eco-system for building and deploying apps on both sides has gotten way better in the past couple years. There are pros and cons to both sides of development.

Re: Android Development Tips For iOS Devs

#59

Earlier quoted context omitted.

Excellent point. Running the x86 images in the emulator is much faster (and Google recently released x86 images w/ Google APIs in them). Genymotion is a decent alternative to the 1st party emulator, it runs significantly faster.

Genymotion is as close to the speed of the iOS Simulator as you can get today. However, Genymotion is x86-based, so ARM libraries you use in your app that are designed to run on an ARM device will not work in Genymotion on your computer. However, if your use of those is limited to just a few Activities in your Android app, you should be able to do a lot of things with Genymotion, and just tiptoe around trying out tha…

By the time you use special binary ARM libraries you should have figured out the difference between an emulator and a simulator and also maybe discovered the possibility to deploy to a real device.

Re: Android Development Tips For iOS Devs

#60

If you're commenting on the ease or difficulty of building iOS/Android native apps in this thread, and you aren't actively building an app for both or have built one before, you probably don't know what you're talking about. The eco-system for building and deploying apps on both sides has gotten way better in the past couple years. There are pros and cons to both sides of development.

iOS pros: Blazing fast simulator, ability to run tests through xctool or Xcode. Autolayout is extremely powerful, and you don't need to write state suspend/restore code for landscape rotation.

If you're writing a new app, you can probably exclusively target iOS7.

iOS cons: The device limit. This makes deploying apps to your users more difficult than it should be. Xcode is also an extremely weak IDE, but AppCode makes up for it.

Android pros: Faster iteration with releases, because no review process. You're also less likely to fight app review for dumb shit.

The nexus 5 is only ~$420 with shipping.

Intelli-J support.

Android cons: Emulator is for all purposes unusable. You will need to buy a device. Fragmentation of the OS across all devices.

Post reply on HN