Is go/mobile ready for general application development?

agolangf · · 754 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>While it was initially being developed it was mentioned that it is focused on game development. Is it possible to develop native UI applications in Go these days? Is there an example application?</p> <p>There was a calculator application, but the source for its UI or OS specific code were not released.</p> <hr/>**评论:**<br/><br/>vendakka: <pre><p>It works nicely if you write the UI and system related code in Java/ObjC with the business logic in Go. As far as cross platform UI goes there&#39;s exp/shiny but that&#39;s targeted more towards desktop. I&#39;m currently prototyping a cross platform UI library that uses native Android and IOS widgets. It&#39;ll probably be ready to try in Feb. I can send you a link once I release it if you like. </p></pre>mixedCase_: <pre><p>I am quite interested in something like that, would you mind sending me a link as well?</p></pre>dasacc22: <pre><p>likewise, I&#39;m working on a pure implementation of material design: <a href="https://github.com/dskinner/material">https://github.com/dskinner/material</a></p> <p>This is intended for use in &#34;pure&#34; Go apps. If development looks slow it&#39;s b/c my time is divided between that, the example app (which will be pushed here once i find it acceptable <a href="https://github.com/dskinner/cell">https://github.com/dskinner/cell</a>), and reimplementing the binary resource generation for android in gomobile itself.</p> <p>The current focus of the material package is the simplex subpackage for implementing responsive ui which is already functioning to some degree (just haven&#39;t settled on api). The intent is to work anywhere gomobile or exp/shiny works.</p> <p>I look forward to other solutions as well to UI, particularly in mobile (android/iOS) since i spend my day hours there.</p> <p>One thing worth noting is that doing business logic in Go and native UI on android can brick wall if you&#39;re doing lots of ads with an sdk using a webview (or just using a lot of webviews in general). This can be a show stopper depending on your needs. See for ref: <a href="https://github.com/golang/go/issues/12725">https://github.com/golang/go/issues/12725</a></p></pre>vendakka: <pre><p>The material package looks really interesting. Looking forward to seeing the results!</p></pre>vendakka: <pre><p>Sure thing. There&#39;s no link yet though. Expect one in mid to late Feb. </p></pre>GoTheFuckToBed: <pre><p>Happy cakeday!</p></pre>vendakka: <pre><p>Thanks! I didn&#39;t realize until you wished me.</p></pre>3264128256: <pre><p>That is super cool, I would very much like that. How was your experience so far developing it in Go?</p></pre>vendakka: <pre><p>Pretty good so far. The tricky parts are mainly in the ObjC and java. I can&#39;t explain it well but it really feels like it is easier for me to express ideas in Go.</p></pre>sbinet: <pre><p>I believe the calculator application you are talking about is Ivy. Here are the sources:</p> <p><a href="https://github.com/golang/mobile/tree/master/example/ivy">https://github.com/golang/mobile/tree/master/example/ivy</a></p> <p>Here is another example application:</p> <p><a href="https://github.com/golang/mobile/tree/master/example/flappy">https://github.com/golang/mobile/tree/master/example/flappy</a></p> <p>HTH...</p></pre>3264128256: <pre><p>Thanks!</p></pre>jeffrallen: <pre><p>It works. The interface between Go and Java/ObjC is kinda narrow. A few native types are supported and structs of them, but not slices of structs. The only variable-size data structure you can return is a []byte.</p> <p>An interesting solution is to use the []byte to send through a serialized version of your slice of structs. There are a million choices for serialization, of course, but an interesting one is flatbuffers. Worked for me: <a href="https://github.com/jeffallen/MarshrutMe" rel="nofollow">https://github.com/jeffallen/MarshrutMe</a> <a href="https://github.com/jeffallen/routedb" rel="nofollow">https://github.com/jeffallen/routedb</a> (that app is not in a useful state, but it would be useful to someone looking to see how to use flatbuffers + gomobile)</p> <p>-jeff</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

754 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传