Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



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

Reply
 
LinkBack Thread Tools
Old February 7th, 2012, 06:36 AM   #1 (permalink)
New Member
 
Join Date: Feb 2012
Posts: 1
 
Device(s):
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
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 Posts
Default

Simply, no.
jonbonazza is online now  
Reply With Quote
Old February 7th, 2012, 03:05 PM   #3 (permalink)
Premium Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 193
 
Device(s): Galaxy Nexus GSM
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
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
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 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)
..............
 
Join Date: Jan 2010
Posts: 19,238
 
Device(s):
Thanks: 5,967
Thanked 6,723 Times in 3,979 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
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,090
 
Device(s): GalaxyNexus(LTE), NexusOne, OG Droid, GalaxyTab 10.1(LTE), Eris, Logitech Revue (fishtank)
Thanks: 4,164
Thanked 3,126 Times in 1,292 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
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

Bookmarks

Tags
android c code, c code in android


Go Back   Android Forums > Android Development > Application Development User CP
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 12:15 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo