Guidelines to create and consume native-code library


I’m planning to create a Software with two clients: desktop and mobile. My plan is to create a native library in C++ where I will place all the code shared between both clients, for the Desktop app I understand all the requirements needed to take into account while writing the library, but I do not have much experience with {N} so I do not know:

  • Which considerations should I have into account to write the library?
  • How the library is consumed by {N} app? (This could be very important in the way I write the library).
  • Any limitations in calling C++ code from {N}?

I will appreciate your help.


hi, are you obliged to use C++ code?

There is an easier way to share code between desktop, web, and mobile apps, using Angular, NativeScript and Electron: Nathan Walker’s advanced seed: I used it to create and will soon deploy PracticeBuddy using the same seed. It might make your work a bit easier, perhaps take a look!



@jen.looper I’m not forced to write C++ but I’m thinking I could reuse that library in many other devices/scenarios, I like C++ and have experience, so it’s not a big deal to me.

I do not know much about Electron but I’ve read a lot about the performance issues it has because it uses chromium to handle the interpretation process of HTML+CSS+JS, so you can see many instances of your app (chromium) consuming more machine’s resources (RAM, CPU) than the real needs of your app, just the same way Chrome does.

Because of that things I prefer to follow that famous quote “The right tool for the right job”, and in the case of a Desktop App written in C++, well, by that way I can handle very well the machine’s resources usage within my app.


@nathanaela do you have some pointers here?