Live data from Hacker News

React Native for Android

code.facebook.com

31–40 of 248 posts

Re: React Native for Android

#31
post #9

Yes! I've been working with React-Native on a side project for a few weeks now. WHAT A GODSEND! Before this, I was using Titanium, which is heavy, slow, and difficult to integrate with. React-Native felt like home. On a related note; Why is it up to Facebook to develop something like this? Why aren't Apple and Google making it this easy to develop apps? ObjC is a nightmare, 90% of apps out there don't need that level…

Why aren't Apple and Google making it this easy to develop apps? Apple has no incentive to make it easier for app developers to port their code to other platforms.

But it does have incentive for app developers on other platforms to port code to their own platform.

Re: React Native for Android

#32
post #6

The general feeling on HN is that it is better to focus on Native development on both platforms because Cordova hybrid apps have a overall bad user experience. Is this still the case with React Native or is it becoming the most effective option?

The issue is the developer. React-Native as a tool allows you to make poor design decisions, but it does nothing wrong itself. We need to be vigilant and remember to stick to native interactions.

could you elaborate on what poor decisions rn allows you to make over native ios/android?

Re: React Native for Android

#33
post #22
post #4

When porting a React Native app to android 85% of the iOS version was reused: "At the time of shipping Ads Manager for Android, that approach yielded around 85 percent reuse of app code."

Yeah, the promise is not "write once, run everywhere". It's 1) write in a familiar way and 2) reuse a substantial amount.

Which is unlike using Ionic Framework, where I've gotten about 98% code reuse between platforms.

The only place that I usually end up making platform-specific changes is where Ionic has an iOS-specific layout change that breaks the look of a custom component on iOS. That and sometimes native-only features like Push Notifications that need to be handled slightly differently on each platform. But the latter is about a half dozen lines of stock code that take the iOS result and hand it to a common handler.

I'm probably sticking with Ionic for now, though I'm planning to try out Meteor for my next project that has backend requirements. Meteor can install the Ionic SCSS as a plug-in, so you CAN get the best of both worlds.

Re: React Native for Android

#34

Earlier quoted context omitted.

Why aren't Apple and Google making it this easy to develop apps? Apple has no incentive to make it easier for app developers to port their code to other platforms.

Sure, but that works in reverse. People could easily port their code TO iOS.

Unfortunately everyone writes iOS first nowadays because rich people overwhelmingly own iOS devices.

Re: React Native for Android

#35
Question for everybody doing some sort of cross platform mobile dev.

How common is it to have NO experience with a platform's native libraries? In other words you didn't go from ObjC or Java to React Native/Cordova/Xamarin to try and re-use code but because you know JS or C# and weren't concerned about learning the native platform.

For any that started out with no native platform knowledge did you start to dip into it as you got more experience with the cross platform tool and started bumping up against any potential limitations?

I've been flirting with Swift when I have some (rare) downtime, to get a foundation, but maybe that's not even necessary anymore given the effort companies like Facebook/Xamarin/Telerik* are putting into abstracting away the native platforms.

[*] I intentionally left Cordova off that list as "native" native and "phonegap" native are two different things.

Re: React Native for Android

#36
I like this. I tried Ionic, didn't like the complexity or the fact that one of the downsides of the "write once, run everywhere" approach is that my app looked too identical and didn't respect the design conventions of the platform it's running on.

It's interesting how you work with views named after their phone counterparts. Makes it far easier for a fairly experienced phone developer to make the switch.

I'm going to have to give this a try. I have a little side-project, a Golang hacker news clone, that I think deserves a mobile app.

Re: React Native for Android

#37
post #9

Yes! I've been working with React-Native on a side project for a few weeks now. WHAT A GODSEND! Before this, I was using Titanium, which is heavy, slow, and difficult to integrate with. React-Native felt like home. On a related note; Why is it up to Facebook to develop something like this? Why aren't Apple and Google making it this easy to develop apps? ObjC is a nightmare, 90% of apps out there don't need that level…

It's already damn easy to develop apps. Objective-C is just fine.

The only reason you think it's not easy is because you're using Titanium, and not embracing the different platforms' native toolkits.

Re: React Native for Android

#38
post #4

When porting a React Native app to android 85% of the iOS version was reused: "At the time of shipping Ads Manager for Android, that approach yielded around 85 percent reuse of app code."

One realization I had when designing the API of React Native is that if you want to be able to share any component you need to have the lower level primitives to be shared. So I went on making them: View, Text and Image. I also realized that the same layout engine was required so implemented a shared layout which ended up being flexbox.

What amazed me the most during this journey is that most platforms have actually very similar low level building blocks but unfortunately slightly incompatible in many ways.

The 85% number is mind blowing, it turns out that those few building blocks are actually a large part of what it takes to build a high quality mobile app.

Re: React Native for Android

#40

Earlier quoted context omitted.

Why aren't Apple and Google making it this easy to develop apps? Apple has no incentive to make it easier for app developers to port their code to other platforms.

Sure, but that works in reverse. People could easily port their code TO iOS.

Perhaps, but most studies show that they start on iOS to begin with.
Post reply on HN