Change-Id: I574f9ea8ab8138c769be19df8b1e86a7fbe544a8
Reviewed-on: https://go-review.googlesource.com/9879
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
This is the initial CL of a series to add iOS build support for
darwin/arm and darwin/arm64.
The builder utility is not invoked during $ gomobile build currently.
gomobile build will invoke goIOSBuild and codesign the generated
binary with assets available on the source directory to build an app
file. This app file might converted into an IPA as an ad-hoc
distribution archive.
darwin/arm and darwin/arm64 cross builders need to be built during
gomobile initialization step and tools need to be moved under
$GOROOT/pkg/gomobile/ios.
Change-Id: Ifb8d3c0f37611c78ca9c8887a367750fb98a546a
Reviewed-on: https://go-review.googlesource.com/10085
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
test.bash is a simple script that builds the c-shared library from
test_main.go, compiles SeqTest.m and the objective-c bindings of testpkg
(testpkg/objc_testpkg/GoTestpkg.*), and runs the output. Eventually this
will be replaced with coed that runs gomobile bind & xcodebuild.
The code under testpkg/go_testpkg and testpkg/objc_testpkg is the output
of gobind (now manually-generated). I am adding it to repo now in order
to get the testpkg/objc_tstpkg reviewed. Eventually, this will be
removed from the repo.
Change-Id: I8d6af3732337992af922cb4615a63f385e19d489
Reviewed-on: https://go-review.googlesource.com/9826
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Also fixes a parameter name handling problem when processing a
function signature that omits parameter names.
Fixesgolang/go#10788.
Change-Id: I65273d330bbf3a836ec9e4ffb691927970d795d8
Reviewed-on: https://go-review.googlesource.com/9926
Reviewed-by: Alan Donovan <adonovan@google.com>
The previous way (JNIEnv's FindClass with "[B") does not work
in Android-L for some reason.
Change-Id: I5cccb7bbf651df981a923ecade863302521d5c5c
Reviewed-on: https://go-review.googlesource.com/9783
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: Ic7dad34ec242910540da4d6bae94f45907b3d0dd
Reviewed-on: https://go-review.googlesource.com/9898
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Fixesgolang/go#10760 maybe, I have been unable to reproduce it.
Change-Id: Iaeec631f5a6be29b312969df12f6bd6b95bc2aa1
Reviewed-on: https://go-review.googlesource.com/9880
Reviewed-by: Burcu Dogan <jbd@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Destroy sounds like C, we should use Close in Go.
Change-Id: I73da732300a955e458513f15ad898b7f34c8ed7c
Reviewed-on: https://go-review.googlesource.com/9875
Reviewed-by: Nigel Tao <nigeltao@golang.org>
PCM data may contain a header, we need to skip it and stream the
audio data to the underlying OpenAL player. Otherwise, we will play
the header bytes as well and the sound will click.
The future work will include auto detecting the number of channels,
the bitrate and the sample rate from the header.
Fixesgolang/go#10728
Change-Id: Ie09e4c59a08207838d0c8f4c5d4d0cb08deb27cd
Reviewed-on: https://go-review.googlesource.com/9860
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Instead of trying to preserve the unpacked NDK, this stores the
downloaded archives in GOPATH/pkg/gomobile/dl and completely
rebuilds on reinitialization.
Also introduce checking that the version of Go we are using to do
the build matches the GOROOT we are building from.
Fixesgolang/go#10187
Change-Id: I4a861718d8a413855917a5b1f1073e2cd84c9bb1
Reviewed-on: https://go-review.googlesource.com/9685
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The most common use case to init a player is to open an asset and provide
it to NewPlayer. Currently, we require use to keep a reference to the source
and close it after the player is destroyed. It's tedious. We may improve
the usability by freeing the source asset on Destroy. And if the user
wants to play a ReadSeeker, they can implement a trivial ReadSeekCloser
with a noop Close.
Change-Id: Ie6bdea468da484f785bc0c283f13203cad3a1a68
Reviewed-on: https://go-review.googlesource.com/9693
Reviewed-by: Nigel Tao <nigeltao@golang.org>
This app makes a sound as the gopher hits the edges of the screen.
Change-Id: I85c7d55ec88b1a9faec5dfb7b29e03d1149f5d65
Reviewed-on: https://go-review.googlesource.com/9698
Reviewed-by: Nigel Tao <nigeltao@golang.org>
The gomobile bind command outputs an .aar file ready to include in an
Android project. If the including project use the minifyEnabled gradle
option the field go.Seq.memptr will be removed since it is only referenced
from C code.
Instruct the minifier to keep all go.* java code by adding an appropriate
proguard.txt file to the .aar file.
Change-Id: Ia1e89a5d8f4b4f349f9c2cf4d0dba2628557fdf9
Reviewed-on: https://go-review.googlesource.com/9802
Reviewed-by: David Crawshaw <crawshaw@golang.org>
On mobile devices, there is typically only a single audio device. We may
open it once and reuse it to stream audio buffers from multiple sources.
This assumption also applies to the context since OpenAL contextes are
process-wide. A shared global pointer is reusable across multiple
OpenAL sources.
This CL also removes the Device and Context types and the unexpected
garbage collection issue introduced by Context's finalizer.
Fixesgolang/go#10636
Change-Id: I82e6e6e6a1500ba91d66a7848cf37d1a5e01af9b
Reviewed-on: https://go-review.googlesource.com/9782
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Config provides a way to concurrently access Width and Height.
Register provides a way for packages to run code on app state change
without plumbing changes all the way to the process main function.
This is motivated by gl/glutil.Image which needs to rebuild its
textures on start/stop and can be deeply nested.
(See golang.org/cl/9707 for the followup.)
Tested manually on android and darwin/amd64. Doing this kind makes it
clear any CL modifying this code needs a lot of manual testing right
now, so some kind of trybot support is something I'm going to
prioritise.
Fixesgolang/go#10686Fixesgolang/go#10461Fixesgolang/go#10442Fixesgolang/go#10226
Updates golang/go#10327
Change-Id: I2882ebf3995b6ed857cda823e94fbb17c54b43a8
Reviewed-on: https://go-review.googlesource.com/9708
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: Ica709ed74b014feb21e632cd967279da3ebd41ad
Reviewed-on: https://go-review.googlesource.com/9730
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Keeping the Dockerfile as a reference to setup a working dev env
without gomobile init.
Fixes#10523
Change-Id: Ie5a359baff2c3b65ac34045fb8ab5560a23c0e22
Reviewed-on: https://go-review.googlesource.com/9686
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
The global constructor added for -buildmode=c-shared takes care
of a lot of the messier steps that were being done here.
Change-Id: I00525765855b2ad0fcecb0639d6a7ee3feea9ed9
Reviewed-on: https://go-review.googlesource.com/9648
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Useful if you are running an old unsupported Java 1.6.
Change-Id: I794bacc22a09ee339730ef7b600475eba09a3a9d
Reviewed-on: https://go-review.googlesource.com/9649
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Removing the duplicate installation instructions and giving a reference
to the gomobile godoc.
Change-Id: I476e4a4f4545eeb17d9ba18f471076d63c1f15d1
Reviewed-on: https://go-review.googlesource.com/9631
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
duplicate code from bind/java/seq_android.c to use for obj-c/go binding.
Change-Id: Iefd5d4171cca3a30c5d56f9b37647463e6fd0c5a
Reviewed-on: https://go-review.googlesource.com/9409
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Change-Id: Ie7bd43cdf8d759e6d739824c59cac0e01d1a4b95
Reviewed-on: https://go-review.googlesource.com/9630
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
An example of how to handle multiple concurrent touches using this design:
var touched = map[event.TouchSequenceID]*Widget{}
func touch(t event.Touch) {
if t.Type == event.TouchStart {
if w := widgetAt(t.Loc); w != nil {
touched[t.ID] = w
}
}
if w, ok := touched[t.ID]; ok {
// move/scroll widget, etc
}
if t.Type == event.TouchEnd {
delete(touched, t.ID)
}
}
Change-Id: I79910ef30abe9a41bc0720783022b1af081fbd43
Reviewed-on: https://go-review.googlesource.com/1895
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Burcu Dogan <jbd@google.com>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This CL also removes Android build system required files and keeping
it to the bare minimum to what gomobile requires.
Fixes#10523.
Change-Id: Iabf16e7ea040a74eaf64746e7cc4e23ef3683af2
Reviewed-on: https://go-review.googlesource.com/9204
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Change-Id: I50035006af8358ef2d794ae2c75dddc835f99f3d
Reviewed-on: https://go-review.googlesource.com/9141
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
There is some cleanup to be done in this package now, but I'm
deferring it until later in the cycle.
We should probably also change the semantics slightly: main should
be called for all-Go apps (that is, apps that use NativeActivity),
but it would be more consistent with buildmode=c-shared and c-archive
if we did not call main for Go shared libraries being included in
Java android apps.
Change-Id: I13ca797a478edb22b0c602c1ee6e616fe4fea1e6
Reviewed-on: https://go-review.googlesource.com/9016
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This change deletes unnecessary files - they are auto-generated by
the gomobile bind command.
Change-Id: I490664dfcf52683dd8d2ea821d0b7e458bc06671
Reviewed-on: https://go-review.googlesource.com/8925
Reviewed-by: David Crawshaw <crawshaw@golang.org>
OpenAL Soft is licensed with LGPL which requires users to add a notice
about its license under their open source notices screen.
Change-Id: Ic3c3bcc4a38896508b19d54a8c526bcd1fa9d5b3
Reviewed-on: https://go-review.googlesource.com/8868
Reviewed-by: David Crawshaw <crawshaw@golang.org>