Android Open Handset Developers Community

 
Guest Announcements

:arrow: Welcome: you are not yet registered; you can register here.
:arrow: A new forum on the new HTC Magic is available here.

It is currently Thu Jul 29, 2010 6:09 pm

All times are UTC


 Topics   Replies   Views   Last post 
No new posts For Sale Brand New Apple Tablet iPad 64GB (Wi-Fi + 3G) .$28

by NEVERSAYNEVER on Wed Jul 28, 2010 2:06 pm in News & Announcements

0

5

Wed Jul 28, 2010 2:06 pm

NEVERSAYNEVER

No new posts For Sale Brand New HTC HD2--$280 and Nokia X3@220usd

by NEVERSAYNEVER on Wed Jul 28, 2010 2:05 pm in Users' introductions

0

3

Wed Jul 28, 2010 2:05 pm

NEVERSAYNEVER

No new posts For sale Apple iPhone 4G 32GB $300/3GS 32GB/IPad 64GB $600

by hyperb1 on Wed Jul 28, 2010 10:34 am in News & Announcements

0

4

Wed Jul 28, 2010 10:34 am

hyperb1

No new posts For sell new Nokia n8 $210,Apple iPhone 4G 64gb-$200

by alwaysonline on Tue Jul 27, 2010 12:59 pm in Users' introductions

0

6

Tue Jul 27, 2010 12:59 pm

alwaysonline

No new posts Whosales Cheap Online Brand HTC HD2$280

by SKYPECHART on Sun Jul 25, 2010 12:17 pm in Relaxing Lounge

0

9

Sun Jul 25, 2010 12:17 pm

SKYPECHART




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Android application in C ? YES!
PostPosted: Mon Dec 31, 2007 4:20 pm 
Offline

Joined: Thu Dec 27, 2007 6:09 pm
Posts: 65
Hi all,
for hacker guys it seems to be possible to use C for developing ANDROID applications :mrgreen:

***URLs are hidden from guests, please register and login to view the hyperlink***
Quote:
1) Create your hello world program:

#include

int main(int argc, char** argv) {
printf(”hello world\n”);
return 0;

}

2) Compile with an arm cross-compiler toolchain. I used a toolchain I
built with gentoo’s crossdev tool, but there are lots out there.
Assuming your c file is hi.c and your cross compiler is called armv6-
vfp-linux-gnueabi-gcc, you can compile using:

armv6-vfp-linux-gnueabi-gcc hi.c -o hi -static

Note the -static. I’ve not figured out the version of libc etc or the
ABI used yet, so for now, link applications statically.

3) Copy to a running emulator:
adb push hi /system/sbin/hi

4) Run it! From the emulator console:
cd /system/sbin
./hi

5) Smile as you see “hello world” printed on the console.


Top
 Profile  
 
 Post subject: Re: Android application in C ? YES!
PostPosted: Mon Jan 07, 2008 11:24 am 
Offline

Joined: Thu Dec 27, 2007 2:12 pm
Posts: 36
IMHO, this is a key issue: C applications linked to the OS's low level layer can run much faster than Java ones, I really hope that it will be possible to develop applications in C by exploiting a cross compiler for ARM/Linux :mrgreen:


Top
 Profile  
 
 Post subject: Re: Android application in C ? YES!
PostPosted: Mon Jan 07, 2008 11:33 am 
Offline

Joined: Thu Dec 27, 2007 2:51 pm
Posts: 41
In any case, it should be mentioned that Google has developed a new Java virtual machine (named “Dalvik Virtual Machine”) that it is expected to be a very efficient environment for applications based on Android.

Of course, at the moment it is not possible to assess how much it is optimized by using the emulator...


Top
 Profile  
 
 Post subject: Re: Android application in C ? YES!
PostPosted: Mon Jan 07, 2008 11:39 am 
Offline

Joined: Thu Dec 27, 2007 6:09 pm
Posts: 65
Running portable bytecode in a sandbox has a key advantage: it is useful to avoid buffer overflows and other bugs which can freeze the device (and we have to remember that we are talking about mobile phones, that should work properly everytime..).

barban


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

Topic Tags

Android, applications, ARM, bytecode, compiler, Dalvik, emulator, Google, Java, sandbox


All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
phpBB SEO

This site is not affiliated with nor endorsed by the Open Handset Alliance.
All trademarks and logos used in this site are of properties of their respective owners.