h3-java icon indicating copy to clipboard operation
h3-java copied to clipboard

Build Android binaries with 16k alignment

Open isaacbrodsky opened this issue 1 year ago • 2 comments

  • https://developer.android.com/guide/practices/page-sizes#compile-16-kb-alignment

We may need to rebuild or adjust our build settings to be compatible. Current page size is 4k. If nothing else, we should make a Hello World H3-on-Android app that we can use as a reference or for testing.

isaacbrodsky avatar Nov 15 '24 00:11 isaacbrodsky

The recommendation from Google is that page size should always be determined dynamically for the system it's running it. There are devices from 4 - 64 (even though 16 is the new default), but outside of Android, other systems have diverged too.

tyvsmith avatar Nov 15 '24 18:11 tyvsmith

@isaacbrodsky any updates about adjusting library to 16 KB page size in android? It blocks applications which are using H3 library from upgrade to target sdk 35.

eapereskokov avatar Jun 04 '25 10:06 eapereskokov

Any plans on addressing this issue? It's blocking for Android apps that need to use H3 natively. Thanks.

eeVoskos avatar Jul 14 '25 08:07 eeVoskos

https://github.com/dockcross/dockcross/pull/895 will enable this for new builds in the cleanest way. Alternately we will need to set the linker options here https://developer.android.com/guide/practices/page-sizes#compile-r26-lower I have a draft of this support at https://github.com/isaacbrodsky/h3-java/pull/3

Unfortunately, releasing a new version of com.uber:h3 is blocked on #174.

isaacbrodsky avatar Jul 15 '25 00:07 isaacbrodsky

Starting from Android 15, 16KB alignment is supported, and it is reported to have a significant performance impact. Android Studio also shows a warning for libraries that are not built with 16KB alignment. Would it be possible to obtain an officially built artifact of the h3-java library with 16KB alignment?

https://developer.android.com/guide/practices/page-sizes

yeonho84lee avatar Aug 11 '25 12:08 yeonho84lee

Thanks for this! Would you be able to update https://github.com/isaacbrodsky/h3-android-sample to include the latest .jar?

systemed avatar Sep 01 '25 17:09 systemed

Certainly, please see isaacbrodsky/h3-android-sample#5

isaacbrodsky avatar Sep 02 '25 02:09 isaacbrodsky