Steps to develop a mobile app using Golang

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Gomobile bind-target=android Golang.org/x/mobile/example/bind/hello

D:\go\src\golang.org\x\mobile\example\bind>gomobile bind-target=android./hello

git clone https://github.com/golang/mobile.git

    • Download
      $ go Get golang.org/x/mobile/cmd/gomobile

    • Installation (requires a few minutes to wait)
      Gomobile Init

3. There are two ways to develop mobile apps Golang

A. Native application development

$ go get-d golang.org/x/mobile/example/basic

    • Main application areas:

      • application control management and configuration
      • OpenGL ES 2 bindings
      • Asset Management
      • Event Management
      • the package in the experiment contains openal bindings, audio, fonts, graphics, and motion sensors
    • Android Development

      • $ gomobile build-target=android Golang.org/x/mobile/example/basic
        This command generates an APK installation package named Basic

      • $ gomobile Install Golang.org/x/mobile/example/basic
        This command installs the APK package to the connected Android device

    • iOS development

      • $ gomobile Build-target=ios Golang.org/x/mobile/example/basic
        This command generates an app installation package called Basic

      • Download iOS install Package command-line tool-Ios-deploy
        $ ios-deploy-b Basic.app
        This command installs the app file to an enabled iOS emulator or to a connected iOS device

B. Hybrid binding development

$ go get-d golang.org/x/mobile/example/bind/...

      • Benefits
        • Go code reuse
        • share common Go code in Android and iOS development by calling the bound Golang package name
      • Restrictions

        • only some go types currently supported
        • binding between languages has performance overhead

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.