0

Is there a way other than using apis like sphere online to compile c++ files and get the output in the form of a text to be outputted on Android TextView?

I googled it and I couldn't find anything related. If someone could give me links it would be of great help.

Vishal Yadav
  • 3,642
  • 3
  • 25
  • 42
user6731698
  • 67
  • 1
  • 8
  • My question is nothing related to NDK. I dont want to integrate c++ code to my project . I have a simple cpp file .. can i compile it and get the output using an android app. – user6731698 Dec 31 '17 at 19:05
  • Asking for an offsite resource is off topic for SO. – Richard Critten Dec 31 '17 at 19:09
  • Oh sorry. Totally misunderstood your question – Veneet Reddy Dec 31 '17 at 19:09
  • Just an idea: You could call g++ using exec and then run it. Should be possible via the Runtime class: https://developer.android.com/reference/java/lang/Runtime.html. Also refer: https://stackoverflow.com/a/5642593/5245903 – Veneet Reddy Dec 31 '17 at 19:22
  • Check out [CppDroid](https://play.google.com/store/apps/details?id=name.antonsmirnov.android.cppdroid), [Terminal IDE](https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside) or [C4Droid](https://play.google.com/store/apps/details?id=com.n0n3m4.droidc&hl=en), they may be suitable for what you want – AguThadeus Dec 31 '17 at 19:28
  • @VeneetReddy Thanks a lot for your inputs, I have a doubt the exec commands require root access in the android device on which it runs right? – user6731698 Dec 31 '17 at 19:32
  • @AguThadeus Yeah iam asking how to build such apps – user6731698 Dec 31 '17 at 19:32
  • I don't think you need root access unless you need to run a command as su – Veneet Reddy Dec 31 '17 at 19:34

0 Answers0