r/reactnative • • Jan 31 '20

Released my first react-native app!

319 Upvotes

35 comments sorted by

View all comments

10

u/TheLartians Jan 31 '20 edited Feb 01 '20

Hey everyone,

After working for almost two years developing an interactive algebra practice App in pure C++ and OpenGL I’ve decided to add react-native to our toolset and am incredibly happy with that decision. Finally we can access the huge ecosystem of react projects instead of re-inventing the wheel for every new feature we introduce.

Maphi allows students to practice working with mathematical expressions and find their own solutions with simple drag and drop gestures. We are also planning on adding more advanced topics like derivatives in the future.

Anything algebra or expression-rendering related is still in C++ and OpenGL. Bridging the C++ code to react-native on iOS was a charm as we could define the full native interface in Objective-C++, a language that allows mixing C++ and Objective C code. Android is a bit more complex, as we first need to bridge the C++ code to Java and then from Java to react-native. We are expecting to release the new Android version next month.

Some tech used:

  • RN v0.60

  • C++ / OpenGL ES

  • TypeScript

  • react-navigation

  • react-redux

  • redux-persist

  • react-i18next

  • react-native-sound

  • react-native-haptic-feedback

  • react-native-svg

  • react-native-iap

App Store: https://apps.apple.com/us/app/maphi-the-math-app/id1276181580

Feel free to ask me anything development or app related. I would also love to hear your Feedback on the product!

edit: wow my first gold! thanks!

1

u/[deleted] Feb 01 '20

What were the limitations on making it available on Android?

2

u/TheLartians Feb 01 '20

Good question. Compared to iOS Android has some unexpected limitations when working with native code, such as no way to get a regular file handle to resources (as they all remain bundled in the APK) and no convenient interface for C++ to the OS's methods like iOS has. Also we need to pay attention to the react-native libraries we choose to ensure they work similarly on both platforms.

Fortunately that's all manageable and worth it as in the end both platforms share almost all of the codebase, which allows us to keep maintaining and updating the project easily.

1

u/Karthik_B_06 Feb 03 '20

Great work on the app. One question I have is how did you implement the Drag and Drop?

3

u/TheLartians Feb 03 '20

Thanks! The drag and drop is completely implemented in C++ using a bunch of linear algebra to transform coordinates between nodes in the expression tree. When a gesture is detected our computer algebra system finds and applies a valid mathematical transformation.