Live data from Hacker News

React Native for Android

code.facebook.com

101–110 of 248 posts

Re: React Native for Android

#101
post #51

Earlier quoted context omitted.

I would love to see some discussion around this as well. I have been playing with Apache Corodova and Windows 10 SDK lately and they look very promising. Being a web developer, I found them to be easy to get started. Are there complex apps built using phonegap/swift/cordova? What are the limitations? I know Facebook tried with a 'web app' approach and reverted back to native solution. But that was years ago.

Using Cordova, you will always be behind any and all Mobile Safari WebKit et al bugs. This not a big deal when pushing layout around a webpage, but it can be crippling for app development as the app grows in complexity and you crave native-quality interactions. Mobile Safari's Webkit implementation has a staggering list of severe bugs. Developing under it can become a nightmare of hacks and backpedaling. Been working…

[deleted]

Re: React Native for Android

#102
post #79

Earlier quoted context omitted.

Chrome? I could be wrong but I am pretty sure I am typing this response in Chrome on a Windows box right now, so maybe not the best example of an Android only app.

I figured we were talking in the context of Android vs. iOS.

Fair enough. But even Chrome missing from iOS is mostly just an annoyance to tech types. Nobody is trading in their iPhone for a Nexus just to get Chrome, it's not the same as when Instagram was iOS only.

Re: React Native for Android

#103

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 i…

I got into native development with no experience in the iOS/Android APIs, coming from a web dev background. I did know Java and C from working on side projects, and read up on Objective-C before, though. At my previous company, all the developers doing native work had no prior experience w/ mobile development (i.e. they primarily had backend C# experience)

I dabbled w/ Cordova and friends before, and did some work to wrap webapps in thin native shells earlier on, but there was always a very strict separation between the "sandboxed" webapp and the native code, if any.

Webapps can and do work just fine for CRUD applications, but right now, I'm of the opinion that if you want to really leverage the hardware APIs or the native ecosystem, you're better off learning the native platform, because you get no syntax mismatch friction on Stack Overflow etc, compared to Xamarin / React Native / Ambly / whatever

Also, this opinion might be unpopular among the js devs who like lightweight text editors (disclaimer: I'm one), but the heavy IDEs for Java/ObjC/Swift are actually immensely useful once you get familiar w/ their features. The static typing provided by those languages helps a lot in large refactors, in API discoverability/autocompletion and in reasoning about the codebase in general.

Re: React Native for Android

#104

Anyone got the Android skeleton working? I'm getting a red page "unable to download JS bundle" despite having the dev server running. I'm using a 2013 Moto X on Android 5.1.

Make sure your phone can connect to your machine: check https://facebook.github.io/react-native/docs/running-on-devi...

Re: React Native for Android

#106
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?

Having used RN and, years ago, PhoneGap, I can say RN is way better. With PhoneGap you were constantly making things feel more native, and I had to do a hacky thing to speed up touch responses. With RN you actually use the native elements. RN is the real deal and I expect more and more companies to use it for new projects due to its significant advantages.

Re: React Native for Android

#107
post #76

Earlier quoted context omitted.

I believe Cordova apps being associated with a "bad user experience" is related to the amount of effort developers put into their Cordova app. I've seen some terrible Cordova apps. I've also seen a couple good ones. I've been developing a Cordova app using Ember.js and it works well in Cordova. There are a couple places in my app that need to be better optimized for Android, but overall, a non-discerning user would l…

> One trap that I've seen many apps do is to try to emulate the UI of native apps. This is one of the strengths of React Native. Don't emulate the native UI - use it, just access it via JavaScript.

I'm excited to try React Native for that reason alone. I love Ember.js, but developing good mobile applications with ember and Cordova (while possible) is not easy.

Re: React Native for Android

#108
post #61

Earlier quoted context omitted.

More accurately: with Cordova, you will always be behind on iOS.

Speaking as a web developer, this is sad, but true. However, what's even sadder to me is the fact this continues to be true despite the fact that, believe it or not, the web has been the platform where most of the innovation in UI development paradigms has been taking place in the past few years. And I don't just mean in terms of the sheer number of new things coming out. The web community pioneered UI development pa…

I don't believe it.

As someone with lots of native UI experience, that has to occasionally support web projects, the web is just plain clunky and playing catch up with the RAD tooling we enjoy since the mid-90 on native platforms.

Re: React Native for Android

#110

Anyone got the Android skeleton working? I'm getting a red page "unable to download JS bundle" despite having the dev server running. I'm using a 2013 Moto X on Android 5.1.

Make sure your phone can connect to your machine: check https://facebook.github.io/react-native/docs/running-on-devi...

Indeed, I had to input the local IP of my machine with "Debug server host for device". Thank you!

Then I got a NPE:

[21:36:12] request:/index.android.bundle?platform=android TypeError: Cannot read property 'root' of null at /Volumes/Devdisk/Perso/ErwanReact/node_modules/react-native/packager/react-packager/src/DependencyResolver/crawlers/index.js:16:84 at tryCallOne (/Volumes/Devdisk/Perso/ErwanReact/node_modules/react-native/node_modules/promise/lib/core.js:37:12) at /Volumes/Devdisk/Perso/ErwanReact/node_modules/react-native/node_modules/promise/lib/core.js:103:15 at flush (/Volumes/Devdisk/Perso/ErwanReact/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29) at doNTCallback0 (node.js:408:9) at process._tickCallback (node.js:337:13)

I was able to fix it by replacing this line:

https://github.com/facebook/react-native/blob/master/package...

By this:

    return fileWatcher.getWatchers().then(([watcher]) => !!(watcher.watchProjectInfo && watcher.watchProjectInfo.root));
Post reply on HN