bind/java: reenable asset access.

This is done by moving app.Context to internal/mobileinit,
introducing mobileinit.SetCurrentContext and,
making bind/java depend on it.

TODO: check gomobile bind's proguard rule - context lookup
was implemented through reflection on android.app.AppGlobals class.

Change-Id: Ieb6ad503eeef8c2c1c5836a21c667938c5a701a2
Reviewed-on: https://go-review.googlesource.com/12279
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Hyang-Ah (Hana) Kim
2015-07-16 21:15:37 +00:00
committed by Hyang-Ah Hana Kim
parent c6888a7bae
commit 136fa9bbbb
12 changed files with 131 additions and 39 deletions
+6
View File
@@ -17,6 +17,12 @@ public class SeqTest extends AndroidTestCase {
public SeqTest() {
}
public void testAssets() {
String want = "Hello, Assets.\n";
String got = Testpkg.ReadAsset();
assertEquals("Asset read", want, got);
}
public void testAdd() {
long res = Testpkg.Add(3, 4);
assertEquals("Unexpected arithmetic failure", 7, res);