This document summarizes different approaches for using the Go programming language to build Android applications. It discusses building a pure Go app using the NativeActivity class, integrating Go as a library using bindings, and spawning separate Go processes from an Android app using inter-process communication. Code examples are provided for each approach. While Go support for Android is still unstable, these techniques allow Go to be used for simple Android projects as an alternative to Java.
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
In this introduction to Test Driven Development (TDD) or Behaviour Driven Development (BDD) we give a high level description of what it is and why it is useful for developers. Then we go into some details on stubs and mocks, test data, UI testing, SQL testing, JavaScript testing, web services testing and how to start doing TDD/BDD on an existing code base.
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampTheo Jungeblut
Why writing Clean Code makes us more efficient Over the lifetime of a product, maintaining the product is actually one - if not the most - expensive area(s) of the overall product costs.
Writing clean code can significantly lower these costs. However, writing clean code also makes you more efficient during the initial development time and results in more stable code.
You will be presented design patterns and best practices which will make you write better and more easily maintainable code, seeing code in a holistic way. You will learn how to apply them by using an existing implementation as the starting point of the presentation. Finally, patterns & practices benefits are explained. This presentation is based on C# and Visual Studio 2012.
However, the demonstrated patterns and practice can be applied to almost every other programming language too.
Reactive Programming In Java Using: Project ReactorKnoldus Inc.
The session provides details about reactive programming with reactive streams. The purpose of Reactive Streams is to provide a standard for asynchronous stream processing with non-blocking backpressure.”
This concept is explained using Project reactor.
Learn how Acceptance Test Driven Development (ATDD) provides the process for capturing detailed requirements as acceptance criteria and turn them into as test cases before development begins using Behavior Driven Development (BDD). The BDD approach and Gherkin format is the language used to create easy to understand and actionable scenarios that map from the functional level to the components and units. We will discuss the different approaches to TDD including a realistic approach leveraging BDD to a purest standpoint where TDD use the tests to drive the design of the application. Finally understand how the tools in Visual Studio and Team foundation Server to support BDD such as SpecFlow (Cucumber in .NET), Refactoring tools, and Test Cases in MTM.
It is not to complicated to keep new project with good code quality for half year. Maybe, for one year. But what if team works on some project for years? Or even ”better”: you need to support and grow large project after another team. Presentation describes Continuous Inspection, main measures of code quality that will make your life better, continuous inspection and how to cook it with SonarQube.
This topic covers how business requirements are used to drive development using Behavior Driven Development (BDD) and its predecessor, Test Driven Development (TDD).
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
In this introduction to Test Driven Development (TDD) or Behaviour Driven Development (BDD) we give a high level description of what it is and why it is useful for developers. Then we go into some details on stubs and mocks, test data, UI testing, SQL testing, JavaScript testing, web services testing and how to start doing TDD/BDD on an existing code base.
Clean Code - Design Patterns and Best Practices at Silicon Valley Code CampTheo Jungeblut
Why writing Clean Code makes us more efficient Over the lifetime of a product, maintaining the product is actually one - if not the most - expensive area(s) of the overall product costs.
Writing clean code can significantly lower these costs. However, writing clean code also makes you more efficient during the initial development time and results in more stable code.
You will be presented design patterns and best practices which will make you write better and more easily maintainable code, seeing code in a holistic way. You will learn how to apply them by using an existing implementation as the starting point of the presentation. Finally, patterns & practices benefits are explained. This presentation is based on C# and Visual Studio 2012.
However, the demonstrated patterns and practice can be applied to almost every other programming language too.
Reactive Programming In Java Using: Project ReactorKnoldus Inc.
The session provides details about reactive programming with reactive streams. The purpose of Reactive Streams is to provide a standard for asynchronous stream processing with non-blocking backpressure.”
This concept is explained using Project reactor.
Learn how Acceptance Test Driven Development (ATDD) provides the process for capturing detailed requirements as acceptance criteria and turn them into as test cases before development begins using Behavior Driven Development (BDD). The BDD approach and Gherkin format is the language used to create easy to understand and actionable scenarios that map from the functional level to the components and units. We will discuss the different approaches to TDD including a realistic approach leveraging BDD to a purest standpoint where TDD use the tests to drive the design of the application. Finally understand how the tools in Visual Studio and Team foundation Server to support BDD such as SpecFlow (Cucumber in .NET), Refactoring tools, and Test Cases in MTM.
It is not to complicated to keep new project with good code quality for half year. Maybe, for one year. But what if team works on some project for years? Or even ”better”: you need to support and grow large project after another team. Presentation describes Continuous Inspection, main measures of code quality that will make your life better, continuous inspection and how to cook it with SonarQube.
This topic covers how business requirements are used to drive development using Behavior Driven Development (BDD) and its predecessor, Test Driven Development (TDD).
Muito se fala planejamento do que é realmente necessário para o usuário e maximizar o máximo de trabalho possível para minimizar o Lead Time. Mas você já pensou que levar em consideração como os testes serão planejados desde o início da release até a entrega, e que eles podem ser uma arma na identificação de dependências entre times e diminuição de incidentes?
Keycloak for Science Gateways - SGCI Technology Sampler Webinarmarcuschristie
Using Keycloak to Provide Authentication, Authorization, and Identity Management Services for Your Gateway
Presentation to accompany blog post: https://sciencegateways.org/-/eds-tech-blog-using-keycloak-to-provide-authentication-authorization-and-identity-management-services-for-your-gateway
Multithreading is the ability of a program or an
operating system process to manage its use by
more than one user at a time and to even manage
multiple requests by the same user without
having to have multiple copies of the
programming running in the computer.
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...VMware Tanzu
SpringOne 2021
Session Title:The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchronous to Reactive
Speakers: Kuassi Mensah, Director of Product Management at Oracle; Michael McMahon, Principal Member of Technical Staff at Oracle
New language from Google, static safe compiler, with GC and as fast as C++ or Java, syntax simpler then Python - 2 hour-long tutorial and you can start code.
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintanable services.
Agenda of the presentation:
1. Go is not C, not Java, not anything
2. Rob Pike argument
3. Main ideas and basics
4. Concurrency model
5. Tools
6. Issues
This is an introduction to BDD and the Gherkin syntax. It aims to explain:
* What's Gherkin. Why it's used. An example of all the keywords in Gherkin
* How Gherkin fits into BDD (features files, writing tests first etc)
I talked this presentation in GopherCon 2016.
Go Mobile (golang.org/x/mobile) is a project which shows new possibilities for mobile apps development.
Especially, for mobile games which requires high performance processing, Go can be expected to be an alternative to C and C++.
This session explains how to develop game apps using some packages such as app, event and sprite provided by Go Mobile project.
Furthermore the session introduces a way to call Android API from Go codes, and solutions for some problems which occurs when we distribute apps on Google Play.
I would like to show current capabilities and future potentials of Go Mobile.
Muito se fala planejamento do que é realmente necessário para o usuário e maximizar o máximo de trabalho possível para minimizar o Lead Time. Mas você já pensou que levar em consideração como os testes serão planejados desde o início da release até a entrega, e que eles podem ser uma arma na identificação de dependências entre times e diminuição de incidentes?
Keycloak for Science Gateways - SGCI Technology Sampler Webinarmarcuschristie
Using Keycloak to Provide Authentication, Authorization, and Identity Management Services for Your Gateway
Presentation to accompany blog post: https://sciencegateways.org/-/eds-tech-blog-using-keycloak-to-provide-authentication-authorization-and-identity-management-services-for-your-gateway
Multithreading is the ability of a program or an
operating system process to manage its use by
more than one user at a time and to even manage
multiple requests by the same user without
having to have multiple copies of the
programming running in the computer.
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...VMware Tanzu
SpringOne 2021
Session Title:The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchronous to Reactive
Speakers: Kuassi Mensah, Director of Product Management at Oracle; Michael McMahon, Principal Member of Technical Staff at Oracle
New language from Google, static safe compiler, with GC and as fast as C++ or Java, syntax simpler then Python - 2 hour-long tutorial and you can start code.
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintanable services.
Agenda of the presentation:
1. Go is not C, not Java, not anything
2. Rob Pike argument
3. Main ideas and basics
4. Concurrency model
5. Tools
6. Issues
This is an introduction to BDD and the Gherkin syntax. It aims to explain:
* What's Gherkin. Why it's used. An example of all the keywords in Gherkin
* How Gherkin fits into BDD (features files, writing tests first etc)
I talked this presentation in GopherCon 2016.
Go Mobile (golang.org/x/mobile) is a project which shows new possibilities for mobile apps development.
Especially, for mobile games which requires high performance processing, Go can be expected to be an alternative to C and C++.
This session explains how to develop game apps using some packages such as app, event and sprite provided by Go Mobile project.
Furthermore the session introduces a way to call Android API from Go codes, and solutions for some problems which occurs when we distribute apps on Google Play.
I would like to show current capabilities and future potentials of Go Mobile.
This manual is “How to Build” manual for OpenCV with OpenCL for Android.
If you want to “Use OpenCL on OpenCV” ONLY,
Please see
http://github.com/noritsuna/OpenCVwithOpenCL4AndroidNDKSample
Talk given at Devoxx Belgium 2018
Spring Boot is awesome. Docker is awesome. Together you can do great things. But, are you doing it the right way? We'll walk you through, in detail, the optimal way to structure Docker images for Spring Boot applications for iterative development. Structuring your Docker images correctly is really important for teams doing continuous integration and continuous delivery. Using Docker best practices, we'll show you the code and the technologies used to optimize Docker images for Spring Boot apps!
(Live) build and run golang web server on android.aviSeongJae Park
Presented from gdg devfair 2014 and gdg korea golang seoul meetup 2015.
Added explanation about go 1.4 official android support a little from gdg korea golang seoul meetup presentation.
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
The core content is about optimizing our web app development, functionality, and performance with various tooling. The main language/platform we will be talking are JavaScript and Node.js.
With the big delays in the time it takes until an iOS jailbreak is public and stable, it is often not possible to test mobile apps in the latest iOS version. Occasionally customers might also provide builds that only work in iOS versions for which no jailbreak is available. On Android the situation is better, but there can also be problems to root certain phone models. These trends make security testing of mobile apps difficult. This talk will cover approaches to defeat common security mechanisms that must be bypassed in the absence of root/jailbreak.
Introduction to Cloud Computing with Google Cloudwesley chun
This is a 20-30 minute technical talk introducing developers to cloud computing including an overview of Google Cloud computing products. There is a special focus on serverless tools as a convenient way for developers to run code. The talk ends with several inspirational apps showcasing what is possible with Google Cloud tools meant to plant a seed as to consider what is possible.
Biscuit: an operating system written in goSeongJae Park
Biscuit is a monolithic operating system kernel that is written in Go. This talk introduces the kernel and demonstrate how to build, install, and analyze the code.
An Introduction to the Formalised Memory Model for Linux KernelSeongJae Park
Linux kernel provides executable and formalized memory model. These slides describe the nature of parallel programming in the Linux kernel and what memory model is and why it is necessary and important for kernel programmers. The slides were used at KOSSCON 2018 (https://kosscon.kr/).
Deep dark-side of git: How git works internallySeongJae Park
Describe how git works internally using small and perfect plumbing commands.
The slide have been used at GDG DevFest 2014 and SOSCON 2014.
The slide can be updated later. And, the latest version would always be provided from this page always.
Short introduction about vcs & git usage.
Aimed to introduce concept of version control system and git to people who didn't used git or vcs yet. Doesn't introduce deep part of git or operating policy for git. Just focus on simple introduction about main functionality and abstracted internal design.
Describe how to contribute to open source projects.
Provide example process using two hot open source project, linux and AOSP(Android Open Source Project)
Describe how Android input system designed.
Describe the ways to make input event(such as touch, key press, ...) on Android in programmatic way, not manual way.
This can be helpful for some people thinking about Android remote control or test automation.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
2. This work by SeongJae Park is licensed under the Creative
Commons Attribution-ShareAlike 3.0 Unported License. To
view a copy of this license, visit http://creativecommons.
org/licenses/by-sa/3.0/.
3. This slides were presented during
3rd GDG Korea Android Conference
(http://event.android.gdg.kr/3rd-GKAC/)
The talk video is available at:
https://www.youtube.com/watch?v=vMZFjDipaK8&index=2&list=PL_WJkTbDHdBl5QXy6N_bMMBYlKLna5RER
4. Nice To Meet You
SeongJae Park
sj38.park@gmail.com
golang newbie programmer
5. Warning
● This speech could be useless for you
○ This is just for fun
http://m.c.lnkd.licdn.com/mpr/mpr/p/4/005/095/091/210ae8c.jpg
6. Warning
● This speech could be useless for you
○ This is just for fun
● Don’t try this at office
○ The code is not stable yet
http://m.c.lnkd.licdn.com/mpr/mpr/p/4/005/095/091/210ae8c.jpg
7. golang: Programming Language
● For simple, reliable, and efficient software.
http://blog.golang.org/5years/gophers5th.jpg
8. golang: Programming Language
● For simple, reliable, and efficient software.
● Could it be used for simple, reliable, and
efficient Android application?
http://blog.golang.org/5years/gophers5th.jpg
9. Golang and Android
● Golang supports Android from v1.4
○ Though it’s still unstable
10. Golang and Android
● Golang supports Android from v1.4
○ Though it’s still unstable
● https://github.com/golang/mobile
○ Packages and build tools for using Go on Android
11. Goal of This Speak
● Showing how we can use golang on Android
○ By exploring example code
12. Goal of This Speak
● Showing how we can use golang on Android
○ By exploring example code
● Just for fun, rather than profit
17. Main Idea: Use NDK
● c / c++ only apk is available
using NativeActivity
○ Golang be compiled to native binary, too. Why not?
http://www.android.pk/images/android-ndk.jpg
18. Main Idea: Use NDK
● c / c++ only apk is available
using NativeActivity
○ Golang be compiled to native binary, too. Why not?
Plan is...
● Build golang program as .so file
○ ELF shared object
● Implement every callbacks using OpenGL
http://www.android.pk/images/android-ndk.jpg
19. Main Idea: Use NDK
● c / c++ only apk is available
using NativeActivity
○ Golang be compiled to native binary, too. Why not?
Plan is...
● Build golang program as .so file
○ ELF shared object
● Implement every callbacks using OpenGL
● Build NativeActivity apk using NDK / SDK
http://www.android.pk/images/android-ndk.jpg
27. Build Process
Build golang code into ELF shared object for
ARM
mkdir -p jni/armeabi
CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7
go build -ldflags="-shared" -o jni/armeabi/libbasic.so .
ndk-build NDK_DEBUG=1
ant debug
(mobile/example/basic/make.bash)
28. Build Process
Build golang code into ELF shared object for
ARM
NDK to add the so file
mkdir -p jni/armeabi
CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7
go build -ldflags="-shared" -o jni/armeabi/libbasic.so .
ndk-build NDK_DEBUG=1
ant debug
(mobile/example/basic/make.bash)
29. Build Process
Build golang code into ELF shared object for
ARM
NDK to add the so file
SDK to build apk file
mkdir -p jni/armeabi
CGO_ENABLED=1 GOOS=android GOARCH=arm GOARM=7
go build -ldflags="-shared" -o jni/armeabi/libbasic.so .
ndk-build NDK_DEBUG=1
ant debug
(mobile/example/basic/make.bash)
30. Pure Golang Android App
Pros: No more JAVA! Yay!!!
Cons: Should I learn OpenGL to show a cat?
32. Java and C language connected via JNI
Main Idea: Use JNI-like way
Java
CPP
JNI
33. Main Idea: Use JNI-like way
Java and C language connected via JNI
C language and Golang connected via cgo
Java
CPP
GO
JNI CGO
34. Main Idea: Use JNI-like way
Java and C language connected via JNI
C language and Golang connected via cgo
...But, JNI and then cgo looks tedious
Java
CPP
GO
JNI CGO
35. Main Idea: Use JNI-like way
Java and C language connected via JNI
C language and Golang connected via cgo
...But, JNI and then cgo looks tedious
Golang supports Java-Golang bind
Java
CPP
GO
JNI CGO
bind/seq
37. Example Code
https://github.
com/golang/mobile/tree/
master/example/libhello
$ tree
.
├── all.bash
├── all.bat
├── AndroidManifest.xml
├── build.xml
├── hi
│ ├── go_hi
│ │ └── go_hi.go
│ └── hi.go
├── main.go
├── make.bash
├── make.bat
├── README
└── src
├── com
│ └── example
│ └── hello
│ └── MainActivity.java
└── go
└── hi
└── Hi.java
8 directories, 12 files
38. Callee in Go
Golang code is implementing Hello() function
func Hello(name string) {
fmt.Printf("Hello, %s!n", name)
}
(mobile/example/libhello/hi/hi.go)
40. gobind
generate language bindings that make it
possible to call Go code and pass objects from
Java
go install golang.org/x/mobile/cmd/gobind
gobind -lang=go github.com/libhello/hi > hi/go_hi/go_hi.go
gobind -lang=java github.com/libhello/hi > src/go/hi/Hi.java
41. gobind: Generated .java
Provides wrapper function for golang calling
code
public static void Hello(String name) {
go.Seq _in = new go.Seq();
go.Seq _out = new go.Seq();
_in.writeUTF16(name);
Seq.send(DESCRIPTOR, CALL_Hello, _in, _out);
}
private static final int CALL_Hello = 1;
private static final String DESCRIPTOR = "hi";
(mobile/example/libhello/src/go/hi/Hi.java)
42. gobind: Generated .go
Provides proxy and registering for the exported
function
func proxy_Hello(out, in *seq.Buffer) {
param_name := in.ReadUTF16()
hi.Hello(param_name)
}
func init() {
seq.Register("hi", 1, proxy_Hello)
}
(mobile/example/libhello/hi/go_hi/go_hi.go)
43. Golang as a Library
Pros: JAVA for UI, Golang for background
(Looks efficient enough)
44. Golang as a Library
Pros: JAVA for UI, Golang for background
(Looks efficient enough)
Cons: bind/seq is not so efficient, yet
46. Main Idea: Android is a Linux
http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
Android is a variant of Linux system with ARM
x86 Androids exist, though...
47. Main Idea: Android is a Linux
http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
Android is a variant of Linux system with ARM
x86 Androids exist, though...
Go supports ARM & Linux Officially
with static-linking
48. Main Idea: Android is a Linux
http://www.kitguru.net/wp-content/uploads/2012/03/linux-android.png
Android is a variant of Linux system with ARM
x86 Androids exist, though...
Go supports ARM & Linux Officially
with static-linking
Remember the philosophy of Unix
51. Golang Process on Android: Plan
1. Cross compile Go program as ARM / Linux
52. Golang Process on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
53. Golang Process on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
3. Copy the binary in private space of the app
54. Golang Process on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
3. Copy the binary in private space of the app
4. Give execute permission to the binary
/data/data/com.example.goRunner/files # ls -al
-rwxrwxrwx u0_a55 u0_a55 4512840 2014-11-28 17:45 gobin
55. Golang Process on Android: Plan
1. Cross compile Go program as ARM / Linux
2. Include the binary in assets/ of Android app
3. Copy the binary in private space of the app
4. Give execute permission to the binary
5. Execute it
/data/data/com.example.goRunner/files # ls -al
-rwxrwxrwx u0_a55 u0_a55 4512840 2014-11-28 17:45 gobin
56. Go bin Loading
Load golang program from assets to private dir
private void copyGoBinary() {
String dstFile = getBaseContext().getFilesDir().getAbsolutePath() + "/verChecker.bin";
try {
InputStream is = getAssets().open("go.bin");
FileOutputStream fos = getBaseContext().openFileOutput(
"verChecker.bin", MODE_PRIVATE);
byte[] buf = new byte[8192];
int offset;
while ((offset = is.read(buf)) > 0) {
fos.write(buf, 0, offset);
}
Runtime.getRuntime().exec("chmod 0777 " + dstFile);
} catch (IOException e) { }
}
57. Execute Go process
Spawn new process for the program and
communicates using stdio
ProcessBuilder pb = new ProcessBuilder();
pb.command(goBinPath());
pb.redirectErrorStream(false);
goProcess = pb.start();
new CopyToAndroidLogThread("stderr",
goProcess.getErrorStream())
.start();
59. Inter Process Communication
Pros: Just normal unix way
Golang team is using this for Camlistore
(https://github.com/camlistore/camlistore)
60. Inter Process Communication
Pros: Just normal unix way
Golang team using this for Camlistore
(https://github.com/camlistore/camlistore)
Cons: Hacky, a little
61. Summary
You can use Golang for Android
though it’s not stable yet
Just for fun
62. This work by SeongJae Park is licensed under the
Creative Commons Attribution-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http:
//creativecommons.org/licenses/by-sa/3.0/.