Commit Graph

424 Commits

Author SHA1 Message Date
David 'Digit' Turner
9ddaf219fa Add missing declarations to <netinet/in.h>
These are required to properly build the Boost libraries with the
Android NDK.

Change-Id: Ice272f24b359ffce19838f5500641c4fcda8e57f
2010-12-14 14:42:52 +01:00
David 'Digit' Turner
90887627f1 ndk: Update headers and libraries for API level 9
Change-Id: I39eded0065145803b51b22cdc18abef43abe426c
2010-12-10 17:16:24 +01:00
David 'Digit' Turner
1e7011fcd5 ndk: Add auto-generated <android/api-level.h>
See ndk.git/build/tools/dev-generate-api-levels.sh

Change-Id: Id64e565e7da6bf23f4bfa0fca52a06dbfe843c37
2010-11-22 22:38:57 +01:00
Glenn Kasten
809ec924d2 Native audio example
Change-Id: Ia48597d3e94d178ec95a396c545e4a95de7c88f8
2010-11-05 17:38:11 -07:00
David 'Digit' Turner
186ce6d543 Merge "NDK: Last cleanup of the platform headers" into gingerbread 2010-11-04 04:09:48 -07:00
David 'Digit' Turner
3c7c38b2bb NDK: Last cleanup of the platform headers
- fix a declaration omission in 3/<grp.h>
- add missing 8/<err.h>
- simplify 8/<stdio.h>
- update 9/ headers to the latest Bionic versions
- fix a typo in android_native_app_glue.h
- use __BEGIN_DECLS .. __END_DECLS whenever possible.
- remove C++-style comments from headers

Change-Id: I58b98b3973cde494436206194ba33416a11ca8ee
2010-11-04 04:07:16 -07:00
David 'Digit' Turner
cc5809bf2f Merge "ndk: Use __ANDROID__ instead of ANDROID." into gingerbread 2010-11-04 04:06:31 -07:00
David Turner
fc187b1e3a Merge "update native_window.h ndk header" into gingerbread 2010-11-02 01:49:47 -07:00
Mathias Agopian
3323f5912c update native_window.h ndk header
Change-Id: I70178a1ddd94279a102c2d25d2ce0459cec9d13a
2010-11-01 14:30:30 -07:00
David 'Digit' Turner
a99a3ff2b2 ndk: Use __ANDROID__ instead of ANDROID.
The platform headers use the ANDROID macro as a platform test.
This macro is set by the NDK build script explicitely, but it
is better to use __ANDROID__, which is also set by our toolchain
as a compiler prebuilt macro.

This allows usage of these headers with our standalone toolchain.

Change-Id: I431c54e29e502bb9da7a52ef7a58a6341211b4db
2010-10-30 20:41:23 -07:00
David 'Digit' Turner
10795d840b Declare localeconv() in <locale.h>
The function is not implemented by our C library, but it is not
possible to build GNU libstdc++-v3 if the declaration is not part
of this header.

Change-Id: Iff6fa63465dde0d4e38c0f91709475bb35b31af9
2010-10-28 17:39:11 -07:00
Mathias Agopian
793509c983 Greatly simplify sample code by using EGL_NATIVE_VISUAL_ID.
This is the preferred way of selecting config starting in
gingerbread, this procedure guarantees forward compatibility.

Change-Id: Iff55b545e722205bd029b92da33368129253b8a3
2010-10-25 18:03:55 -07:00
Mathias Agopian
f0c011224a simplify a bit the native-activity sample code
there is no reason to set a depth buffer. this is somewhat confusing.
also, it's better to always specify EGL_SURFACE_TYPE.

Change-Id: Ieff499b0b69a3812773cf3fe08b8bf1ca57a82d9
2010-10-25 17:59:06 -07:00
Dianne Hackborn
a77c1bdd4a Work on issue #3126018: No way to specify NativeActivity's native method
Update the header file to match the platform change.

Also add an Android.mk so I can actually build this sample when I want to.

