Discussion:
UI in C++
j***@gmail.com
2008-09-24 08:59:38 UTC
Permalink
Hello,

I know that C++ is not supported, but Java is not an option for me.
I know that one can write compile and run hello world in C++.

But have you tried to use any system stuff from C++? like some UI?
Could you give me some hints?
David Given
2008-09-24 16:56:20 UTC
Permalink
***@gmail.com wrote:
[...]
Post by j***@gmail.com
But have you tried to use any system stuff from C++? like some UI?
Could you give me some hints?
The short answer is that it's slightly possible but you can't actually
do anything useful, so it's not worth doing.

The long answer is that there is no C SDK, and all the C-based stuff
people have done is based on reverse-engineering what's there. This is
buggy and unreliable. And there are no C APIs to give you access to any
system services. And as apps can't provision C code, you can't deploy
anything you build anyway. So it's only really interesting as a stunt.

If you *still* want to have a go, go look in the mailing list archives;
there's lots of stuff there.
--
David Given
***@cowlark.com
j***@gmail.com
2008-09-25 09:25:32 UTC
Permalink
Post by David Given
The long answer is that there is no C SDK, and all the C-based stuff
people have done is based on reverse-engineering what's there.
I just wonder how could I use android libs without header files.
Reverse engineering is fun, and great thing is that other people
already did some work on it.
Post by David Given
And as apps can't provision C code, you can't deploy
anything you build anyway.
Yes, I read that only Java apps can be provisioned, so how exactly
people run their C programs on Android? Is it possible only in
emulator but not on real hardware?
Post by David Given
If you *still* want to have a go, go look in the mailing list archives;
there's lots of stuff there.
Thanks, I am digging but found only hello worlds (and shared/static
libraries), nothing about system stuff yet.
David Given
2008-09-25 10:08:55 UTC
Permalink
***@gmail.com wrote:
[...]
Post by j***@gmail.com
Post by David Given
And as apps can't provision C code, you can't deploy
anything you build anyway.
Yes, I read that only Java apps can be provisioned, so how exactly
people run their C programs on Android? Is it possible only in
emulator but not on real hardware?
You can use adb to push files anywhere onto the device. (Although I
believe that may have changed; when I did all this it was with m5.)

[...]
Post by j***@gmail.com
Thanks, I am digging but found only hello worlds (and shared/static
libraries), nothing about system stuff yet.
Ah. That's all there is...

AFAICT, practically everything in Android is either (a) written in Java,
or (b) a thin layer, called from Java via JNI. This means that there are
only a small handful of actual binaries, the biggest of which is the VM
itself, which contains nearly all the code (via shared libraries).

So you can build and run a static executable; but it can't talk to any
Android services, because the Android services all live in the VM.

The other approach is to build a JNI .so, and I've had a certain amount
of success in the past, but this is buggy (again, possibly fixed since
m5) and you still have to kinda guess at how the libraries work. For
example, the libc is custom and headers aren't available, which makes
stuff like, e.g., figuring out how to get errno really hard.
--
David Given
***@cowlark.com
j***@gmail.com
2008-09-25 14:05:55 UTC
Permalink
Post by David Given
The other approach is to build a JNI .so, and I've had a certain amount
of success in the past, but this is buggy (again, possibly fixed since
m5) and you still have to kinda guess at how the libraries work. For
example, the libc is custom and headers aren't available, which makes
stuff like, e.g., figuring out how to get errno really hard.
Why aren't sources available?
Isn't Android open source at all?
David Given
2008-09-25 14:50:32 UTC
Permalink
***@gmail.com wrote:
[...]
Post by j***@gmail.com
Why aren't sources available?
Because it's not finished.

They've stated that they'll release the sources when the phone goes on sale.

(I'd suggest reading through the archives; we've been through this *so*
many times...)
--
David Given
***@cowlark.com
j***@gmail.com
2008-09-25 15:07:05 UTC
Permalink
Post by David Given
(I'd suggest reading through the archives; we've been through this *so*
many times...)
I am reading archives of google groups and anddev.org but really can't
find much stuff.
Is the Linux kernel only part of system which is GPL? If not -
shouldn't they give sources immediately after first release of
binaries?
David Given
2008-09-25 17:11:38 UTC
Permalink
***@gmail.com wrote:
[...]
Post by j***@gmail.com
I am reading archives of google groups and anddev.org but really can't
find much stuff.
Is the Linux kernel only part of system which is GPL? If not -
shouldn't they give sources immediately after first release of
binaries?
Yes. They did. You can get the kernel source off the Google Code site.

The rest of it is Apache licensed, I believe, or at least will be when
it's done.
--
David Given
***@cowlark.com
R. Spada
2008-10-24 19:00:52 UTC
Permalink
Post by David Given
[...]
The rest of it is Apache licensed, I believe, or at least will be when
it's done.
Hi all, now all the source it's released, finally. I think that now
it's possible to start a serious effort to bind C/C++ to the internals
of the system with a full featured SDK. Is anyone working on it yet?

Ralph

Loading...