So now I have a “training” task: to implement an engineering calculator in C ++



I can do in the form of the class " calc " which

  1. accepts std::string
  2. handles exceptions (without throwing them out) that can be obtained via get_error(); (optional)
  3. parses the string itself into the tree and counts it

and accordingly I can make a wrapper-interface in C++ Builder

wrapper will do:

  1. form the string std::string or std::char*
  2. pass string to " calc "
  3. asking " calc " are there any errors?
  4. take from " calc " the object " error " in which is stored: error text + position_in_string
  5. get the result of the decision


I want to know:

  1. How much hemorrhoids will the creation of a wrapper interface in android::java and screwing my class " calc "?
  2. Will hemorrhagic addiction to hardware ?
  3. underwater rocks ?

ps I have a choice, therefore I ask

  • write all this in С++ (now and with high quality)

  • or on java (in a year when I’m taking java , and now jot down a bicycle, purely for evaluation ...)

  • I would personally choose option 1 - write it completely in C ++. Fortunately, this android sdk allows. - gecube
  • one
    and I would be on Java =) there about an hour of work - Gorets
  • I still do not understand the essence of the question (probably stupid) - people want to write a calculator for Android or what? - Barmaley
  • @Barmaley I'm interested in how much hemorrhoids use C ++ in the android, and the calculator is a description of the problem - ProkletyiPirat
  • As far as I know, Android is not friendly with C ++ Builder (I could be wrong). Recommended Eclipse environment (in case of Windows with CygWin> 1.7). View Android NDK manuals - Barmaley


2 answers 2

If you write everything in Java, it will be much easier and faster, but it is quite possible (and not very difficult) to compile the code written in C ++ on Android using Android NDK. Here is a good tutorial .

If you use Android NDK, then you’ll have to deal with Java and Android SDK, but there is a way to write an application in C ++ without using Java, here is the link .

    How much hemorrhoids will the creation of a wrapper interface in android :: java and screwing my class "calc"?

    If you know how to do it, it’s not very difficult.

    Will hemorrhagic addiction to hardware?

    of course. Under each platform, you will need to build a separate so. Although in your case everything is limited to just adding a couple of lines to android.mk

    underwater rocks ? for example - debugging.

    or on java (in a year when I’m taking java, and now jot down a bicycle, purely for evaluation ...)

    In this case, Zhava is not so complicated. If the classes are written beautifully, then it will be easy to sport (pick up the destructors, replace std :: string with String).

    But it is not known what size there is a calculator. Maybe there with such calculations ...

    PS Java will still have to learn - to write an interlayer.

    • That's about the calculations, yes ... it is planned to add +100500 functions (well, as always ... :))) if specifically the idea: to write a full-blown expandable calculator with a couple of highlights that will go into the portfolio and will be a graduation project ... in complexity Calculations should at least consider "(16 ^ 23) * mod (33)" and something like [this] [1] [1]: lib3.podelise.ru/tw_files2/urls_12/14/d-13654/7z- docs / ... - ProkletyiPirat
    • then start by writing to Java, at least with minimal functions. And there will be seen. - KoVadim