Change-Id: I30c3c43fba7c233c59005d916888a46dc7049651
2010-10-25 17:01:49 -07:00
Dianne Hackborn
c2d70d2a98 Update native headers/library to match current platform.
Change-Id: I40ef2fa924881b9653fcddcd09c14455ac1ef37e
2010-10-21 21:09:47 -07:00
Dianne Hackborn
834eb602eb Fix bug in native activity demo.
Can't get surface size until after it is made current.

Change-Id: I34847775bde680d05767b6b4cfa8e547eb56aa6d
2010-10-19 18:36:53 -07:00
Xavier Ducrohet
0574dc4cfd Dummy java file in native-only apps is not needed anymore.
The tools r8 ant script can handle not having any Java file
at all.

Change-Id: Id14a4a434deb188a5aa1580378fcd1a6445b6e83
2010-10-13 15:34:37 -07:00
David 'Digit' Turner
2e9b39e457 Merge "ndk: Add missing OpenSLES headers and libraries." into gingerbread 2010-10-12 10:31:53 -07:00
David 'Digit' Turner
51bcfb7110 ndk: Add missing OpenSLES headers and libraries.
Change-Id: I5444f8701a2b8ad8e99fffc6906bad1bf101530f
2010-10-12 18:29:00 +02:00
David 'Digit' Turner
3c72deb3f4 Merge "ndk: remove undefined symbols from system headers" into gingerbread 2010-10-11 06:02:15 -07:00
Jeff Brown
028c403286 Merge "Update NDK with recent changes." into gingerbread 2010-10-08 12:45:05 -07:00
David 'Digit' Turner
7c2ba504e9 ndk: remove undefined symbols from system headers
This change removes the declaration of functions that are not
implemented by our various versions of our C library.

The corresponding declarations are moved inside #if 0 .. #endif
blocks (so it becomes easy to remember that they are missing)

Also refresh the headers a little (i.e. adding a few missing decl
and macros, remove C++ comments, etc)

See http://code.google.com/p/android/issues/detail?id=7807

Change-Id: I4ae1b1f3a181419eee2004c41b54768cc15e896f
NOTE: The missing decl are still there but encased in #if 0 .. #endif
      blocks (to make it easier to implement them later). There are
      a few exceptions in order to build STLport and libstdc++-v3
      properly.
2010-10-08 17:07:39 +02:00
Jeff Brown
3ec1cec3b7 Update NDK with recent changes.
Includes bitmap.h which was missing from v9 but was previously in v8.
Also includes new obb stuff and other things that have gotten out of sync.

Change-Id: I6cf9ccdbc9d3271a34a1cf8a1de78aa8a1757276
2010-10-07 14:38:12 -07:00
David 'Digit' Turner
7c5623becb ndk: Update platform system libraries.
This change updates various system libraries to reflect changes that
happened during distinct platform releases. All details are in the
file bionic/libc/docs/CHANGES.TXT, but the summary is:

API level 5:
    pthread.h:
        pthread_mutex_lock_timeout_np()
        pthread_cond_timedwait_monotonic_np()
        pthread_cond_timedwait_relative_np()

API level 8:
    pthread.h:
        pthread_condattr_init()
        pthread_condattr_destroy()
        pthread_condattr_setpshared()
        pthread_condattr_getpshared()

    dlfcn.h:
        dladdr()

    sched.h:
        clone()

    signal.h:
        killpg()

    stdio.h:
        fdprintf()
        vfdprintf()

    unistd.h:
        getusershell()
        setusershell()
        endusershell()

    wchar.h:
        mbstowcs()
        wcstombs()

    time.h:
        timezone
        daylight

    plus symbols from new headers: <fts.h>, <regex.h>, <err.h>, <warn.h>

Change-Id: I7ff1ffa2cb37b71473b1d137c7799f17d644ab63
2010-10-07 11:17:39 +02:00
David 'Digit' Turner
be57246603 Merge "Update prebuilt library test." into gingerbread 2010-09-24 01:12:54 -07:00
David 'Digit' Turner
7012117d4a Unify NDK platform headers.
This commit removes duplication of system headers per platform, i.e. remove
copies of common headers like <stdlib.h> from arch-arm/usr/include and arch-x86/usr/include
and move them to a common include directory. More specifically:

