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 Mon Feb 06, 2012 5:58 pm

All times are UTC


 Topics   Replies   Views   Last post 
No new posts Rip Blu-ray video to Blackberry Playbook

by alex6699 on Fri Nov 26, 2010 2:56 am in Relaxing Lounge

0

213

Fri Nov 26, 2010 2:56 am

alex6699

No new posts Porting a JME and JSE application to Android SDK

by kalgik on Fri Nov 19, 2010 10:01 am in Advanced level ANDROID developing issues

0

198

Fri Nov 19, 2010 10:01 am

kalgik

No new posts A calls Blocker Software for Windows Mobile

by tingelsky on Tue Nov 16, 2010 7:08 am in Relaxing Lounge

0

137

Tue Nov 16, 2010 7:08 am

tingelsky

No new posts Table view for android

by mindus on Thu Sep 23, 2010 4:16 am in Advanced level ANDROID developing issues

0

120

Thu Sep 23, 2010 4:16 am

mindus

No new posts Create a pdf file dynamically

by mindus on Wed Sep 22, 2010 10:29 am in Advanced level ANDROID developing issues

1

106

Wed Sep 22, 2010 10:29 am

mindus




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.