1

I use gomobile bind generated an .arr file.

gomobile version
gomobile version +e154aff Wed Dec 2 14:48:43 2015 +0000 (android); androidSDK=D:\android\sdk\platforms\android-23

go version
go version go1.5.2 windows/amd64

Go code include a func which access to web.

client := &http.Client{}
req, err := http.NewRequest("GET", url, nil)
if err != nil {
    log.Fatal(err.Error())
}
resp, err := client.Do(req)

I add this .arr to my Android project in Android Studio, build and install a apk to Virtual Devices.

But the app can't access to web.

After running app it comes out:

 GoLog: Get www.google.com: unsupported protocol scheme ""

I must missed something, please help me.

hardPass
  • 19,033
  • 19
  • 40
  • 42
  • Sorry, such a stupid question asked by myself. The log just said scheme is empty. I should use "http://" in the url "www.google.com". In golang code, I test the `func` with correct url, and it works. In android project, the url is coming from user input. So, I should never ignore the log. This thing bugs me all day until now , I saw the window clicked. – hardPass Dec 08 '15 at 09:21

1 Answers1

2

It's nothing to do with gomobile. The url www.google.com should started with http://.

hardPass
  • 19,033
  • 19
  • 40
  • 42