- common headers:        android-N/arch-A/usr/include --> android-N/include
- arch-specific headers: android-N/arch-A/usr-include --> android-N/arch-A/include
- arch-specific libs:    android-N/arch-A/usr/lib     --> android-N/arch-A/lib

Change-Id: Ifdba5038d108901931f3e3a7c14ebe6270d2d276

NOTE: This also contains careful separation of API-level-specific headers.
      For example, platforms/android-5/include/pthread.h contains new function
      declarations that are not available when using platforms/android-3/include/pthread.h

NOTE: The NDK's build-platforms.sh script has been updated to understand the new
      layout. This change in develeopment/ndk does not change the layout of
      platform files under $NDK/platforms after build-platforms.sh is called.
2010-09-22 18:04:36 +02:00
David 'Digit' Turner
2068cc393b Update prebuilt library test.
This is to reflect the simplification in prebuilt support.
1/ LOCAL_SRC_FILES is relative to LOCAL_PATH, like with other module types
2/ no need for LOCAL_PREBUILTS

Change-Id: If7302fe355cb25a446e31c20015098db75c00c02
2010-09-22 15:11:57 +02:00
Jeff Brown
9f44e97108 Update NDK headers and samples to sync up with looper API changes.
Change-Id: I7082603bf280888be90dc4df687521aaae9b1d02
2010-09-14 02:02:15 -07:00
Dianne Hackborn
d3d58cf7d3 Update to follow ALooper ident change.
Also the native-activity sample also has some very simple code showing
how to listen to the accelerometer.

Change-Id: I0629b8bc40cddd66233c1675cd5e8b42a9b722d8
2010-09-07 15:47:35 -07:00
Dianne Hackborn
79b946e8f2 Some native activity sample code cleanup.
Update to include newest headers and library, tweak glue code to
work better with state saving and add support for config changes.

Change-Id: I4d27bd4a0f542f217efaec86cf4f219aca020426
2010-08-11 00:31:37 -07:00
David 'Digit' Turner
f4790e6f9e Separate platform files and samples by API level.
Remove all duplicate platform files, i.e development/ndk/platforms/android-N now
only contains files that are introduced in API level 'N' and not found in level 'N-1'

(This makes it easier to manage independent platform release branches, and makes
 platform additions trivial to examine and maintain).

Move samples that depends on features of API level 'N' into platforms/android-N/samples

+ update tests/run-all.sh accordingly

Change-Id: I04c4c67c6c674c1714d5812d461d0524a4f4cfd9
2010-07-29 18:07:56 -07:00
David 'Digit' Turner
ad77ed7d47 ndk: fix samples compilation
Change-Id: I3e0f88f823c891cea5ca3f82f7c3a6284295425c
2010-07-17 09:00:01 -07:00
David 'Digit' Turner
6d0ef0df98 ndk: handle --verbose option in tests/run-all.sh script
Change-Id: Ib99020a8b5c76c34bcbf8244426221bb3b6d2663
2010-07-16 14:31:30 -07:00
Dianne Hackborn
e551875b2d Update NDK for pre-key-dispatching changes.
The same code now calls the appropriate function as part of
its key processing.

Change-Id: Ie6fbcd802b098b85d8113fe0a49473134721009b
2010-07-15 22:21:04 -07:00
David 'Digit' Turner
3d81d6a2eb Merge "ndk: add tests/run-all.sh to run all automated tests." into gingerbread 2010-07-15 16:30:12 -07:00
David 'Digit' Turner
d74329cef6 ndk: add tests/run-all.sh to run all automated tests.
For now, this only tries to rebuild all samples from scratch

