Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

View Poll Results: is my thought is good?
excellent 0 0%
very good 1 100.00%
good 0 0%
not bad 0 0%
Voters: 1. You may not vote on this poll

test: Reply
 
LinkBack Thread Tools
Old February 7th, 2012, 06:36 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Feb 2012
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default c code has to execute in android application

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?

sankar00002009 is offline  
Reply With Quote
Sponsors
Old February 7th, 2012, 02:58 PM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,938
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 468 Times in 290 Posts
Default

Simply, no.
jonbonazza is online now  
Reply With Quote
Old February 7th, 2012, 03:05 PM   #3 (permalink)
Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 191
 
Device(s): Galaxy Nexus GSM
Carrier: Not Provided

Thanks: 2
Thanked 37 Times in 33 Posts
Default

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.
jiminaus is offline  
Reply With Quote
Old February 8th, 2012, 05:13 PM   #4 (permalink)
Member
 
Snedd's Avatar
 
Join Date: Oct 2010
Location: UK
Posts: 172
 
Device(s): Nexus S, Disgo Tablet
Carrier: Not Provided

Thanks: 17
Thanked 46 Times in 37 Posts
Default

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.
Snedd is offline  
Last edited by Snedd; February 8th, 2012 at 05:15 PM.
Reply With Quote
Old February 9th, 2012, 02:17 PM   #5 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,938
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 468 Times in 290 Posts
Default

Quote:
Originally Posted by Snedd View Post
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.
jonbonazza is online now  
Reply With Quote
Old February 9th, 2012, 02:23 PM   #6 (permalink)
=Luceat Lux Vestra=
 
Frisco's Avatar
 
Join Date: Jan 2010
Gender: Male
Posts: 21,580
 
Device(s): Galaxy Note 2, Galaxy Tab 2 Wifi
Carrier: Verizon

Thanks: 6,791
Thanked 8,374 Times in 4,741 Posts
Default

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.
Frisco is offline  
Reply With Quote
Old February 9th, 2012, 05:46 PM   #7 (permalink)
Member
 
Snedd's Avatar
 
Join Date: Oct 2010
Location: UK
Posts: 172
 
Device(s): Nexus S, Disgo Tablet
Carrier: Not Provided

Thanks: 17
Thanked 46 Times in 37 Posts
Default

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?
Snedd is offline  
Reply With Quote
Old February 10th, 2012, 10:02 PM   #8 (permalink)
Over Macho Grande?
 
alostpacket's Avatar
 
Join Date: Nov 2009
Location: NY
Posts: 7,306
 
Device(s): GalaxyNexus, Nexus1, Droid1, Eris, GalaxyTab10.1, Revue, Nexus7
Carrier: VZW...$$

Thanks: 4,204
Thanked 3,338 Times in 1,363 Posts
Default

I think he's having a bit of trouble communicating something like this:

touchqode - mobile code editor

but maybe adding a compiler?

something like this?

https://market.android.com/details?id=com.n0n3m4.droidc&hl=en


No idea if these work or are any good
alostpacket is offline  
Reply With Quote
The Following User Says Thank You to alostpacket For This Useful Post:
Snedd (February 11th, 2012)
Old February 11th, 2012, 02:41 AM   #9 (permalink)
Member
 
Snedd's Avatar
 
Join Date: Oct 2010
Location: UK
Posts: 172
 
Device(s): Nexus S, Disgo Tablet
Carrier: Not Provided

Thanks: 17
Thanked 46 Times in 37 Posts
Default

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.
Snedd is offline  
Reply With Quote
Reply
Tags
android c code, c code in android


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:16 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.