Google Android - The Android Log
Linux Devices - So, what Is Android?
November 16th, 2007 by Head Robot
John Lombardo gives a thorough overview of Google’s Android SDK at Linux Devices,
Android is a complete software stack for mobile devices such as cell phones, PDAs and high end MP3 players. The software stack is split into four layers:
- The application layer
- The application framework
- The libraries and runtime
- The kernel
Cell phone users obviously work with applications in the application layer. Android developers write those applications using the application framework. Unlike many embedded operating environments, Android applications are all equal — that is, the applications that come with the phone are no different than those that any developer writes. In fact, using the IntentFilter API, any application can handle any event that the user or system can generate. This sounds a bit scary at first, but Android has a well thought-out security model based on Unix file system permissions that assure applications have only those abilities that cell phone owner gave them at install time. The framework is supported by numerous open source libraries such as openssl, sqlite and libc. It is also supported by the Android core libraries — more on that in a second. At the bottom of the stack sits the Linux 2.6 kernel, providing the low level hardware interfaces that we all expect from a kernel. This is a Unix based system — that is, the Unix C APIs are available — but don’t expect to drop to a shell and start executing shell scripts with your old friends grep and awk. Most of the Unix utilities are simply not there. Instead Android supplies a well thought out API for writing applications — in Java using the Android core libraries.
That’s right, Android applications are almost exclusively written in Java. The Android core library is a big .jar file that is supported by the Dalvik Virtual Machine — a fast and efficient JVM work-alike that enables java-coded applications to work on the Android cell phone. This is similar to, but not the same as using Sun’s JVM directly.
Read the rest of the article, A Developer’s Perspective on Google’s Android SDK
Digg the original article by clicking here
Technorati Tags: Developer, Android SDK, Linux, Kernel, API, Dalvik, JVM, Java
Graphical Native C Programs on Android
November 14th, 2007 by Head RobotQtopia, Maemo or OpenMoko run on Android?
Update: Keep in mind that this is totally against the reason for Android’s existence as a cross-vendor development environment.
gaz was one of many to respond to the thread on writing C/C++ Android Apps…
“You know guys that doing this will prevent your application in being an Android application, yes?
If you tie up your app to a certain CPU, it mean that XYZ manufacturer producing an Android device with a MIPS CPU (or whatever other CPU) will not be able to run your app.
If you want to be really Android (and not Android/ARM) compatible, you better stick with Java and let the JIT to do its own job.”
TomCooksey wrote in the Android Developer’s Google Group today;
I’ve just realized there’s a standard Linux framebuffer device: /dev/
graphics/fb0. You can write to it in the usual way. This means that
phones supporting the Android platform may be able to run other GUI
phone stacks such as Qtopia, Maemo or OpenMoko - Should anyone feel
the need!![]()
Here’s a quick program to demonstrate this by flashing the screen
every second (I know, ultra-high tech stuff this!). If you want to try
it out, you’ll need to get yourself a cross compiler, compile the
following program, copy it to the android emulator & run it (Search
this group for instructions). For some reason it can take a while
before the screen starts flashing… dunno why. :-pNote: This is _not_ using the Android surface manager - that’s going
to take a lot more work (my hat goes off to the first person to do
it!)
———————————————————-
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#define PIXEL_COUNT (320*240)
unsigned short* fb = NULL;
int main(int argc, char** argv)
{
int fb_fd;
do {
fb_fd = open("/dev/graphics/fb0", O_RDWR);
if (fb_fd == -1)
{
printf("Error opening framebuffer: %s\n", strerror(errno));
break;
}
fb = (unsigned short*) mmap(0, PIXEL_COUNT*sizeof(unsigned
short), PROT_WRITE, MAP_SHARED, fb_fd, 0);
if (fb == MAP_FAILED)
{
printf("Error mmap'ing the framebuffer: %s\n",
strerror(errno));
break;
}
do {
memset(fb, 0, PIXEL_COUNT*sizeof(unsigned short));
sleep(1);
memset(fb, 0xFF, PIXEL_COUNT*sizeof(unsigned short));
sleep(1);
} while (1);
} while (0);
return 0;
}
Technorati Tags: Qtopia, Maemo, OpenMoko, Android, Google, gPhone, C, Linux, Kernel








