code: 在Go中构建iOS和Android应用程序的框架(code:500怎么解决)

网友投稿 737 2022-10-09

code: 在Go中构建iOS和Android应用程序的框架(code:500怎么解决)

code: 在Go中构建iOS和Android应用程序的框架(code:500怎么解决)

Matcha - iOS and Android apps in Go

gomatcha.io

Matcha is in early development! There are many rough edges and APIs may still change. Please file issues for any bugs you find.

What is Matcha?

Matcha is a package for building iOS and Android applications and frameworks in Go. Matcha provides a UI component library similar to ReactNative and exposes bindings to Objective-C and java code through reflection. The library also provides Go APIs for common app tasks.

Examples

Installation - macOS

Matcha requires the following components to be installed.

Go 1.8+Xcode 8.3+Android Studio 2.3+ (with SDK 26, NDK and Android Support)

Start by installing Xcode and Android Studio. Instructions can be found at https://developer.apple.com/download/ and https://developer.android.com/studio/install.html.

You may need to run the following before starting Android Studio to allow it to read your GOPATH (https://stackoverflow.com/a/14285335). This also must be done on reboot.

launchctl setenv GOPATH $GOPATH

Open Android Studio's SDK Manager and under the SDK Platforms tab, install the Android 8 Platform (API 26). And in the SDK Tools tab, install NDK and the Android Support Repository.

Configure the ANDROID_HOME enviromental variable to point to the Android SDK by adding the following to your ~/.bash_profile. The Android SDK is often located at ~/Library/Android/sdk depending on your install.

export ANDROID_HOME=

Fetch the project and install the matcha command.

go get gomatcha.io/matcha/...

Next we build the Go standard library for iOS and Android with the following command. The output is installed at $GOPATH/pkg/matcha. If your path doesn't contain $GOPATH/bin, you may need to replace these calls with $GOPATH/bin/matcha.

matcha init

Now build the example project. The output is installed at $GOPATH/src/gomatcha.io/matcha/ios/MatchaBridge/MatchaBridge/MatchaBridge.a and $GOPATH/src/gomatcha.io/matcha/android/matchabridge.aar.

matcha build gomatcha.io/matcha/examples

We can now open the sample iOS project.

open $GOPATH/src/gomatcha.io/matcha/examples/ios-app/SampleApp.xcworkspace

Set the Development Team in Xcode under General > Signing and select SampleApp in the target dropdown in the upper right. Then run the App!

For Android, simply open the sample Android Studio project and hit run!

open -a /Applications/Android\ Studio.app $GOPATH/src/gomatcha.io/matcha/examples/android-app/SampleApp

Installation - Linux

Matcha requires the following components to be installed. iOS builds are not supported on Linux.

Go 1.8+Android Studio 2.3+ (with SDK 26, NDK and Android Support Library)

Start by installing Android Studio. Instructions can be found at https://developer.android.com/studio/install.html.

Open Android Studio's SDK Manager and under the SDK Platforms tab, install the Android 8 Platform (API 26). And in the SDK Tools tab, install NDK and the Android Support Repository.

Configure the ANDROID_HOME enviromental variable to point to the Android SDK by adding the following to your ~/.bash_profile. The Android SDK is often located at ~/Android/Sdk depending on your install.

export ANDROID_HOME=

Additionally add the following to your ~/.bash_profile to modify your PATH to include the Java compiler if it does not already. javac can often be found at /usr/local/android-studio/jre/bin.

export PATH=${PATH}:

Fetch the project and install the matcha command.

go get gomatcha.io/matcha/...

Next we build the Go standard library for Android with the following command. The output is installed at $GOPATH/pkg/matcha. If your path doesn't contain $GOPATH/bin, you may need to replace these calls with $GOPATH/bin/matcha.

matcha init

Now build the example project. The output is installed at $GOPATH/src/gomatcha.io/matcha/android/matchabridge.aar.

matcha build gomatcha.io/matcha/examples

Now open the sample Android Studio project and hit run!

/bin/studio.sh $GOPATH/src/gomatcha.io/matcha/examples/android-app/SampleApp

Installation - Windows

Matcha requires the following components to be installed. iOS builds are not supported on Windows.

Go 1.8+Android Studio 2.3+ (with SDK 26, NDK and Android Support Library)

Start by installing Android Studio. Instructions can be found at https://developer.android.com/studio/install.html.

Open Android Studio's SDK Manager and under the SDK Platforms tab, install the Android 8 Platform (API 26). And in the SDK Tools tab, install NDK and the Android Support Repository.

Configure the ANDROID_HOME enviromental variable to point to the Android SDK. The Android SDK is often located at %USERPROFILE%\AppData\Local\Android\Sdk depending on your install.

setx ANDROID_HOME

Modify your PATH to include the Java compiler if it does not already. javac can often be found at C:\Program Files\Android\Android Studio\jre\bin.

setx PATH %PATH%;

Fetch the project and install the matcha command.

go get gomatcha.io/matcha/...

Next we build the Go standard library for Android with the following command. The output is installed at $GOPATH/pkg/matcha. If your path doesn't contain $GOPATH/bin, you may need to replace these calls with $GOPATH/bin/matcha.

matcha init

Now build the example project. The output is installed at $GOPATH/src/gomatcha.io/matcha/android/matchabridge.aar.

matcha build gomatcha.io/matcha/examples

Now open the sample Android Studio project and hit run!

Try it out!

Install the projectRead the Getting Started guideGo through some examplesLearn the basic concepts

Contact us

Join the Gophers Slack channelTweet @gomatcha.io on TwitterStar us on GitHubEmail the team

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Paginize是Android的一个轻量级的应用程序框架
下一篇:EMACS文本编辑器的使用
相关文章

 发表评论

暂时没有评论,来抢沙发吧~