Change-Id: I0d059b72b68d5abcfb462b897813dd60399612ef
2010-07-15 16:20:59 -07:00
Christopher Tate
284e3ae11c Merge "NDK access to the Asset Manager" into gingerbread 2010-07-15 15:00:16 -07:00
David 'Digit' Turner
4948c16366 Remove prebuilt static library "libthreaded_app.a".
Make the "glue library" part of the NDK as an importable module,
this has several benefits:

- no need to distribute a binary here with no easy way to regenerate it

- no need to explicitely list -lthreaded_app in your LOCAL_LDLIBS
  (this is handled automatically by the module import capability)

- allows easier native debugging of what's really happening.

Note that the header is renamed <threaded_native_app.h>

+ Modify the native-activity sample to use and import the new module
+ Start documenting usage in the header file. We probably need something
  better, and will probably put it under development/ndk/docs/ at some
  point.

After this patch, we should be able to get rid of the code under
framework/base/native/{include.glue}

Change-Id: I6e81d70a225a6ca006beabf6e8b42529e8f371b9
2010-07-13 23:50:02 -07:00
Christopher Tate
956311c625 NDK access to the Asset Manager
Change-Id: Ibe380e352af98f953bfc2398b498a6ccb242bcec
2010-07-13 19:38:20 -07:00
Dianne Hackborn
98b2c359c2 Copy over updated NDK APIs and follow other API changes.
Change-Id: Ifec95268c9ade21963eea13357ec2f56fd7968c2
2010-07-13 18:45:52 -07:00
Jeff Brown
52705bb02c Add initial gamepad support.
Change-Id: Ide1922ea36f8b64100b4dba57e718479b8a0bec5
2010-07-13 16:47:03 -07:00
David 'Digit' Turner
5ef6b2f256 ndk sample hello-neon: use $(call import-module) to access the 'cpufeatures' library
Change-Id: I29397158de0ccdd89dfe4da72a544fad14a8324e
2010-07-13 15:51:46 -07:00
Dianne Hackborn
29534f6275 Update for improved glue.
Change-Id: I73bb23644523e8ec19c51a3e3b9c5c4f7a98c558
2010-07-09 18:21:45 -07:00
Dianne Hackborn
1aa3218800 Add new native-plasma sample code.
This shows direct drawing to an ANativeWindow's bits.

Update the NDK API, and fix a bug in the native-activity app where it
would hang while exiting.

Change-Id: I4fa98d083405eb0d1b22b10a73a2ef18d45fdb59
2010-07-09 16:58:52 -07:00
David 'Digit' Turner
f68d6af83f ndk: Add a test to check that prebuilt libraries work as expected.
Change-Id: I7c0683ac1ee50bb62cc0f7ac22e839f749ec1cdf
2010-07-09 09:56:31 -07:00
Dianne Hackborn
11a89ea0bd Update native_activity sample to use new glue code.
The native_activity sample is now built with the new threaded_app
glue code, removing all of the boiler-plate code from it.  This
adds the glue code (header and .a) to the NDK.

Change-Id: I2a7be473811f22f948dcda3da8034dd0bd62049d
2010-07-08 12:23:58 -07:00
David 'Digit' Turner
d15a18bdd2 Merge "Remove C++ headers from the platform directories." into gingerbread 2010-07-07 14:19:10 -07:00
David 'Digit' Turner
2708f19ba3 Merge "Update API level 9 sysroot to allow static C++ destructors to be called on dlclose()." into gingerbread 2010-07-07 14:14:47 -07:00
David 'Digit' Turner
74ff6746d1 Remove C++ headers from the platform directories.
We now rely instead on the content of $NDK/sources/cxx-stl/system/include
that is automatically used if a module has C++ sources.

Change-Id: I4319d9260fcf9fb31c59c2f21ca64b536725d4f5
2010-07-07 12:57:25 -07:00
Dianne Hackborn
02215b36dd Update to use new looper API.
Also need to put back the stub Java class for now, as the
build system still seems to require it.

Change-Id: I31917a1fc7c0bf8cd928969125f94d55c59d42f8
2010-07-02 18:54:33 -07:00