• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps c code has to execute in android application

is my thought is good?

  • excellent

    Votes: 0 0.0%
  • good

    Votes: 0 0.0%
  • not bad

    Votes: 0 0.0%

  • Total voters
    1
  • Poll closed .
hello every one i am very happy to here to clarify my doubt, i have a thought that i want to develop a android application named letC ,the main moto of the app is the user has to write c code and has to execute with in the application
is it possible? if possible tell me how to implement it?
 
You write a C compiler in Java that compiles into some kind of byte code. You implement the C standard library in the same byte code. You write a virtual machine in Java that executes that byte code.

Otherwise try looking into if you can hook into clang/llvm.

Otherwise you upload the C code to a web server which compiles the app and sends back a binary which you can execute on the Android device.
 
PicoC is a lightweight C interpreter released under BSD licence, written in C. You could weld it to a Java front end using the android NDK.
 
PicoC is a lightweight C interpreter released under BSD licence, written in C. You could weld it to a Java front end using the android NDK.


If he is asking how to do it, then he isn't capable of undertaking the task. Writing a C compiler is an extremely tedious and challenging endeavour. Even if he goes the route of hooking a open source compiler to java, the JNI isn't exactly the easiest thing to work with.
 
Well, the OP hasn't been in since three minutes after that post. He's probably too busy mired in accidental booleans or something. But I admire his coming here for advice on that idea.
 
Interesting poll results anyway. I'm quite intrigued to know what the idea behind the idea was, i.e. an app for teaching 'C' maybe?
 
Wow, the second one seems quite popular and gets good reviews. I can't imagine wanting to code on my phone personally but as an educational app it seems to have found a nice niche.
 
Back
Top Bottom